Updates for latest MSPSim memory API

This commit is contained in:
Niclas Finne 2012-03-29 10:35:45 +02:00
parent 28f8467ab1
commit 26e7698d32
5 changed files with 8 additions and 6 deletions

View file

@ -220,7 +220,7 @@ public abstract class MspMote extends AbstractEmulatedMote implements Mote, Watc
this.myCpu.setMonitorExec(true);
this.myCpu.setTrace(0); /* TODO Enable */
int[] memory = myCpu.getMemory();
int[] memory = myCpu.memory;
logger.info("Loading firmware from: " + fileELF.getAbsolutePath());
GUI.setProgressMessage("Loading " + fileELF.getName());
node.loadFirmware(((MspMoteType)getType()).getELF(), memory);

View file

@ -37,6 +37,7 @@ import se.sics.cooja.AddressMemory;
import se.sics.cooja.Mote;
import se.sics.cooja.MoteMemory;
import se.sics.mspsim.core.MSP430;
import se.sics.mspsim.core.Memory.AccessMode;
import se.sics.mspsim.core.Memory.AccessType;
import se.sics.mspsim.util.MapEntry;
@ -199,12 +200,12 @@ public class MspMoteMemory implements MoteMemory, AddressMemory {
}
@Override
public void notifyReadAfter(int address, int mode, AccessType type) {
public void notifyReadAfter(int address, AccessMode mode, AccessType type) {
mm.memoryChanged(MspMoteMemory.this, MemoryEventType.READ, address);
}
@Override
public void notifyWriteAfter(int dstAddress, int data, int mode) {
public void notifyWriteAfter(int dstAddress, int data, AccessMode mode) {
mm.memoryChanged(MspMoteMemory.this, MemoryEventType.WRITE, dstAddress);
}
}

View file

@ -81,7 +81,7 @@ public class MspDebugOutput extends Log {
this.mote.getCPU().addWatchPoint(mem.getVariableAddress(CONTIKI_POINTER),
memoryMonitor = new MemoryMonitor.Adapter() {
@Override
public void notifyWriteAfter(int adr, int data, int mode) {
public void notifyWriteAfter(int adr, int data, Memory.AccessMode mode) {
String msg = extractString(mem, data);
if (msg != null && msg.length() > 0) {
lastLog = "DEBUG: " + msg;

View file

@ -42,6 +42,7 @@ import se.sics.cooja.Mote;
import se.sics.cooja.interfaces.MoteID;
import se.sics.cooja.mspmote.MspMote;
import se.sics.cooja.mspmote.MspMoteMemory;
import se.sics.mspsim.core.Memory;
import se.sics.mspsim.core.MemoryMonitor;
/**
@ -112,7 +113,7 @@ public class MspMoteID extends MoteID {
memoryMonitor = new MemoryMonitor.Adapter() {
@Override
public void notifyWriteAfter(int dstAddress, int data, int mode) {
public void notifyWriteAfter(int dstAddress, int data, Memory.AccessMode mode) {
byte[] id = new byte[2];
id[0] = (byte) (moteID & 0xff);
id[1] = (byte) ((moteID >> 8) & 0xff);

View file

@ -133,7 +133,7 @@ public class MspBreakpoint implements Watchpoint {
private void createMonitor() {
memoryMonitor = new MemoryMonitor.Adapter() {
@Override
public void notifyReadBefore(int addr, int mode, Memory.AccessType type) {
public void notifyReadBefore(int addr, Memory.AccessMode mode, Memory.AccessType type) {
if (type != Memory.AccessType.EXECUTE) {
return;
}