Package avrora.sim.util

Examples of avrora.sim.util.MulticastWatch


     * object associated with this segment if the access is not within the bounds of the segment.
     * @param address the address in the segment from which to read the byte
     * @return the byte value at this location
     */
    public byte read(int address) {
        MulticastWatch p;
        // FAST PATH 1: no watches
        if ( segment_watches == null ) {
            return checked_read(address);
        }

        // FAST PATH 2: no watches for this address
        p = segment_watches[address];
        if ( p == null) {
            return checked_read(address);
        }

        // SLOW PATH: consult with memory watches
        p.fireBeforeRead(interpreter.state, address);
        byte val = checked_read(address);
        p.fireAfterRead(interpreter.state, address, val);
        return val;
    }
View Full Code Here


     * object associated with this segment if the access is not within the bounds of the segment.
     * @param address the address in the segment which should be written
     * @param val the value to write to the location in the segment
     */
    public void write(int address, byte val) {
        MulticastWatch p;
        // FAST PATH 1: no watches
        if ( segment_watches == null ) {
            checked_write(address, val);
            return;
        }

        // FAST PATH 2: no watches for this address
        p = segment_watches[address];
        if ( p == null) {
            checked_write(address, val);
            return;
        }

        // SLOW PATH: consult with memory watches
        p.fireBeforeWrite(interpreter.state, address, val);
        checked_write(address, val);
        p.fireAfterWrite(interpreter.state, address, val);
    }
View Full Code Here

    public void insertWatch(int data_addr, Simulator.Watch p) {
        if (segment_watches == null)
            segment_watches = new MulticastWatch[size];

        // add the probe to the multicast probe present at the location (if there is one)
        MulticastWatch mcw = segment_watches[data_addr];
        if (mcw == null) mcw = segment_watches[data_addr] = new MulticastWatch();
        mcw.add(p);
    }
View Full Code Here

    public void removeWatch(int data_addr, Simulator.Watch p) {
        if (segment_watches == null)
            return;

        // remove the probe from the multicast probe present at the location (if there is one)
        MulticastWatch w = segment_watches[data_addr];
        if (w == null) return;
        w.remove(p);
    }
View Full Code Here

    protected void insertWatch(Simulator.Watch p, int data_addr) {
        if (sram_watches == null)
            sram_watches = new MulticastWatch[sram.length];

        // add the probe to the multicast probe present at the location (if there is one)
        MulticastWatch w = sram_watches[data_addr];
        if (w == null) w = sram_watches[data_addr] = new MulticastWatch();
        w.add(p);
    }
View Full Code Here

    protected void removeWatch(Simulator.Watch p, int data_addr) {
        if (sram_watches == null)
            return;

        // remove the probe from the multicast probe present at the location (if there is one)
        MulticastWatch w = sram_watches[data_addr];
        if (w == null) return;
        w.remove(p);
    }
View Full Code Here

     *
     * @param address the byte address at which to write the value
     * @param val     the value to write
     */
    public void writeDataByte(int address, byte val) {
        MulticastWatch p;

        try {
            // FAST PATH 1: no watches
            if (sram_watches == null) {
                setSRAM(address, val);
                return;
            }

            // FAST PATH 2: no watches for this address
            p = sram_watches[address];
            if (p == null) {
                setSRAM(address, val);
                return;
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            writeError("sram", address, val);
            return;
        }

        // SLOW PATH: consult with memory watches
        p.fireBeforeWrite(state, address, val);
        setSRAM(address, val);
        p.fireAfterWrite(state, address, val);
    }
View Full Code Here

   *
   * @param address the byte address at which to write the value
   * @param val    the value to write
   */
  public void writeDataByte(int address, byte val) {
    MulticastWatch p;

    try {
      // FAST PATH 1: no watches
      if (sram_watches == null) {
        setSRAM(address, val);
        return;
      }

      // FAST PATH 2: no watches for this address
      p = sram_watches[replaceAddress(address)];
      if (p == null) {
        setSRAM(address, val);
        return;
      }
    } catch (ArrayIndexOutOfBoundsException e) {
      writeError("sram", address, val);
      return;
    }

    // SLOW PATH: consult with memory watches
    p.fireBeforeWrite(state, address, val);
    setSRAM(address, val);
    p.fireAfterWrite(state, address, val);
  }
View Full Code Here

TOP

Related Classes of avrora.sim.util.MulticastWatch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.