Package se.sics.mspsim.util

Examples of se.sics.mspsim.util.MapEntry


    }
    throw new UnknownVariableException(varName);
  }

  public int getVariableAddress(String varName) throws UnknownVariableException {
    MapEntry entry = getMapEntry(varName);
    return entry.getAddress();
  }
View Full Code Here


  }

  /* TODO Check correct variable size in below methods */

  public int getIntValueOf(String varName) throws UnknownVariableException {
    MapEntry entry = getMapEntry(varName);

    int varAddr = entry.getAddress();
    byte[] varData = getMemorySegment(varAddr, 2);
    return parseInt(varData);
  }
View Full Code Here

    byte[] varData = getMemorySegment(varAddr, 2);
    return parseInt(varData);
  }

  public void setIntValueOf(String varName, int newVal) throws UnknownVariableException {
    MapEntry entry = getMapEntry(varName);
    int varAddr = entry.getAddress();

    int newValToSet = Integer.reverseBytes(newVal);

    // Create byte array
    int pos = 0;
View Full Code Here

    setMemorySegment(varAddr, varData);
  }

  public byte getByteValueOf(String varName) throws UnknownVariableException {
    MapEntry entry = getMapEntry(varName);
    int varAddr = entry.getAddress();

    byte[] varData = getMemorySegment(varAddr, 1);

    return varData[0];
  }
View Full Code Here

    return varData[0];
  }

  public void setByteValueOf(String varName, byte newVal) throws UnknownVariableException {
    MapEntry entry = getMapEntry(varName);
    int varAddr = entry.getAddress();

    byte[] varData = new byte[1];

    varData[0] = newVal;
View Full Code Here

    setMemorySegment(varAddr, varData);
  }

  public byte[] getByteArray(String varName, int length) throws UnknownVariableException {
    MapEntry entry = getMapEntry(varName);
    int varAddr = entry.getAddress();

    return getMemorySegment(varAddr, length);
  }
View Full Code Here

    return getMemorySegment(varAddr, length);
  }

  public void setByteArray(String varName, byte[] data) throws UnknownVariableException {
    MapEntry entry = getMapEntry(varName);
    int varAddr = entry.getAddress();

    setMemorySegment(varAddr, data);
  }
View Full Code Here

    }
    if (di == null) {
      /* Return PC value */
      SimpleProfiler sp = (SimpleProfiler)myCpu.getProfiler();
      try {
        MapEntry mapEntry = sp.getCallMapEntry(0);
        if (mapEntry != null) {
          String file = mapEntry.getFile();
          if (file != null) {
            if (file.indexOf('/') >= 0) {
              file = file.substring(file.lastIndexOf('/')+1);
            }
          }
          String name = mapEntry.getName();
          return file + ":?:" + name;
        }
        return String.format("*%02x", pc);
      } catch (Exception e) {
        return null;
View Full Code Here

    servicedInterrupt = -1;
    servicedInterruptUnit = null;
 

  void profileCall(int dst, int pc) {
      MapEntry function = map.getEntry(dst);
      if (function == null) {
          function = getFunction(map, dst);
      }
      profiler.profileCall(function, cpuCycles, pc);
  }
View Full Code Here

  public int getModeMax() {
    return MODE_MAX;
  }

  MapEntry getFunction(MapTable map, int address) {
    MapEntry function = new MapEntry(MapEntry.TYPE.function, address, 0,
        "fkn at $" + getAddressAsString(address), null, true);
    map.setEntry(function);
    return function;
  }
View Full Code Here

TOP

Related Classes of se.sics.mspsim.util.MapEntry

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.