You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(21) |
Nov
(12) |
Dec
(41) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(25) |
Feb
(54) |
Mar
(63) |
Apr
(52) |
May
(17) |
Jun
(3) |
Jul
(3) |
Aug
(5) |
Sep
(49) |
Oct
(50) |
Nov
(34) |
Dec
(14) |
2009 |
Jan
(9) |
Feb
(15) |
Mar
(38) |
Apr
(12) |
May
(35) |
Jun
(20) |
Jul
(2) |
Aug
(7) |
Sep
(36) |
Oct
(24) |
Nov
(2) |
Dec
(2) |
2010 |
Jan
(14) |
Feb
(1) |
Mar
(36) |
Apr
(2) |
May
(4) |
Jun
(6) |
Jul
(35) |
Aug
(11) |
Sep
(8) |
Oct
(3) |
Nov
|
Dec
(1) |
2011 |
Jan
(11) |
Feb
(12) |
Mar
(3) |
Apr
(7) |
May
(12) |
Jun
(8) |
Jul
|
Aug
(3) |
Sep
(4) |
Oct
|
Nov
(2) |
Dec
(4) |
2012 |
Jan
(2) |
Feb
(1) |
Mar
(14) |
Apr
(5) |
May
(28) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(21) |
Nov
(4) |
Dec
(1) |
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fro...@us...> - 2008-03-17 09:46:57
|
Revision: 186 http://mspsim.svn.sourceforge.net/mspsim/?rev=186&view=rev Author: fros4943 Date: 2008-03-17 02:46:42 -0700 (Mon, 17 Mar 2008) Log Message: ----------- added rssi support (using offset from datasheet) Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-03-14 22:46:01 UTC (rev 185) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-03-17 09:46:42 UTC (rev 186) @@ -376,6 +376,19 @@ return (registers[REG_TXCTRL] & 0x1f); } + private static int RSSI_OFFSET = -45; /* cc2420 datasheet */ + + public void setRSSI(int power) { + if (power < -128) { + power = -128; + } + registers[REG_RSSI] = power - RSSI_OFFSET; + } + + public int getRSSI() { + return registers[REG_RSSI] + RSSI_OFFSET; + } + public int getOutputPower() { /* From CC2420 datasheet */ int indicator = getOutputPowerIndicator(); @@ -472,7 +485,7 @@ memory[adr++] = element & 0xff; } // Should take a RSSI value as input or use a set-RSSI value... - memory[adr++] = (202) & 0xff; + memory[adr++] = (registers[REG_RSSI]) & 0xff; // Set CRC ok and add a correlation memory[adr++] = (37) | 0x80; rxPacket = true; @@ -481,7 +494,7 @@ updateFifopPin(); } - private void flushRX() { + private void flushRX() { if (DEBUG) { System.out.println("Flushing RX! was: " + rxPacket + " len = " + rxLen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-14 22:46:07
|
Revision: 185 http://mspsim.svn.sourceforge.net/mspsim/?rev=185&view=rev Author: joxe Date: 2008-03-14 15:46:01 -0700 (Fri, 14 Mar 2008) Log Message: ----------- updated changelog Modified Paths: -------------- mspsim/CHANGE_LOG.txt Modified: mspsim/CHANGE_LOG.txt =================================================================== --- mspsim/CHANGE_LOG.txt 2008-03-14 22:40:35 UTC (rev 184) +++ mspsim/CHANGE_LOG.txt 2008-03-14 22:46:01 UTC (rev 185) @@ -2,8 +2,12 @@ Changes: - fixed multiplier to handle the different modes better. - refactored so that IOUnit is no longer a Chip -- added statistics commands to the CLI +- added statistics commands and an exec command to the CLI - implemented better support for statistics (operating mode) +- fixed interrupt handling bugs in IOUnit +- added API for accessing frequency/channel and output power in CC2420 +- refactored radio emulation code of ESB platform into a separate TR1001 class +- added watch on register, grep, and other commands in CLI 0.84 Changes: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-14 22:40:50
|
Revision: 184 http://mspsim.svn.sourceforge.net/mspsim/?rev=184&view=rev Author: joxe Date: 2008-03-14 15:40:35 -0700 (Fri, 14 Mar 2008) Log Message: ----------- removed debug printouts. Modified Paths: -------------- mspsim/se/sics/mspsim/core/ADC12.java mspsim/se/sics/mspsim/core/BasicClockModule.java Modified: mspsim/se/sics/mspsim/core/ADC12.java =================================================================== --- mspsim/se/sics/mspsim/core/ADC12.java 2008-03-14 16:41:14 UTC (rev 183) +++ mspsim/se/sics/mspsim/core/ADC12.java 2008-03-14 22:40:35 UTC (rev 184) @@ -43,6 +43,8 @@ public class ADC12 extends IOUnit { + private static final boolean DEBUG = false; + public static final int ADC12CTL0 = 0x01A0;// Reset with POR public static final int ADC12CTL1 = 0x01A2;// Reset with POR public static final int ADC12IFG = 0x01A4; //Reset with POR @@ -110,7 +112,7 @@ enableConversion = (value & 0x02) > 0; startConversion = (value & 0x01) > 0; - System.out.println(getName() + ": Set SHTime0: " + shTime0 + " SHTime1: " + shTime1 + " ENC:" + + if (DEBUG ) System.out.println(getName() + ": Set SHTime0: " + shTime0 + " SHTime1: " + shTime1 + " ENC:" + enableConversion + " Start: " + startConversion + " ADC12ON: " + adc12On); break; } @@ -118,6 +120,10 @@ // read a value from the IO unit public int read(int address, boolean word, long cycles) { + switch(address) { + case ADC12CTL0: + return adc12ctl0; + } return 0; } Modified: mspsim/se/sics/mspsim/core/BasicClockModule.java =================================================================== --- mspsim/se/sics/mspsim/core/BasicClockModule.java 2008-03-14 16:41:14 UTC (rev 183) +++ mspsim/se/sics/mspsim/core/BasicClockModule.java 2008-03-14 22:40:35 UTC (rev 184) @@ -44,6 +44,8 @@ public class BasicClockModule extends IOUnit { + public static final boolean DEBUG = false; + public static final int DCOCTL = 0x56; public static final int BCSCTL1 = 0x57; public static final int BCSCTL2 = 0x58; @@ -109,7 +111,7 @@ public void write(int address, int data, boolean word, long cycles) { // Currently ignores the word flag... - System.out.println("Write to BasicClockModule: " + + if (DEBUG) System.out.println("Write to BasicClockModule: " + Utils.hex16(address) + " => " + Utils.hex16(data)); memory[address] = data & 0xff; @@ -120,7 +122,7 @@ case DCOCTL: dcoFrequency = (data >> 5) & 0x7; dcoModulator = data & 0x1f; - System.out.println("Write: BCM DCOCTL0: DCO Frq:" + dcoFrequency + + if (DEBUG) System.out.println("Write: BCM DCOCTL0: DCO Frq:" + dcoFrequency + " dcoMod:" + dcoModulator); break; case BCSCTL1: @@ -128,7 +130,7 @@ divAclk = 1 << ((data >> 4) & 3); lfxt1Mode = (data >> 6) & 1; xt2Off = (data >> 7) & 1; - System.out.println("Write: BCM BCSCTL1: RSel:" + resistorSel + + if (DEBUG) System.out.println("Write: BCM BCSCTL1: RSel:" + resistorSel + " DivACLK:" + divAclk + " ACLKFrq: " + ACLK_FRQ / divAclk); core.setACLKFrq(ACLK_FRQ / divAclk); @@ -139,7 +141,7 @@ smclSel = (data >> 3) & 1; divSMclk = 1 << ((data >> 2) & 3); dcoResitorSel = data & 1; - System.out.println("Write: BCM BCSCTL2: SMCLKDIV: " + + if (DEBUG) System.out.println("Write: BCM BCSCTL2: SMCLKDIV: " + divSMclk + " SMCLK_SEL: " + smclSel + " MCLKSel: " + mclkSel + " divMclk: " + divMclk + " DCOResitorSel: " + dcoResitorSel); @@ -152,7 +154,7 @@ (resistorSel << 8)) * DCO_FACTOR; if (newcalcDCOFrq != calcDCOFrq) { calcDCOFrq = newcalcDCOFrq; - System.out.println("BCM DCO_Speed: " + calcDCOFrq); + if (DEBUG) System.out.println("BCM DCO_Speed: " + calcDCOFrq); core.setDCOFrq(calcDCOFrq, calcDCOFrq / divSMclk); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fro...@us...> - 2008-03-14 16:41:21
|
Revision: 183 http://mspsim.svn.sourceforge.net/mspsim/?rev=183&view=rev Author: fros4943 Date: 2008-03-14 09:41:14 -0700 (Fri, 14 Mar 2008) Log Message: ----------- added output power support Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-03-14 16:12:26 UTC (rev 182) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-03-14 16:41:14 UTC (rev 183) @@ -195,6 +195,7 @@ public CC2420(MSP430Core cpu) { registers[REG_SNOP] = 0; + registers[REG_TXCTRL] = 0xa0ff; this.cpu = cpu; } @@ -312,7 +313,7 @@ switch (data) { case REG_SRXON: - setActiveFrequency(registers[REG_FSCTRL]); + updateActiveFrequency(); if (DEBUG) { System.out.println("CC2420: Strobe RX-ON!!!"); @@ -326,7 +327,7 @@ setMode(MODE_TXRX_OFF); break; case REG_STXON: - setActiveFrequency(registers[REG_FSCTRL]); + updateActiveFrequency(); if (DEBUG) { System.out.println("CC2420: Strobe TXON!"); @@ -335,7 +336,7 @@ transmitPacket(); break; case REG_STXONCCA: - setActiveFrequency(registers[REG_FSCTRL]); + updateActiveFrequency(); if (DEBUG) { System.out.println("CC2420: Strobe TXONCCA!"); @@ -357,10 +358,10 @@ } } - public void setActiveFrequency(int val) { + public void updateActiveFrequency() { /* INVERTED: f = 5 * (c - 11) + 357 + 0x4000 */ - activeFrequency = val - 357 + 2405 - 0x4000; - activeChannel = (val - 0x4000 - 357)/5 + 11; + activeFrequency = registers[REG_FSCTRL] - 357 + 2405 - 0x4000; + activeChannel = (registers[REG_FSCTRL] - 357 - 0x4000)/5 + 11; } public int getActiveFrequency() { @@ -371,7 +372,35 @@ return activeChannel; } + public int getOutputPowerIndicator() { + return (registers[REG_TXCTRL] & 0x1f); + } + public int getOutputPower() { + /* From CC2420 datasheet */ + int indicator = getOutputPowerIndicator(); + if (indicator >= 31) { + return 0; + } else if (indicator >= 27) { + return -1; + } else if (indicator >= 23) { + return -3; + } else if (indicator >= 19) { + return -5; + } else if (indicator >= 15) { + return -7; + } else if (indicator >= 11) { + return -10; + } else if (indicator >= 7) { + return -15; + } else if (indicator >= 3) { + return -25; + } + + /* Unknown */ + return -100; + } + private void transmitPacket() { int len = memory[RAM_TXFIFO]; int kBps = 250000 / 8; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fro...@us...> - 2008-03-14 16:13:29
|
Revision: 182 http://mspsim.svn.sourceforge.net/mspsim/?rev=182&view=rev Author: fros4943 Date: 2008-03-14 09:12:26 -0700 (Fri, 14 Mar 2008) Log Message: ----------- added channel support + bug fix when writing to 16-bit registry (pos was not increased) Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-03-14 14:47:46 UTC (rev 181) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-03-14 16:12:26 UTC (rev 182) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id:$ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,7 +35,7 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * + * */ package se.sics.mspsim.chip; @@ -123,7 +123,7 @@ public static final int MODE_RX_ON = 0x01; public static final int MODE_TXRX_ON = 0x02; public static final int MODE_MAX = MODE_TXRX_ON; - + // when reading registers this flag is set! public static final int FLAG_READ = 0x40; @@ -146,10 +146,13 @@ private int address; private boolean ramRead = false; + private int activeFrequency = 0; + private int activeChannel = 0; + private int status = STATUS_XOSC16M_STABLE | STATUS_RSSI_VALID; private int mode = MODE_TXRX_OFF; - + private int[] registers = new int[64]; // More than needed... private int[] memory = new int[512]; @@ -173,10 +176,12 @@ private PacketListener packetListener; private MSP430Core cpu; - + private TimeEvent transmissionEvent = new TimeEvent(0) { public void execute(long t) { - if (DEBUG) System.out.println(getName() + ": **** Transmitting package to listener (if any)"); + if (DEBUG) { + System.out.println(getName() + ": **** Transmitting package to listener (if any)"); + } if (packetListener != null) { int len = memory[RAM_TXFIFO]; int[] data = new int[len]; @@ -187,7 +192,7 @@ }; private boolean on; - + public CC2420(MSP430Core cpu) { registers[REG_SNOP] = 0; this.cpu = cpu; @@ -195,10 +200,11 @@ public void dataReceived(USART source, int data) { if (on && chipSelect) { - if (DEBUG) + if (DEBUG) { System.out.println("CC2420 byte received: " + Utils.hex8(data) + '\'' + (char) data + '\'' + " CS: " + chipSelect + " state: " + state); + } switch(state) { case WAITING: state = WRITE_REGISTER; @@ -216,8 +222,8 @@ // check read/write??? // System.out.println("CC2420: Reading RXFIFO!!!"); state = READ_RXFIFO; - } else if (address == REG_TXFIFO) { - state = WRITE_TXFIFO; + } else if (address == REG_TXFIFO) { + state = WRITE_TXFIFO; } } if (data < 0x0f) { @@ -236,27 +242,33 @@ source.byteReceived(registers[address] & 0xff); // set the low bits registers[address] = registers[address] & 0xff00 | data; - if (DEBUG) - System.out.println("CC2420: wrote to " + Utils.hex8(address) + " = " + if (DEBUG) { + System.out.println("CC2420: wrote to " + Utils.hex8(address) + " = " + registers[address]); + } } - break; + pos++; + break; case READ_REGISTER: if (pos == 0) { source.byteReceived(registers[address] >> 8); } else { source.byteReceived(registers[address] & 0xff); - if (DEBUG) - System.out.println("CC2420: read from " + Utils.hex8(address) + " = " + if (DEBUG) { + System.out.println("CC2420: read from " + Utils.hex8(address) + " = " + registers[address]); + } } - break; + pos++; + break; case READ_RXFIFO: // System.out.println("CC2420: RXFIFO READ => " + // memory[RAM_RXFIFO + rxCursor]); source.byteReceived(memory[RAM_RXFIFO + rxCursor++]); // What if wrap cursor??? - if (rxCursor >= 128) rxCursor = 0; + if (rxCursor >= 128) { + rxCursor = 0; + } // When is this set to "false" - when is interrupt de-triggered? if (rxPacket) { rxPacket = false; @@ -270,9 +282,10 @@ if (pos == 0) { address = address | (data << 1) & 0x180; ramRead = (data & 0x20) != 0; - if (DEBUG) - System.out.println("CC2420: Address: " + Utils.hex16(address) + + if (DEBUG) { + System.out.println("CC2420: Address: " + Utils.hex16(address) + " read: " + ramRead); + } pos++; } else { if (!ramRead) { @@ -293,48 +306,85 @@ // next data... private void strobe(int data) { // Resets, on/off of different things... - if (DEBUG) + if (DEBUG) { System.out.println("CC2420: Strobe on: " + Utils.hex8(data)); + } switch (data) { case REG_SRXON: - if (DEBUG) System.out.println("CC2420: Strobe RX-ON!!!"); + setActiveFrequency(registers[REG_FSCTRL]); + + if (DEBUG) { + System.out.println("CC2420: Strobe RX-ON!!!"); + } setMode(MODE_RX_ON); break; case REG_SRFOFF: - if (DEBUG) System.out.println("CC2420: Strobe RXTX-OFF!!!"); + if (DEBUG) { + System.out.println("CC2420: Strobe RXTX-OFF!!!"); + } setMode(MODE_TXRX_OFF); break; case REG_STXON: - if (DEBUG) System.out.println("CC2420: Strobe TXON!"); + setActiveFrequency(registers[REG_FSCTRL]); + + if (DEBUG) { + System.out.println("CC2420: Strobe TXON!"); + } setMode(MODE_TXRX_ON); transmitPacket(); break; case REG_STXONCCA: - if (DEBUG) System.out.println("CC2420: Strobe TXONCCA!"); + setActiveFrequency(registers[REG_FSCTRL]); + + if (DEBUG) { + System.out.println("CC2420: Strobe TXONCCA!"); + } setMode(MODE_TXRX_ON); transmitPacket(); - break; + break; case REG_SFLUSHRX: flushRX(); break; case REG_SFLUSHTX: flushTX(); break; + default: + if (DEBUG) { + System.out.println("Unknown strobe command: " + data); + } + } } + public void setActiveFrequency(int val) { + /* INVERTED: f = 5 * (c - 11) + 357 + 0x4000 */ + activeFrequency = val - 357 + 2405 - 0x4000; + activeChannel = (val - 0x4000 - 357)/5 + 11; + } + + public int getActiveFrequency() { + return activeFrequency; + } + + public int getActiveChannel() { + return activeChannel; + } + + private void transmitPacket() { int len = memory[RAM_TXFIFO]; int kBps = 250000 / 8; double time = 1.0 * len / kBps; - if (DEBUG) System.out.println(getName() + " Transmitting " + len + " bytes => " + time + " sec"); + if (DEBUG) { + System.out.println(getName() + " Transmitting " + len + " bytes => " + time + " sec"); + } if (packetListener != null) { packetListener.transmissionStarted(); cpu.scheduleTimeEventMillis(transmissionEvent, 1000 * time); } } - + private void setMode(int mode) { this.mode = mode; modeChanged(mode); @@ -347,13 +397,15 @@ public void setVRegOn(boolean on) { this.on = on; } - + public void setChipSelect(boolean select) { chipSelect = select; - if (!chipSelect) + if (!chipSelect) { state = WAITING; - if (DEBUG) + } + if (DEBUG) { System.out.println("CC2420: setting chipSelect: " + chipSelect); + } } public void setCCAPort(IOPort port, int pin) { @@ -387,23 +439,24 @@ public void setIncomingPacket(int[] packet) { int adr = RAM_RXFIFO; memory[adr++] = packet.length + 2; - for (int i = 0, n = packet.length; i < n; i++) { - memory[adr++] = packet[i] & 0xff; + for (int element : packet) { + memory[adr++] = element & 0xff; } // Should take a RSSI value as input or use a set-RSSI value... memory[adr++] = (202) & 0xff; - // Set CRC ok and add a correlation + // Set CRC ok and add a correlation memory[adr++] = (37) | 0x80; rxPacket = true; - rxCursor = 0; + rxCursor = 0; rxLen = adr; updateFifopPin(); } private void flushRX() { - if (DEBUG) + if (DEBUG) { System.out.println("Flushing RX! was: " + rxPacket + " len = " + rxLen); + } rxPacket = false; rxCursor = 0; rxLen = 0; @@ -415,7 +468,7 @@ txCursor = 0; } - + private void updateFifopPin() { fifopPort.setPinState(fifopPin, rxPacket ? 1 : 0); } @@ -423,7 +476,7 @@ public void setCCA(boolean cca) { ccaPort.setPinState(ccaPin, cca ? 1 : 0); } - + public String getName() { return "CC2420"; } @@ -432,5 +485,5 @@ return MODE_MAX; } - + } // CC2420 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fro...@us...> - 2008-03-14 15:58:29
|
Revision: 181 http://mspsim.svn.sourceforge.net/mspsim/?rev=181&view=rev Author: fros4943 Date: 2008-03-14 07:47:46 -0700 (Fri, 14 Mar 2008) Log Message: ----------- added interrupt enable state Modified Paths: -------------- mspsim/se/sics/mspsim/core/IOPort.java Modified: mspsim/se/sics/mspsim/core/IOPort.java =================================================================== --- mspsim/se/sics/mspsim/core/IOPort.java 2008-03-14 14:04:13 UTC (rev 180) +++ mspsim/se/sics/mspsim/core/IOPort.java 2008-03-14 14:47:46 UTC (rev 181) @@ -57,6 +57,7 @@ private String name; private int interrupt; private int interruptFlag; + private int interruptEnable; private MSP430Core cpu; // External pin state! @@ -83,6 +84,7 @@ super(memory, offset); name = portName; this.interrupt = interrupt; + this.interruptEnable = 0; this.cpu = cpu; } @@ -104,7 +106,9 @@ public void write(int address, int data, boolean word, long cycles) { memory[address] = data & 0xff; - if (word) memory[address + 1] = (data >> 8) & 0xff; + if (word) { + memory[address + 1] = (data >> 8) & 0xff; + } // This does not handle word writes yet... int iAddress = address - offset; @@ -141,7 +145,7 @@ } interruptFlag &= data; memory[offset + IFG] = interruptFlag; - cpu.flagInterrupt(interrupt, this, interruptFlag > 0); + cpu.flagInterrupt(interrupt, this, (interruptFlag & interruptEnable) > 0); } else { // Samel as ISEL!!! } @@ -149,6 +153,7 @@ case IES: break; case IE: + interruptEnable = data; break; case ISEL: } @@ -191,7 +196,7 @@ memory[offset + IFG] = interruptFlag; // Maybe this is not the only place where we should flag int? - cpu.flagInterrupt(interrupt, this, interruptFlag > 0); + cpu.flagInterrupt(interrupt, this, (interruptFlag & interruptEnable) > 0); } @@ -200,6 +205,7 @@ pinState[i] = PIN_LOW; } interruptFlag = 0; - cpu.flagInterrupt(interrupt, this, interruptFlag > 0); + interruptEnable = 0; + cpu.flagInterrupt(interrupt, this, (interruptFlag & interruptEnable) > 0); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fro...@us...> - 2008-03-14 14:04:16
|
Revision: 180 http://mspsim.svn.sourceforge.net/mspsim/?rev=180&view=rev Author: fros4943 Date: 2008-03-14 07:04:13 -0700 (Fri, 14 Mar 2008) Log Message: ----------- split up port setup from rest of node setup Modified Paths: -------------- mspsim/se/sics/mspsim/platform/esb/ESBNode.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java Modified: mspsim/se/sics/mspsim/platform/esb/ESBNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-03-11 23:54:12 UTC (rev 179) +++ mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-03-14 14:04:13 UTC (rev 180) @@ -139,7 +139,7 @@ } } - public void setupNode() { + public void setupNodePorts() { IOUnit unit = cpu.getIOUnit("Port 2"); if (unit instanceof IOPort) { port2 = (IOPort) unit; @@ -162,9 +162,13 @@ radio = new TR1001((USART)usart0); ((USART) usart0).setUSARTListener(radio); } + } + public void setupNode() { + setupNodePorts(); + gui = new ESBGui(this); - + stats.addMonitor(this); stats.addMonitor(radio); stats.addMonitor(cpu); @@ -174,7 +178,7 @@ DataSourceSampler dss = dataChart.setupChipFrame(cpu); dataChart.addDataSource(dss, "Listen", stats.getDataSource("TR1001", TR1001.MODE_RX_ON)); dataChart.addDataSource(dss, "Transmit", stats.getDataSource("TR1001", TR1001.MODE_TXRX_ON)); - dataChart.addDataSource(dss, "CPU", stats.getDataSource("MSP430 Core", MSP430.MODE_ACTIVE)); + dataChart.addDataSource(dss, "CPU", stats.getDataSource("MSP430 Core", MSP430.MODE_ACTIVE)); } public int getModeMax() { @@ -184,7 +188,7 @@ public String getName() { return "ESB Node"; } - + public static void main(String[] args) throws IOException { ESBNode node = new ESBNode(); node.setup(args); Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-03-11 23:54:12 UTC (rev 179) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-03-14 14:04:13 UTC (rev 180) @@ -78,21 +78,21 @@ public static final int CC2420_FIFOP = 0; public static final int CC2420_FIFO = 3; public static final int CC2420_CCA = 4; - + /* P4.5 - Output: VREG_EN to CC2420 */ /* P4.2 - Output: SPI Chip Select (CS_N) */ public static final int CC2420_VREG = (1 << 5); public static final int CC2420_CHIP_SELECT = 0x04; - + private IOPort port1; private IOPort port2; private IOPort port4; private IOPort port5; - private CC2420 radio; + public CC2420 radio; private M25P80 flash; private String flashFile; - + public static final int BLUE_LED = 0x40; public static final int GREEN_LED = 0x20; public static final int RED_LED = 0x10; @@ -101,7 +101,7 @@ public boolean blueLed; public boolean greenLed; private int mode = MODE_LEDS_OFF; - + public SkyGui gui; /** * Creates a new <code>SkyNode</code> instance. @@ -117,7 +117,7 @@ public boolean getDebug() { return cpu.getDebug(); } - + public ELF getElfInfo() { return elf; } @@ -172,18 +172,7 @@ return "Tmote Sky"; } - public void setupNode() { - // create a filename for the flash file - // This should be possible to take from a config file later! - String fileName = firmwareFile; - int ix = fileName.lastIndexOf('.'); - if (ix > 0) { - fileName = fileName.substring(0, ix); - } - fileName = fileName + ".flash"; - System.out.println("Using flash file: " + fileName); - - this.flashFile = flashFile; + public void setupNodePorts() { IOUnit unit = cpu.getIOUnit("Port 5"); if (unit instanceof IOPort) { port5 = (IOPort) unit; @@ -210,10 +199,26 @@ ((USART) usart0).setUSARTListener(this); port4 = (IOPort) cpu.getIOUnit("Port 4"); if (port4 != null && port4 instanceof IOPort) { - ((IOPort) port4).setPortListener(this); + (port4).setPortListener(this); } } + } + public void setupNode() { + // create a filename for the flash file + // This should be possible to take from a config file later! + String fileName = firmwareFile; + int ix = fileName.lastIndexOf('.'); + if (ix > 0) { + fileName = fileName.substring(0, ix); + } + fileName = fileName + ".flash"; + System.out.println("Using flash file: " + fileName); + + this.flashFile = flashFile; + + setupNodePorts(); + stats.addMonitor(this); stats.addMonitor(radio); stats.addMonitor(cpu); @@ -224,7 +229,7 @@ // SkyNode.this.cpu.scheduleTimeEventMillis(this, 1000.0); // } // }, 1000.0); - + // TODO: remove this test... radio.setPacketListener(new PacketListener() { public void transmissionEnded(int[] receivedData) { @@ -232,9 +237,9 @@ } public void transmissionStarted() { System.out.println(getName() + " got indication on transmission from radio " + SkyNode.this.cpu.getTimeMillis()); - } + } }); - + // UART0 TXreg = 0x77? // cpu.setBreakPoint(0x77, new CPUMonitor() { // public void cpuAction(int type, int adr, int data) { @@ -260,5 +265,5 @@ node.setup(args); node.start(); } - + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-11 23:54:25
|
Revision: 179 http://mspsim.svn.sourceforge.net/mspsim/?rev=179&view=rev Author: joxe Date: 2008-03-11 16:54:12 -0700 (Tue, 11 Mar 2008) Log Message: ----------- minor refactoring - IOUnit is no longer a Chip - removed dead code. Modified Paths: -------------- mspsim/CHANGE_LOG.txt mspsim/se/sics/mspsim/chip/Beeper.java mspsim/se/sics/mspsim/core/ADC12.java mspsim/se/sics/mspsim/core/BasicClockModule.java mspsim/se/sics/mspsim/core/IOPort.java mspsim/se/sics/mspsim/core/IOUnit.java mspsim/se/sics/mspsim/core/Multiplier.java mspsim/se/sics/mspsim/core/SFR.java mspsim/se/sics/mspsim/core/USART.java Modified: mspsim/CHANGE_LOG.txt =================================================================== --- mspsim/CHANGE_LOG.txt 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/CHANGE_LOG.txt 2008-03-11 23:54:12 UTC (rev 179) @@ -1,7 +1,9 @@ 0.85 Changes: - fixed multiplier to handle the different modes better. -- +- refactored so that IOUnit is no longer a Chip +- added statistics commands to the CLI +- implemented better support for statistics (operating mode) 0.84 Changes: Modified: mspsim/se/sics/mspsim/chip/Beeper.java =================================================================== --- mspsim/se/sics/mspsim/chip/Beeper.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/chip/Beeper.java 2008-03-11 23:54:12 UTC (rev 179) @@ -145,8 +145,4 @@ } } } - - public int getModeMax() { - return 0; - } } Modified: mspsim/se/sics/mspsim/core/ADC12.java =================================================================== --- mspsim/se/sics/mspsim/core/ADC12.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/core/ADC12.java 2008-03-11 23:54:12 UTC (rev 179) @@ -122,7 +122,7 @@ } public String getName() { - return "AD12"; + return "ADC12"; } public void interruptServiced(int vector) { @@ -131,8 +131,4 @@ public long ioTick(long cycles) { return cycles + 1000000; } - - public int getModeMax() { - return 0; - } } Modified: mspsim/se/sics/mspsim/core/BasicClockModule.java =================================================================== --- mspsim/se/sics/mspsim/core/BasicClockModule.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/core/BasicClockModule.java 2008-03-11 23:54:12 UTC (rev 179) @@ -163,8 +163,4 @@ public void interruptServiced(int vector) { } - - public int getModeMax() { - return 0; - } } Modified: mspsim/se/sics/mspsim/core/IOPort.java =================================================================== --- mspsim/se/sics/mspsim/core/IOPort.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/core/IOPort.java 2008-03-11 23:54:12 UTC (rev 179) @@ -202,10 +202,4 @@ interruptFlag = 0; cpu.flagInterrupt(interrupt, this, interruptFlag > 0); } - - // TODO: Should override this - public int getModeMax() { - return 0; - } - } Modified: mspsim/se/sics/mspsim/core/IOUnit.java =================================================================== --- mspsim/se/sics/mspsim/core/IOUnit.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/core/IOUnit.java 2008-03-11 23:54:12 UTC (rev 179) @@ -41,11 +41,8 @@ package se.sics.mspsim.core; -import java.util.ArrayList; -import java.util.Iterator; +public abstract class IOUnit { -public abstract class IOUnit extends Chip { - int[] memory; int offset; @@ -98,4 +95,6 @@ // Second byte => hi byte return (data >> 8) & 0xff; } + + public abstract String getName(); } Modified: mspsim/se/sics/mspsim/core/Multiplier.java =================================================================== --- mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-11 23:54:12 UTC (rev 179) @@ -65,15 +65,12 @@ private int macs; private int sumext; - private int lastWriteOP; - private int currentSum; private int op1; - private boolean signed = false; - MSP430Core core; - private boolean accumulating; + private boolean signed = false; + private boolean accumulating = false; /** * Creates a new <code>Multiplier</code> instance. * @@ -127,28 +124,24 @@ case MPY: op1 = mpy = data; if (DEBUG) System.out.println(getName() + " Write to MPY: " + data); - lastWriteOP = address; signed = false; accumulating = false; break; case MPYS: op1 = mpys = data; if (DEBUG) System.out.println(getName() + " Write to MPYS: " + data); - lastWriteOP = address; signed = true; accumulating = false; break; case MAC: op1 = mac = data; if (DEBUG) System.out.println(getName() + " Write to MAC: " + data); - lastWriteOP = address; signed = false; accumulating = true; break; case MACS: op1 = macs = data; if (DEBUG) System.out.println(getName() + " Write to MACS: " + data); - lastWriteOP = address; signed = true; accumulating = true; break; @@ -199,10 +192,4 @@ public void interruptServiced(int vector) { } - - public int getModeMax() { - return 0; - } - - } Modified: mspsim/se/sics/mspsim/core/SFR.java =================================================================== --- mspsim/se/sics/mspsim/core/SFR.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/core/SFR.java 2008-03-11 23:54:12 UTC (rev 179) @@ -155,8 +155,4 @@ public String getName() { return "SpecialFunctionRegister, SFR"; } - - public int getModeMax() { - return 0; - } } // SFR Modified: mspsim/se/sics/mspsim/core/USART.java =================================================================== --- mspsim/se/sics/mspsim/core/USART.java 2008-03-11 23:41:17 UTC (rev 178) +++ mspsim/se/sics/mspsim/core/USART.java 2008-03-11 23:54:12 UTC (rev 179) @@ -346,9 +346,4 @@ cpu.flagInterrupt(receiveInterrupt, this, true); } } - - public int getModeMax() { - return 0; - } - } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-11 23:41:38
|
Revision: 178 http://mspsim.svn.sourceforge.net/mspsim/?rev=178&view=rev Author: joxe Date: 2008-03-11 16:41:17 -0700 (Tue, 11 Mar 2008) Log Message: ----------- fixed debug printouts in multiplier and cleaner reimplementation of multiplication. Modified Paths: -------------- mspsim/se/sics/mspsim/core/Multiplier.java Modified: mspsim/se/sics/mspsim/core/Multiplier.java =================================================================== --- mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-11 15:32:12 UTC (rev 177) +++ mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-11 23:41:17 UTC (rev 178) @@ -67,8 +67,13 @@ private int lastWriteOP; private int currentSum; + private int op1; + private boolean signed = false; + MSP430Core core; + + private boolean accumulating; /** * Creates a new <code>Multiplier</code> instance. * @@ -118,27 +123,34 @@ Integer.toString(address, 16) + " = " + data); } - switch(address) { case MPY: - mpy = data; + op1 = mpy = data; if (DEBUG) System.out.println(getName() + " Write to MPY: " + data); lastWriteOP = address; + signed = false; + accumulating = false; break; case MPYS: - mpys = data; + op1 = mpys = data; if (DEBUG) System.out.println(getName() + " Write to MPYS: " + data); lastWriteOP = address; + signed = true; + accumulating = false; break; case MAC: - mac = data; + op1 = mac = data; if (DEBUG) System.out.println(getName() + " Write to MAC: " + data); lastWriteOP = address; + signed = false; + accumulating = true; break; case MACS: - macs = data; + op1 = macs = data; if (DEBUG) System.out.println(getName() + " Write to MACS: " + data); lastWriteOP = address; + signed = true; + accumulating = true; break; case RESLO: resLo = data; @@ -150,38 +162,33 @@ if (DEBUG) System.out.println(getName() + " Write to OP2: " + data); sumext = 0; op2 = data; - // This should be picked based on which op was written previously!!! - int o1 = mpy; - boolean signMode = false; - boolean sum = false; - if (lastWriteOP == MPYS) { - o1 = mpys; - signMode = true; - } else if (lastWriteOP == MAC) { - o1 = mac; - sum = true; - } else if (lastWriteOP == MACS) { - o1 = macs; - signMode = true; - sum = true; + // Expand to word + if (signed) { + if (!word) { + if (op1 > 0x80) op1 = op1 | 0xff00; + if (op2 > 0x80) op2 = op2 | 0xff00; + } + op1 = op1 > 0x8000 ? op1 - 0x10000 : op1; + op2 = op2 > 0x8000 ? op2 - 0x10000 : op2; } - if (signMode) { - // Assume two 16 bit mults. - if (((o1 ^ op2) & 0x8000) > 0) { - sumext = 0xffff; + long res = op1 * op2; + if (DEBUG) System.out.println("O1:" + op1 + " * " + op2 + " = " + res); + + if (signed) { + sumext = res < 0 ? 0xffff : 0; + } + + if (accumulating) { + res += (resHi << 16) + resLo; + if (!signed && res > 0xffffffff) { + sumext = 1; } } - long res = o1 * op2; - System.out.println("O1:" + o1 + " * " + op2 + " = " + res); - if (sum) { - currentSum = (resHi << 16) + resLo; - currentSum += res; - res = currentSum; - } + resHi = (int) ((res >> 16) & 0xffff); resLo = (int) (res & 0xffff); - if(DEBUG) System.out.println(" ===> result = " + res); + if (DEBUG) System.out.println(" ===> result = " + res); break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-11 15:33:22
|
Revision: 177 http://mspsim.svn.sourceforge.net/mspsim/?rev=177&view=rev Author: nifi Date: 2008-03-11 08:32:12 -0700 (Tue, 11 Mar 2008) Log Message: ----------- enabled svn keywords Rev, Date, Id Modified Paths: -------------- mspsim/se/sics/mspsim/chip/Beeper.java mspsim/se/sics/mspsim/chip/M25P80.java mspsim/se/sics/mspsim/cli/AsyncCommand.java mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java mspsim/se/sics/mspsim/cli/BasicCommand.java mspsim/se/sics/mspsim/cli/BasicLineCommand.java mspsim/se/sics/mspsim/cli/CommandBundle.java mspsim/se/sics/mspsim/cli/CommandParser.java mspsim/se/sics/mspsim/cli/DebugCommands.java mspsim/se/sics/mspsim/cli/LineListener.java mspsim/se/sics/mspsim/cli/LineOutputStream.java mspsim/se/sics/mspsim/cli/MiscCommands.java mspsim/se/sics/mspsim/core/ADC12.java mspsim/se/sics/mspsim/core/BasicClockModule.java mspsim/se/sics/mspsim/core/CPUMonitor.java mspsim/se/sics/mspsim/core/Chip.java mspsim/se/sics/mspsim/core/DbgInstruction.java mspsim/se/sics/mspsim/core/DisAsm.java mspsim/se/sics/mspsim/core/EventQueue.java mspsim/se/sics/mspsim/core/IOPort.java mspsim/se/sics/mspsim/core/IOUnit.java mspsim/se/sics/mspsim/core/MSP430.java mspsim/se/sics/mspsim/core/MSP430Constants.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/core/Multiplier.java mspsim/se/sics/mspsim/core/OperatingModeListener.java mspsim/se/sics/mspsim/core/PortListener.java mspsim/se/sics/mspsim/core/Profiler.java mspsim/se/sics/mspsim/core/SFR.java mspsim/se/sics/mspsim/core/TimeEvent.java mspsim/se/sics/mspsim/core/Timer.java mspsim/se/sics/mspsim/core/USART.java mspsim/se/sics/mspsim/core/USARTListener.java mspsim/se/sics/mspsim/extutil/highlight/HighlightSourceViewer.java mspsim/se/sics/mspsim/platform/GenericNode.java mspsim/se/sics/mspsim/platform/esb/ESBGui.java mspsim/se/sics/mspsim/platform/esb/ESBNode.java mspsim/se/sics/mspsim/platform/sky/SkyGui.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java mspsim/se/sics/mspsim/ui/AbstractChart.java mspsim/se/sics/mspsim/ui/BarChart.java mspsim/se/sics/mspsim/ui/Chart.java mspsim/se/sics/mspsim/ui/ChartPanel.java mspsim/se/sics/mspsim/ui/ConstantLineChart.java mspsim/se/sics/mspsim/ui/ControlUI.java mspsim/se/sics/mspsim/ui/DebugUI.java mspsim/se/sics/mspsim/ui/DoubleBarChart.java mspsim/se/sics/mspsim/ui/DoubleSerieChart.java mspsim/se/sics/mspsim/ui/IntSerieChart.java mspsim/se/sics/mspsim/ui/LineChart.java mspsim/se/sics/mspsim/ui/SerialMon.java mspsim/se/sics/mspsim/ui/SourceViewer.java mspsim/se/sics/mspsim/ui/StackUI.java mspsim/se/sics/mspsim/ui/WindowUtils.java mspsim/se/sics/mspsim/util/DataSource.java mspsim/se/sics/mspsim/util/DebugInfo.java mspsim/se/sics/mspsim/util/DotDiagram.java mspsim/se/sics/mspsim/util/ELF.java mspsim/se/sics/mspsim/util/ELFDebug.java mspsim/se/sics/mspsim/util/ELFProgram.java mspsim/se/sics/mspsim/util/ELFSection.java mspsim/se/sics/mspsim/util/IHexReader.java mspsim/se/sics/mspsim/util/MapEntry.java mspsim/se/sics/mspsim/util/MapTable.java mspsim/se/sics/mspsim/util/OperatingModeStatistics.java mspsim/se/sics/mspsim/util/PluginBundle.java mspsim/se/sics/mspsim/util/PluginRepository.java mspsim/se/sics/mspsim/util/SimpleProfiler.java mspsim/se/sics/mspsim/util/Test.java mspsim/se/sics/mspsim/util/Utils.java Property Changed: ---------------- mspsim/se/sics/mspsim/chip/Beeper.java mspsim/se/sics/mspsim/chip/CC2420.java mspsim/se/sics/mspsim/chip/M25P80.java mspsim/se/sics/mspsim/chip/PacketListener.java mspsim/se/sics/mspsim/cli/AsyncCommand.java mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java mspsim/se/sics/mspsim/cli/BasicCommand.java mspsim/se/sics/mspsim/cli/BasicLineCommand.java mspsim/se/sics/mspsim/cli/Command.java mspsim/se/sics/mspsim/cli/CommandBundle.java mspsim/se/sics/mspsim/cli/CommandContext.java mspsim/se/sics/mspsim/cli/CommandHandler.java mspsim/se/sics/mspsim/cli/CommandParser.java mspsim/se/sics/mspsim/cli/DebugCommands.java mspsim/se/sics/mspsim/cli/ExecCommand.java mspsim/se/sics/mspsim/cli/LineListener.java mspsim/se/sics/mspsim/cli/LineOutputStream.java mspsim/se/sics/mspsim/cli/MiscCommands.java mspsim/se/sics/mspsim/core/ADC12.java mspsim/se/sics/mspsim/core/BasicClockModule.java mspsim/se/sics/mspsim/core/CPUMonitor.java mspsim/se/sics/mspsim/core/Chip.java mspsim/se/sics/mspsim/core/DbgInstruction.java mspsim/se/sics/mspsim/core/DisAsm.java mspsim/se/sics/mspsim/core/EventQueue.java mspsim/se/sics/mspsim/core/IOPort.java mspsim/se/sics/mspsim/core/IOUnit.java mspsim/se/sics/mspsim/core/MSP430.java mspsim/se/sics/mspsim/core/MSP430Constants.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/core/Multiplier.java mspsim/se/sics/mspsim/core/OperatingModeListener.java mspsim/se/sics/mspsim/core/PortListener.java mspsim/se/sics/mspsim/core/Profiler.java mspsim/se/sics/mspsim/core/SFR.java mspsim/se/sics/mspsim/core/TimeEvent.java mspsim/se/sics/mspsim/core/Timer.java mspsim/se/sics/mspsim/core/USART.java mspsim/se/sics/mspsim/core/USARTListener.java mspsim/se/sics/mspsim/extutil/highlight/CScanner.java mspsim/se/sics/mspsim/extutil/highlight/HighlightSourceViewer.java mspsim/se/sics/mspsim/extutil/highlight/JavaScanner.java mspsim/se/sics/mspsim/extutil/highlight/LineNumberedBorder.java mspsim/se/sics/mspsim/extutil/highlight/Scan.java mspsim/se/sics/mspsim/extutil/highlight/Scanner.java mspsim/se/sics/mspsim/extutil/highlight/Symbol.java mspsim/se/sics/mspsim/extutil/highlight/SyntaxHighlighter.java mspsim/se/sics/mspsim/extutil/highlight/TextScanner.java mspsim/se/sics/mspsim/extutil/highlight/Token.java mspsim/se/sics/mspsim/extutil/highlight/TokenTypes.java mspsim/se/sics/mspsim/extutil/jfreechart/DataChart.java mspsim/se/sics/mspsim/extutil/jfreechart/DataSourceSampler.java mspsim/se/sics/mspsim/platform/GenericNode.java mspsim/se/sics/mspsim/platform/esb/ESBGui.java mspsim/se/sics/mspsim/platform/esb/ESBNode.java mspsim/se/sics/mspsim/platform/sky/SkyGui.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java mspsim/se/sics/mspsim/ui/AbstractChart.java mspsim/se/sics/mspsim/ui/BarChart.java mspsim/se/sics/mspsim/ui/Chart.java mspsim/se/sics/mspsim/ui/ChartPanel.java mspsim/se/sics/mspsim/ui/ConstantLineChart.java mspsim/se/sics/mspsim/ui/ControlUI.java mspsim/se/sics/mspsim/ui/DebugUI.java mspsim/se/sics/mspsim/ui/DoubleBarChart.java mspsim/se/sics/mspsim/ui/DoubleSerieChart.java mspsim/se/sics/mspsim/ui/IntSerieChart.java mspsim/se/sics/mspsim/ui/LineChart.java mspsim/se/sics/mspsim/ui/SerialMon.java mspsim/se/sics/mspsim/ui/SourceViewer.java mspsim/se/sics/mspsim/ui/StackUI.java mspsim/se/sics/mspsim/ui/WindowUtils.java mspsim/se/sics/mspsim/util/ActiveComponent.java mspsim/se/sics/mspsim/util/ComponentRegistry.java mspsim/se/sics/mspsim/util/DataSource.java mspsim/se/sics/mspsim/util/DebugInfo.java mspsim/se/sics/mspsim/util/DotDiagram.java mspsim/se/sics/mspsim/util/ELF.java mspsim/se/sics/mspsim/util/ELFDebug.java mspsim/se/sics/mspsim/util/ELFProgram.java mspsim/se/sics/mspsim/util/ELFSection.java mspsim/se/sics/mspsim/util/IHexReader.java mspsim/se/sics/mspsim/util/MapEntry.java mspsim/se/sics/mspsim/util/MapTable.java mspsim/se/sics/mspsim/util/OperatingModeStatistics.java mspsim/se/sics/mspsim/util/PluginBundle.java mspsim/se/sics/mspsim/util/PluginRepository.java mspsim/se/sics/mspsim/util/SimpleProfiler.java mspsim/se/sics/mspsim/util/StackMonitor.java mspsim/se/sics/mspsim/util/Test.java mspsim/se/sics/mspsim/util/Utils.java Modified: mspsim/se/sics/mspsim/chip/Beeper.java =================================================================== --- mspsim/se/sics/mspsim/chip/Beeper.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/chip/Beeper.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: Beeper.java,v 1.3 2007/10/21 21:17:33 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:33 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.chip; Property changes on: mspsim/se/sics/mspsim/chip/Beeper.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/chip/CC2420.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/chip/M25P80.java =================================================================== --- mspsim/se/sics/mspsim/chip/M25P80.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/chip/M25P80.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: ExtFlash.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.chip; Property changes on: mspsim/se/sics/mspsim/chip/M25P80.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/chip/PacketListener.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/AsyncCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/AsyncCommand.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/AsyncCommand.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/cli/AsyncCommand.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/BasicCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicCommand.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/BasicCommand.java 2008-03-11 15:32:12 UTC (rev 177) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson, Niclas Finne * Created : Mon Feb 11 21:28:00 2008 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; Property changes on: mspsim/se/sics/mspsim/cli/BasicCommand.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/BasicLineCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicLineCommand.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/BasicLineCommand.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/cli/BasicLineCommand.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/cli/Command.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/CommandBundle.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandBundle.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/CommandBundle.java 2008-03-11 15:32:12 UTC (rev 177) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson, Niclas Finne * Created : Mon Feb 11 21:28:00 2008 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; Property changes on: mspsim/se/sics/mspsim/cli/CommandBundle.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/cli/CommandContext.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/cli/CommandHandler.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/CommandParser.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandParser.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/CommandParser.java 2008-03-11 15:32:12 UTC (rev 177) @@ -33,8 +33,8 @@ * * Author : Joakim Eriksson, Niclas Finne * Created : Sun Mar 2 19:41:00 2008 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; import java.util.ArrayList; Property changes on: mspsim/se/sics/mspsim/cli/CommandParser.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-11 15:32:12 UTC (rev 177) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson, Niclas Finne * Created : Mon Feb 11 2008 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; import se.sics.mspsim.core.CPUMonitor; Property changes on: mspsim/se/sics/mspsim/cli/DebugCommands.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/cli/ExecCommand.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/LineListener.java =================================================================== --- mspsim/se/sics/mspsim/cli/LineListener.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/LineListener.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/cli/LineListener.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/LineOutputStream.java =================================================================== --- mspsim/se/sics/mspsim/cli/LineOutputStream.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/LineOutputStream.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/cli/LineOutputStream.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/cli/MiscCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/cli/MiscCommands.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/ADC12.java =================================================================== --- mspsim/se/sics/mspsim/core/ADC12.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/ADC12.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: IOUnit.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/ADC12.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/BasicClockModule.java =================================================================== --- mspsim/se/sics/mspsim/core/BasicClockModule.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/BasicClockModule.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: BasicClockModule.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/BasicClockModule.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/CPUMonitor.java =================================================================== --- mspsim/se/sics/mspsim/core/CPUMonitor.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/CPUMonitor.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: CPUMonitor.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/CPUMonitor.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/Chip.java =================================================================== --- mspsim/se/sics/mspsim/core/Chip.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/Chip.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/core/Chip.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/DbgInstruction.java =================================================================== --- mspsim/se/sics/mspsim/core/DbgInstruction.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/DbgInstruction.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: DbgInstruction.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/DbgInstruction.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/DisAsm.java =================================================================== --- mspsim/se/sics/mspsim/core/DisAsm.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/DisAsm.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: DisAsm.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/DisAsm.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/EventQueue.java =================================================================== --- mspsim/se/sics/mspsim/core/EventQueue.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/EventQueue.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/EventQueue.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/IOPort.java =================================================================== --- mspsim/se/sics/mspsim/core/IOPort.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/IOPort.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: IOPort.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/IOPort.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/IOUnit.java =================================================================== --- mspsim/se/sics/mspsim/core/IOUnit.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/IOUnit.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: IOUnit.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/IOUnit.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/MSP430.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/MSP430.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: MSP430.java,v 1.4 2007/10/21 22:02:22 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 22:02:22 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/MSP430.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/MSP430Constants.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: MSP430Constants.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/MSP430Constants.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: MSP430Core.java,v 1.4 2007/10/22 18:03:41 joakime Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/22 18:03:41 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/MSP430Core.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/Multiplier.java =================================================================== --- mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: Multiplier.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/Multiplier.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/OperatingModeListener.java =================================================================== --- mspsim/se/sics/mspsim/core/OperatingModeListener.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/OperatingModeListener.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/core/OperatingModeListener.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/PortListener.java =================================================================== --- mspsim/se/sics/mspsim/core/PortListener.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/PortListener.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: PortListener.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/PortListener.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/Profiler.java =================================================================== --- mspsim/se/sics/mspsim/core/Profiler.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/Profiler.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: MSP430.java,v 1.4 2007/10/21 22:02:22 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 22:02:22 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/Profiler.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/SFR.java =================================================================== --- mspsim/se/sics/mspsim/core/SFR.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/SFR.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: SFR.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/SFR.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/TimeEvent.java =================================================================== --- mspsim/se/sics/mspsim/core/TimeEvent.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/TimeEvent.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: BasicClockModule.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/TimeEvent.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/Timer.java =================================================================== --- mspsim/se/sics/mspsim/core/Timer.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/Timer.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: Timer.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/Timer.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/USART.java =================================================================== --- mspsim/se/sics/mspsim/core/USART.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/USART.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: USART.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/USART.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/core/USARTListener.java =================================================================== --- mspsim/se/sics/mspsim/core/USARTListener.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/core/USARTListener.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: USARTListener.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Property changes on: mspsim/se/sics/mspsim/core/USARTListener.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/CScanner.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/extutil/highlight/HighlightSourceViewer.java =================================================================== --- mspsim/se/sics/mspsim/extutil/highlight/HighlightSourceViewer.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/extutil/highlight/HighlightSourceViewer.java 2008-03-11 15:32:12 UTC (rev 177) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * @@ -34,8 +34,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : 6 dec 2007 - * Updated : $Date: 6 dec 2007 $ - * $Revision: 1.0 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.extutil.highlight; Property changes on: mspsim/se/sics/mspsim/extutil/highlight/HighlightSourceViewer.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/JavaScanner.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/LineNumberedBorder.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/Scan.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/Scanner.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/Symbol.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/SyntaxHighlighter.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/TextScanner.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/Token.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/highlight/TokenTypes.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/jfreechart/DataChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/extutil/jfreechart/DataSourceSampler.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/platform/GenericNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/GenericNode.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/platform/GenericNode.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: $ + * $Id$ * * ----------------------------------------------------------------- * Property changes on: mspsim/se/sics/mspsim/platform/GenericNode.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/platform/esb/ESBGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: ESBGui.java,v 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.platform.esb; Property changes on: mspsim/se/sics/mspsim/platform/esb/ESBGui.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/platform/esb/ESBNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: ESBNode.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.platform.esb; Property changes on: mspsim/se/sics/mspsim/platform/esb/ESBNode.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/platform/sky/SkyGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: SkyGui.java,v 1.6 2007/10/23 07:36:47 joakime Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/23 07:36:47 $ - * $Revision: 1.6 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.platform.sky; Property changes on: mspsim/se/sics/mspsim/platform/sky/SkyGui.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: SkyNode.java,v 1.4 2007/10/22 18:03:42 joakime Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/22 18:03:42 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.platform.sky; Property changes on: mspsim/se/sics/mspsim/platform/sky/SkyNode.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/AbstractChart.java =================================================================== --- mspsim/se/sics/mspsim/ui/AbstractChart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/AbstractChart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : May 3 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/AbstractChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/BarChart.java =================================================================== --- mspsim/se/sics/mspsim/ui/BarChart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/BarChart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/BarChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/Chart.java =================================================================== --- mspsim/se/sics/mspsim/ui/Chart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/Chart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/Chart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/ChartPanel.java =================================================================== --- mspsim/se/sics/mspsim/ui/ChartPanel.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/ChartPanel.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/ChartPanel.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/ConstantLineChart.java =================================================================== --- mspsim/se/sics/mspsim/ui/ConstantLineChart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/ConstantLineChart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/ConstantLineChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/ControlUI.java =================================================================== --- mspsim/se/sics/mspsim/ui/ControlUI.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/ControlUI.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: ControlUI.java,v 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/ControlUI.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/DebugUI.java =================================================================== --- mspsim/se/sics/mspsim/ui/DebugUI.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/DebugUI.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: DebugUI.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/DebugUI.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/DoubleBarChart.java =================================================================== --- mspsim/se/sics/mspsim/ui/DoubleBarChart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/DoubleBarChart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/DoubleBarChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/DoubleSerieChart.java =================================================================== --- mspsim/se/sics/mspsim/ui/DoubleSerieChart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/DoubleSerieChart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/DoubleSerieChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/IntSerieChart.java =================================================================== --- mspsim/se/sics/mspsim/ui/IntSerieChart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/IntSerieChart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/IntSerieChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/LineChart.java =================================================================== --- mspsim/se/sics/mspsim/ui/LineChart.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/LineChart.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Authors : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : April 26 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/LineChart.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/SerialMon.java =================================================================== --- mspsim/se/sics/mspsim/ui/SerialMon.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/SerialMon.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: SerialMon.java,v 1.4 2007/10/21 22:19:07 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 22:19:07 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/SerialMon.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/SourceViewer.java =================================================================== --- mspsim/se/sics/mspsim/ui/SourceViewer.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/SourceViewer.java 2008-03-11 15:32:12 UTC (rev 177) @@ -34,8 +34,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 22:02:22 $ - * $Revision: 1.4 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/SourceViewer.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/StackUI.java =================================================================== --- mspsim/se/sics/mspsim/ui/StackUI.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/StackUI.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: StackUI.java,v 1.3 2007/10/21 21:17:35 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:35 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/StackUI.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/ui/WindowUtils.java =================================================================== --- mspsim/se/sics/mspsim/ui/WindowUtils.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/ui/WindowUtils.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: WindowUtils.java,v 1.2 2007/10/21 20:50:26 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson, Niclas Finne, Fredrik \xD6sterlind * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 20:50:26 $ - * $Revision: 1.2 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.ui; Property changes on: mspsim/se/sics/mspsim/ui/WindowUtils.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/util/ActiveComponent.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Property changes on: mspsim/se/sics/mspsim/util/ComponentRegistry.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/util/DataSource.java =================================================================== --- mspsim/se/sics/mspsim/util/DataSource.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/util/DataSource.java 2008-03-11 15:32:12 UTC (rev 177) @@ -33,8 +33,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.util; Property changes on: mspsim/se/sics/mspsim/util/DataSource.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/util/DebugInfo.java =================================================================== --- mspsim/se/sics/mspsim/util/DebugInfo.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/util/DebugInfo.java 2008-03-11 15:32:12 UTC (rev 177) @@ -33,8 +33,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.util; Property changes on: mspsim/se/sics/mspsim/util/DebugInfo.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/util/DotDiagram.java =================================================================== --- mspsim/se/sics/mspsim/util/DotDiagram.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/util/DotDiagram.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: DotDiagram.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson, Niclas Finne, Fredrik \xD6sterlind * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.util; Property changes on: mspsim/se/sics/mspsim/util/DotDiagram.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/util/ELF.java =================================================================== --- mspsim/se/sics/mspsim/util/ELF.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/util/ELF.java 2008-03-11 15:32:12 UTC (rev 177) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id: ELF.java,v 1.3 2007/10/21 21:17:34 nfi Exp $ + * $Id$ * * ----------------------------------------------------------------- * @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : Sun Oct 21 22:00:00 2007 - * Updated : $Date: 2007/10/21 21:17:34 $ - * $Revision: 1.3 $ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.util; Property changes on: mspsim/se/sics/mspsim/util/ELF.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Modified: mspsim/se/sics/mspsim/util/ELFDebug.java =================================================================== --- mspsim/se/sics/mspsim/util/ELFDebug.java 2008-03-11 15:25:51 UTC (rev 176) +++ mspsim/se/sics/mspsim/util/ELFDebug.java 2008-03-11 15:32:12 UTC (rev 177) @@... [truncated message content] |
From: <ni...@us...> - 2008-03-11 15:26:07
|
Revision: 176 http://mspsim.svn.sourceforge.net/mspsim/?rev=176&view=rev Author: nifi Date: 2008-03-11 08:25:51 -0700 (Tue, 11 Mar 2008) Log Message: ----------- updated operating mode statistics and added CLI commands for listing chips and duty cycle statistics Modified Paths: -------------- mspsim/se/sics/mspsim/platform/GenericNode.java mspsim/se/sics/mspsim/platform/sky/SkyGui.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java mspsim/se/sics/mspsim/util/OperatingModeStatistics.java Added Paths: ----------- mspsim/se/sics/mspsim/util/MultiDataSource.java mspsim/se/sics/mspsim/util/StatCommands.java Modified: mspsim/se/sics/mspsim/platform/GenericNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/GenericNode.java 2008-03-11 15:24:03 UTC (rev 175) +++ mspsim/se/sics/mspsim/platform/GenericNode.java 2008-03-11 15:25:51 UTC (rev 176) @@ -38,7 +38,6 @@ package se.sics.mspsim.platform; -import java.io.File; import java.io.IOException; import se.sics.mspsim.cli.CommandHandler; @@ -47,13 +46,13 @@ import se.sics.mspsim.core.Chip; import se.sics.mspsim.core.MSP430; import se.sics.mspsim.extutil.highlight.HighlightSourceViewer; -import se.sics.mspsim.extutil.jfreechart.DataChart; import se.sics.mspsim.ui.ControlUI; import se.sics.mspsim.util.ComponentRegistry; import se.sics.mspsim.util.ELF; import se.sics.mspsim.util.IHexReader; import se.sics.mspsim.util.MapTable; import se.sics.mspsim.util.OperatingModeStatistics; +import se.sics.mspsim.util.StatCommands; public abstract class GenericNode extends Chip implements Runnable { @@ -72,10 +71,13 @@ } CommandHandler ch = new CommandHandler(); + stats = new OperatingModeStatistics(cpu); + registry.registerComponent("cpu", cpu); registry.registerComponent("commandHandler", ch); registry.registerComponent("debugcmd", new DebugCommands()); - registry.registerComponent("debugcmd", new MiscCommands()); + registry.registerComponent("misccmd", new MiscCommands()); + registry.registerComponent("statcmd", new StatCommands(cpu, stats)); registry.registerComponent("node", this); // Monitor execution @@ -98,7 +100,6 @@ } cpu.reset(); - stats = new OperatingModeStatistics(cpu); setupNode(); // Setup control and other UI components Modified: mspsim/se/sics/mspsim/platform/sky/SkyGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2008-03-11 15:24:03 UTC (rev 175) +++ mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2008-03-11 15:25:51 UTC (rev 176) @@ -71,7 +71,6 @@ public static final Color RED_C = new Color(0xffff8000); private SerialMon serial; - private SerialMon radio; private ImageIcon skyImage; private JFrame window; Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-03-11 15:24:03 UTC (rev 175) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-03-11 15:25:51 UTC (rev 176) @@ -40,33 +40,21 @@ */ package se.sics.mspsim.platform.sky; -import java.io.File; import java.io.IOException; import se.sics.mspsim.chip.CC2420; import se.sics.mspsim.chip.M25P80; import se.sics.mspsim.chip.PacketListener; -import se.sics.mspsim.cli.CommandHandler; -import se.sics.mspsim.cli.DebugCommands; -import se.sics.mspsim.core.CPUMonitor; -import se.sics.mspsim.core.Chip; import se.sics.mspsim.core.IOPort; import se.sics.mspsim.core.IOUnit; import se.sics.mspsim.core.MSP430; import se.sics.mspsim.core.PortListener; -import se.sics.mspsim.core.TimeEvent; import se.sics.mspsim.core.USART; import se.sics.mspsim.core.USARTListener; -import se.sics.mspsim.extutil.highlight.HighlightSourceViewer; import se.sics.mspsim.extutil.jfreechart.DataChart; import se.sics.mspsim.extutil.jfreechart.DataSourceSampler; import se.sics.mspsim.platform.GenericNode; -import se.sics.mspsim.ui.ControlUI; -import se.sics.mspsim.util.ComponentRegistry; -import se.sics.mspsim.util.DataSource; import se.sics.mspsim.util.ELF; -import se.sics.mspsim.util.IHexReader; -import se.sics.mspsim.util.MapTable; import se.sics.mspsim.util.OperatingModeStatistics; /** @@ -222,11 +210,10 @@ ((USART) usart0).setUSARTListener(this); port4 = (IOPort) cpu.getIOUnit("Port 4"); if (port4 != null && port4 instanceof IOPort) { - System.out.println("Found port 4!!!"); ((IOPort) port4).setPortListener(this); } } - + stats.addMonitor(this); stats.addMonitor(radio); stats.addMonitor(cpu); @@ -261,7 +248,7 @@ // A HACK for some "graphs"!!! DataChart dataChart = new DataChart("Duty Cycle", "Duty Cycle"); DataSourceSampler dss = dataChart.setupChipFrame(cpu); - dataChart.addDataSource(dss, "LEDS", stats.getMultiDataSource("Tmote Sky")); + dataChart.addDataSource(dss, "LEDS", stats.getDataSource("Tmote Sky", 0, OperatingModeStatistics.OP_INVERT)); dataChart.addDataSource(dss, "Listen", stats.getDataSource("CC2420", CC2420.MODE_RX_ON)); dataChart.addDataSource(dss, "Transmit", stats.getDataSource("CC2420", CC2420.MODE_TXRX_ON)); dataChart.addDataSource(dss, "CPU", stats.getDataSource("MSP430 Core", MSP430.MODE_ACTIVE)); Added: mspsim/se/sics/mspsim/util/MultiDataSource.java =================================================================== --- mspsim/se/sics/mspsim/util/MultiDataSource.java (rev 0) +++ mspsim/se/sics/mspsim/util/MultiDataSource.java 2008-03-11 15:25:51 UTC (rev 176) @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2008, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of MSPSim. + * + * $Id$ + * + * ----------------------------------------------------------------- + * + * MultiDataSource + * + * Author : Joakim Eriksson, Niclas Finne + * Created : 11 March 2008 + * Updated : $Date$ + * $Rev$ + */ +package se.sics.mspsim.util; + +public interface MultiDataSource { + + public int getModeMax(); + + public int getValue(int mode); + +} Property changes on: mspsim/se/sics/mspsim/util/MultiDataSource.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Name: svn:eol-style + LF Modified: mspsim/se/sics/mspsim/util/OperatingModeStatistics.java =================================================================== --- mspsim/se/sics/mspsim/util/OperatingModeStatistics.java 2008-03-11 15:24:03 UTC (rev 175) +++ mspsim/se/sics/mspsim/util/OperatingModeStatistics.java 2008-03-11 15:25:51 UTC (rev 176) @@ -40,8 +40,8 @@ */ package se.sics.mspsim.util; +import java.util.Arrays; import java.util.HashMap; -import java.util.Iterator; import se.sics.mspsim.core.Chip; import se.sics.mspsim.core.MSP430Core; @@ -51,60 +51,70 @@ * @author Joakim * */ -public class OperatingModeStatistics implements OperatingModeListener { - +public class OperatingModeStatistics { + + public static final int OP_NORMAL = 0; + public static final int OP_INVERT = 1; + private MSP430Core cpu; private HashMap<String, StatEntry> statistics = new HashMap<String, StatEntry>(); public OperatingModeStatistics(MSP430Core cpu) { this.cpu = cpu; } - + + public Chip[] getChips() { + Chip[] chips = new Chip[statistics.size()]; + int index = 0; + for (StatEntry entry : statistics.values()) { + chips[index++] = entry.chip; + } + return chips; + } + public void addMonitor(Chip chip) { - chip.addOperatingModeListener(this); - StatEntry entry = new StatEntry(chip.getName(), chip.getModeMax()); + StatEntry entry = new StatEntry(chip); statistics.put(chip.getName(), entry); } - public void modeChanged(Chip source, int mode) { - StatEntry entry = statistics.get(source.getName()); - if (entry != null) - entry.updateStat(mode, cpu.cycles); - } - public void printStat() { - for (Iterator<StatEntry> iterator = statistics.values().iterator(); iterator.hasNext();) { - StatEntry entry = iterator.next(); + for (StatEntry entry : statistics.values()) { entry.printStat(); } } public DataSource getDataSource(String chip, int mode) { + return getDataSource(chip, mode, OP_NORMAL); + } + + public DataSource getDataSource(String chip, int mode, int operation) { StatEntry se = statistics.get(chip); if (se != null) { - return new StatDataSource(se, mode); + return new StatDataSource(se, mode, operation); } return null; } - public DataSource getMultiDataSource(String chip) { + public MultiDataSource getMultiDataSource(String chip) { StatEntry se = statistics.get(chip); if (se != null) { return new StatMultiDataSource(se); } return null; } - + private class StatDataSource implements DataSource { private StatEntry entry; private int mode; private long lastCycles; private long lastValue; + private final int operation; - public StatDataSource(StatEntry entry, int mode) { + public StatDataSource(StatEntry entry, int mode, int operation) { this.entry = entry; this.mode = mode; + this.operation = operation; lastCycles = cpu.cycles; } @@ -116,52 +126,59 @@ long valDiff = val - lastValue; lastValue = val; lastCycles = cpu.cycles; + if (operation == OP_INVERT) { + return (int) (100 - 100 * valDiff / diff); + } return (int) (100 * valDiff / diff); } } - private class StatMultiDataSource implements DataSource{ + private class StatMultiDataSource implements MultiDataSource { private StatEntry entry; - private long lastCycles; private long[] lastValue; + private long[] lastCycles; public StatMultiDataSource(StatEntry entry) { this.entry = entry; - lastCycles = cpu.cycles; - lastValue = new long[entry.elapsed.length]; + this.lastValue = new long[entry.elapsed.length]; + this.lastCycles = new long[entry.elapsed.length]; + Arrays.fill(this.lastCycles, cpu.cycles); } + @Override + public int getModeMax() { + return entry.chip.getModeMax(); + } + // returns percentage since last call... - public int getValue() { - long diff = cpu.cycles - lastCycles; + public int getValue(int mode) { + long diff = cpu.cycles - lastCycles[mode]; if (diff == 0) return 0; - long valDiff = 0; - // Assume that 0 means "off" - for (int i = 1; i < lastValue.length; i++) { - // Just sum them - later a multiplicator array might be useful... - long val = entry.getValue(i, cpu.cycles); - valDiff += (val - lastValue[i]); - lastValue[i] = val; - } - lastCycles = cpu.cycles; + long val = entry.getValue(mode, cpu.cycles); + long valDiff = (val - lastValue[mode]); + lastValue[mode] = val; + lastCycles[mode] = cpu.cycles; return (int) (100 * valDiff / diff); } + } - - - private class StatEntry { - String key; + + + private class StatEntry implements OperatingModeListener { + final Chip chip; long startTime; int mode = -1; long[] elapsed; - StatEntry(String key, int max) { - this.key = key; + StatEntry(Chip chip) { + this.chip = chip; + int max = chip.getModeMax(); elapsed = new long[max + 1]; + chip.addOperatingModeListener(this); } - + long getValue(int mode, long cycles) { if (mode == this.mode) { return elapsed[mode] + (cycles - startTime); @@ -169,16 +186,16 @@ return elapsed[mode]; } - void updateStat(int mode, long cycles) { + public void modeChanged(Chip source, int mode) { if (this.mode != -1) { - elapsed[this.mode] += cycles - startTime; + elapsed[this.mode] += cpu.cycles - startTime; } this.mode = mode; - startTime = cycles; + this.startTime = cpu.cycles; } void printStat() { - System.out.println("Stat for: " + key); + System.out.println("Stat for: " + chip.getName()); for (int i = 0; i < elapsed.length; i++) { System.out.println("" + (i + 1) + " = " + elapsed[i]); } Added: mspsim/se/sics/mspsim/util/StatCommands.java =================================================================== --- mspsim/se/sics/mspsim/util/StatCommands.java (rev 0) +++ mspsim/se/sics/mspsim/util/StatCommands.java 2008-03-11 15:25:51 UTC (rev 176) @@ -0,0 +1,137 @@ +/** + * Copyright (c) 2008, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of MSPSim. + * + * $Id$ + * + * ----------------------------------------------------------------- + * + * StatCommands + * + * Author : Joakim Eriksson, Niclas Finne + * Created : 11 March 2008 + * Updated : $Date$ + * $Rev$ + */ +package se.sics.mspsim.util; +import java.io.PrintStream; + +import se.sics.mspsim.cli.BasicAsyncCommand; +import se.sics.mspsim.cli.BasicCommand; +import se.sics.mspsim.cli.CommandBundle; +import se.sics.mspsim.cli.CommandContext; +import se.sics.mspsim.cli.CommandHandler; +import se.sics.mspsim.core.Chip; +import se.sics.mspsim.core.MSP430Core; +import se.sics.mspsim.core.TimeEvent; + +public class StatCommands implements CommandBundle { + + private final MSP430Core cpu; + private final OperatingModeStatistics statistics; + + public StatCommands(MSP430Core cpu, OperatingModeStatistics statistics) { + this.cpu = cpu; + this.statistics = statistics; + } + + @Override + public void setupCommands(ComponentRegistry registry, CommandHandler handler) { + handler.registerCommand("chipinfo", new BasicCommand("shows information about specified chip", + "[chips...]") { + + @Override + public int executeCommand(CommandContext context) { + if (context.getArgumentCount() > 0) { + for (int i = 0, n = context.getArgumentCount(); i < n; i++) { + // TODO list chips + } + return 0; + } + Chip[] chips = statistics.getChips(); + if (chips == null) { + context.out.println("No chips found"); + } else { + for (int i = 0, n = chips.length; i < n; i++) { + context.out.println(" " + chips[i].getName()); + } + } + return 0; + } + + }); + + handler.registerCommand("duty", new BasicAsyncCommand("adds a duty cycle sampler for operating modes to the specified chips", + "<frequency> <chip> [chips...]") { + + private PrintStream out; + private MultiDataSource[] sources; + private double frequency; + + public int executeCommand(CommandContext context) { + frequency = context.getArgumentAsDouble(0); + if (frequency <= 0.0) { + context.err.println("illegal frequency: " + context.getArgument(0)); + return 1; + } + sources = new MultiDataSource[context.getArgumentCount() - 1]; + for (int i = 0, n = sources.length; i < n; i++) { + sources[i] = statistics.getMultiDataSource(context.getArgument(i + 1)); + if (sources[i] == null) { + context.err.println("could not find chip " + context.getArgument(i + 1)); + return 1; + } + } + this.out = context.out; + + cpu.scheduleTimeEventMillis(new TimeEvent(0) { + + @Override + public void execute(long t) { + cpu.scheduleTimeEventMillis(this, 1000.0 / frequency); + for (int j = 0, n = sources.length; j < n; j++) { + MultiDataSource ds = sources[j]; + if (j > 0) out.print(' '); + for (int k = 0, m = ds.getModeMax(); k <= m; k++) { + if (k > 0) out.print(' '); + out.print(ds.getValue(k)); + } + } + out.println(); + } + }, 1000.0 / frequency); + return 0; + } + + public void stopCommand(CommandContext context) { + context.exit(0); + } + }); + } + +} Property changes on: mspsim/se/sics/mspsim/util/StatCommands.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-11 15:24:19
|
Revision: 175 http://mspsim.svn.sourceforge.net/mspsim/?rev=175&view=rev Author: nifi Date: 2008-03-11 08:24:03 -0700 (Tue, 11 Mar 2008) Log Message: ----------- started on implementation of TR1001 Modified Paths: -------------- mspsim/se/sics/mspsim/platform/esb/ESBGui.java mspsim/se/sics/mspsim/platform/esb/ESBNode.java Added Paths: ----------- mspsim/se/sics/mspsim/chip/TR1001.java Added: mspsim/se/sics/mspsim/chip/TR1001.java =================================================================== --- mspsim/se/sics/mspsim/chip/TR1001.java (rev 0) +++ mspsim/se/sics/mspsim/chip/TR1001.java 2008-03-11 15:24:03 UTC (rev 175) @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2008, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of MSPSim. + * + * $Id$ + * + * ----------------------------------------------------------------- + * TR1001 + * + * Authors : Joakim Eriksson, Niclas Finne + * Created : 11 mar 2008 + * Updated : $Date$ + * $Rev$ + */ + +package se.sics.mspsim.chip; +import se.sics.mspsim.core.Chip; +import se.sics.mspsim.core.USART; +import se.sics.mspsim.core.USARTListener; + +/** + * + */ +public class TR1001 extends Chip implements USARTListener { + + public static final int MODE_TXRX_OFF = 0x00; + public static final int MODE_RX_ON = 0x01; + public static final int MODE_TXRX_ON = 0x02; + public static final int MODE_MAX = MODE_TXRX_ON; + + private final USART usart; + private int mode; + + public TR1001(USART usart) { + this.usart = usart; + } + + @Override + public String getName() { + return "TR1001"; + } + + @Override + public int getModeMax() { + return MODE_MAX; + } + + public void setMode(int mode) { + if (this.mode != mode) { + this.mode = mode; + modeChanged(mode); + } + } + + @Override + public void dataReceived(USART source, int data) { + } + +} Property changes on: mspsim/se/sics/mspsim/chip/TR1001.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Name: svn:eol-style + LF Modified: mspsim/se/sics/mspsim/platform/esb/ESBGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-03-11 15:05:45 UTC (rev 174) +++ mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-03-11 15:24:03 UTC (rev 175) @@ -61,6 +61,8 @@ MouseMotionListener, MouseListener { + private static final long serialVersionUID = -139331418649524704L; + public static final int GREEN_X = 3; public static final int YELLOW_X = 10; public static final int RED_X = 17; @@ -75,7 +77,6 @@ public static final Color GREEN_C = new Color(0xff40ff40); private SerialMon serial; - private SerialMon radio; Beeper beeper; private ImageIcon esbImage; @@ -117,12 +118,6 @@ ((USART) usart).setUSARTListener(serial); } - IOUnit usart0 = cpu.getIOUnit("USART 0"); - if (usart0 instanceof USART) { - radio = new SerialMon((USART)usart0, "TR1001 Output"); - ((USART) usart0).setUSARTListener(radio); - } - beeper = new Beeper(); cpu.addIOUnit(-1,0,-1,0,beeper, true); } Modified: mspsim/se/sics/mspsim/platform/esb/ESBNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-03-11 15:05:45 UTC (rev 174) +++ mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-03-11 15:24:03 UTC (rev 175) @@ -42,15 +42,16 @@ package se.sics.mspsim.platform.esb; import java.io.IOException; -import se.sics.mspsim.chip.CC2420; -import se.sics.mspsim.core.*; -import se.sics.mspsim.platform.GenericNode; -import se.sics.mspsim.platform.sky.SkyNode; -import se.sics.mspsim.ui.ControlUI; -import se.sics.mspsim.util.*; -import se.sics.mspsim.extutil.highlight.HighlightSourceViewer; +import se.sics.mspsim.chip.TR1001; +import se.sics.mspsim.core.IOPort; +import se.sics.mspsim.core.IOUnit; +import se.sics.mspsim.core.MSP430; +import se.sics.mspsim.core.PortListener; +import se.sics.mspsim.core.USART; import se.sics.mspsim.extutil.jfreechart.DataChart; import se.sics.mspsim.extutil.jfreechart.DataSourceSampler; +import se.sics.mspsim.platform.GenericNode; + public class ESBNode extends GenericNode implements PortListener { public static final boolean DEBUG = false; @@ -62,6 +63,7 @@ private IOPort port1; private IOPort port2; + private IOPort port5; public static final int RED_LED = 0x01; public static final int GREEN_LED = 0x02; @@ -72,7 +74,10 @@ public boolean greenLed; public boolean yellowLed; + private TR1001 radio; public ESBGui gui; + + /** * Creates a new <code>ESBNode</code> instance. * @@ -122,6 +127,15 @@ gui.repaint(); gui.beeper.beepOn((data & BEEPER) != 0); } + + } else if (source == port5) { + if ((data & 0xc0) == 0xc0) { + radio.setMode(TR1001.MODE_RX_ON); + } else if ((data & 0xc0) == 0x40) { + radio.setMode(TR1001.MODE_TXRX_ON); + } else { + radio.setMode(TR1001.MODE_TXRX_OFF); + } } } @@ -129,7 +143,6 @@ IOUnit unit = cpu.getIOUnit("Port 2"); if (unit instanceof IOPort) { port2 = (IOPort) unit; - System.out.println("Found port 2!!!"); port2.setPortListener(this); } @@ -137,19 +150,30 @@ if (unit instanceof IOPort) { port1 = (IOPort) unit; } - + + unit = cpu.getIOUnit("Port 5"); + if (unit instanceof IOPort) { + port5 = (IOPort) unit; + port5.setPortListener(this); + } + + IOUnit usart0 = cpu.getIOUnit("USART 0"); + if (usart0 instanceof USART) { + radio = new TR1001((USART)usart0); + ((USART) usart0).setUSARTListener(radio); + } + gui = new ESBGui(this); stats.addMonitor(this); -// stats.addMonitor(radio); + stats.addMonitor(radio); stats.addMonitor(cpu); // A HACK for some "graphs"!!! DataChart dataChart = new DataChart("Duty Cycle", "Duty Cycle"); DataSourceSampler dss = dataChart.setupChipFrame(cpu); -// dataChart.addDataSource(dss, "LEDS", stats.getMultiDataSource("Tmote Sky")); -// dataChart.addDataSource(dss, "Listen", stats.getDataSource("CC2420", CC2420.MODE_RX_ON)); -// dataChart.addDataSource(dss, "Transmit", stats.getDataSource("CC2420", CC2420.MODE_TXRX_ON)); + dataChart.addDataSource(dss, "Listen", stats.getDataSource("TR1001", TR1001.MODE_RX_ON)); + dataChart.addDataSource(dss, "Transmit", stats.getDataSource("TR1001", TR1001.MODE_TXRX_ON)); dataChart.addDataSource(dss, "CPU", stats.getDataSource("MSP430 Core", MSP430.MODE_ACTIVE)); } @@ -166,5 +190,5 @@ node.setup(args); node.start(); } - + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-11 15:06:02
|
Revision: 174 http://mspsim.svn.sourceforge.net/mspsim/?rev=174&view=rev Author: nifi Date: 2008-03-11 08:05:45 -0700 (Tue, 11 Mar 2008) Log Message: ----------- added method to retrieve argument as double, float, and long Modified Paths: -------------- mspsim/se/sics/mspsim/cli/CommandContext.java Modified: mspsim/se/sics/mspsim/cli/CommandContext.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-10 14:21:39 UTC (rev 173) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-11 15:05:45 UTC (rev 174) @@ -127,6 +127,34 @@ return 0; } + public long getArgumentAsLong(int index) { + try { + return Long.parseLong(getArgument(index)); + } catch (Exception e) { + err.println("Illegal number format: " + getArgument(index)); + } + return 0L; + } + + public float getArgumentAsFloat(int index) { + try { + return Float.parseFloat(getArgument(index)); + } catch (Exception e) { + err.println("Illegal number format: " + getArgument(index)); + } + return 0f; + } + + public double getArgumentAsDouble(int index) { + String arg = getArgument(index); + try { + return Double.parseDouble(arg); + } catch (Exception e) { + err.println("Illegal number format: " + getArgument(index)); + } + return 0.0; + } + public String toString() { return (pid >= 0 ? ("" + pid) : "?") + '\t' + (commandLine == null ? getCommandName() : commandLine); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-10 14:21:53
|
Revision: 173 http://mspsim.svn.sourceforge.net/mspsim/?rev=173&view=rev Author: nifi Date: 2008-03-10 07:21:39 -0700 (Mon, 10 Mar 2008) Log Message: ----------- added watchreg and getRegisterName Modified Paths: -------------- mspsim/se/sics/mspsim/cli/CommandContext.java mspsim/se/sics/mspsim/cli/DebugCommands.java Modified: mspsim/se/sics/mspsim/cli/CommandContext.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-10 13:56:53 UTC (rev 172) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-10 14:21:39 UTC (rev 173) @@ -1,5 +1,7 @@ package se.sics.mspsim.cli; import java.io.PrintStream; + +import se.sics.mspsim.core.MSP430Constants; import se.sics.mspsim.util.MapTable; public class CommandContext { @@ -92,15 +94,36 @@ return mapTable.getFunctionAddress(adr); } } - return 0; + return -1; } - public int getArgumentAsInt(int i) { + public int getArgumentAsRegister(int index) { + String symbol = getArgument(index); + for (int i = 0, n = MSP430Constants.REGISTER_NAMES.length; i < n; i++) { + if (MSP430Constants.REGISTER_NAMES[i].equals(symbol)) { + return i; + } + } + String reg = symbol.startsWith("R") ? symbol.substring(1) : symbol; try { - return Integer.parseInt(getArgument(i)); + int register = Integer.parseInt(reg); + if (register >= 0 && register <= 15) { + return register; + } else { + err.println("illegal register: " + symbol); + } } catch (Exception e) { - err.println("Illegal number format: " + getArgument(i)); + err.println("illegal register: " + symbol); } + return -1; + } + + public int getArgumentAsInt(int index) { + try { + return Integer.parseInt(getArgument(index)); + } catch (Exception e) { + err.println("Illegal number format: " + getArgument(index)); + } return 0; } Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-10 13:56:53 UTC (rev 172) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-10 14:21:39 UTC (rev 173) @@ -41,6 +41,7 @@ package se.sics.mspsim.cli; import se.sics.mspsim.core.CPUMonitor; import se.sics.mspsim.core.MSP430; +import se.sics.mspsim.core.MSP430Constants; import se.sics.mspsim.platform.GenericNode; import se.sics.mspsim.util.ComponentRegistry; import se.sics.mspsim.util.DebugInfo; @@ -110,9 +111,50 @@ public void stopCommand(CommandContext context) { cpu.clearBreakPoint(address); + context.exit(0); } }); + ch.registerCommand("watchreg", + new BasicAsyncCommand("adds a write watch to a given register", "<register> [int]") { + int mode = 0; + int register = 0; + public int executeCommand(final CommandContext context) { + register = context.getArgumentAsRegister(0); + if (register < 0) { + return -1; + } + if (context.getArgumentCount() > 1) { + String modeStr = context.getArgument(1); + if ("int".equals(modeStr)) { + mode = 1; + } else { + context.err.println("illegal argument: " + modeStr); + return -1; + } + } + cpu.setRegisterWriteMonitor(register, new CPUMonitor() { + public void cpuAction(int type, int adr, int data) { + if (mode == 0) { + int pc = cpu.readRegister(0); + String adrStr = getRegisterName(register); + String pcStr = getSymOrAddrELF(elf, pc); + context.out.println("*** Write from " + pcStr + + ": " + adrStr + " = " + data); + } else { + context.out.println(data); + } + } + }); + context.out.println("Watch set for register " + getRegisterName(register)); + return 0; + } + + public void stopCommand(CommandContext context) { + cpu.clearBreakPoint(register); + } + }); + ch.registerCommand("clear", new Command() { public int executeCommand(final CommandContext context) { int baddr = context.getArgumentAsAddress(0); @@ -137,7 +179,7 @@ MapEntry[] entries = context.getMapTable().getEntries(regExp); for (int i = 0; i < entries.length; i++) { MapEntry mapEntry = entries[i]; - context.out.println(" " + mapEntry.getName() + " at " + + context.out.println(" " + mapEntry.getName() + " at $" + Utils.hex16(mapEntry.getAddress())); } return 0; @@ -148,7 +190,7 @@ ch.registerCommand("stop", new BasicCommand("stops mspsim", "") { public int executeCommand(CommandContext context) { node.stop(); - context.out.println("CPU stopped at: " + Utils.hex16(cpu.readRegister(0))); + context.out.println("CPU stopped at: $" + Utils.hex16(cpu.readRegister(0))); return 0; } }); @@ -180,15 +222,18 @@ }); ch.registerCommand("printreg", new BasicCommand("prints value of an register", "<register>") { public int executeCommand(CommandContext context) { - int adr = context.getArgumentAsInt(0); - context.out.println("" + context.getArgument(0) + " = " + Utils.hex16(cpu.readRegister(adr))); - return 0; + int register = context.getArgumentAsRegister(0); + if (register >= 0) { + context.out.println(context.getArgument(0) + " = $" + Utils.hex16(cpu.readRegister(register))); + return 0; + } + return -1; } }); ch.registerCommand("time", new BasicCommand("prints the elapse time and cycles", "") { public int executeCommand(CommandContext context) { long time = ((long)(cpu.getTimeMillis())); - context.out.println("Emulated time elapsed:" + time + "(ms) cycles: " + cpu.cycles); + context.out.println("Emulated time elapsed: " + time + "(ms) cycles: " + cpu.cycles); return 0; } }); @@ -215,4 +260,11 @@ } } + private static String getRegisterName(int register) { + if (register >= 0 && register < MSP430Constants.REGISTER_NAMES.length) { + return MSP430Constants.REGISTER_NAMES[register]; + } else { + return "R" + register; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-10 13:58:22
|
Revision: 172 http://mspsim.svn.sourceforge.net/mspsim/?rev=172&view=rev Author: nifi Date: 2008-03-10 06:56:53 -0700 (Mon, 10 Mar 2008) Log Message: ----------- added REGISTER_NAMES Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430Constants.java Modified: mspsim/se/sics/mspsim/core/MSP430Constants.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-03-10 13:55:37 UTC (rev 171) +++ mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-03-10 13:56:53 UTC (rev 172) @@ -43,7 +43,7 @@ public interface MSP430Constants { - public static final String VERSION = "0.85 jag ha"; + public static final String VERSION = "0.85"; public static final int CLK_ACLK = 1; public static final int CLK_SMCLK = 2; @@ -88,6 +88,10 @@ "CMP", "DADD", "BIT", "BIC", "BIS", "XOR", "AND" }; + public static final String[] REGISTER_NAMES = { + "PC", "SP", "SR", "CG1", "CG2" + }; + public static final int PC = 0; public static final int SP = 1; public static final int SR = 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-10 13:56:11
|
Revision: 171 http://mspsim.svn.sourceforge.net/mspsim/?rev=171&view=rev Author: nifi Date: 2008-03-10 06:55:37 -0700 (Mon, 10 Mar 2008) Log Message: ----------- filter out carriage returns Modified Paths: -------------- mspsim/se/sics/mspsim/cli/LineOutputStream.java Modified: mspsim/se/sics/mspsim/cli/LineOutputStream.java =================================================================== --- mspsim/se/sics/mspsim/cli/LineOutputStream.java 2008-03-10 13:23:28 UTC (rev 170) +++ mspsim/se/sics/mspsim/cli/LineOutputStream.java 2008-03-10 13:55:37 UTC (rev 171) @@ -55,6 +55,7 @@ public LineOutputStream(LineListener listener) { this.listener = listener; } + /* Buffers and calls line listener when a line is complete * @see java.io.OutputStream#write(int) */ @@ -63,7 +64,7 @@ if (c == '\n') { listener.lineRead(line.toString()); line.setLength(0); - } else { + } else if (c != '\r'){ line.append((char) c); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-10 13:23:34
|
Revision: 170 http://mspsim.svn.sourceforge.net/mspsim/?rev=170&view=rev Author: nifi Date: 2008-03-10 06:23:28 -0700 (Mon, 10 Mar 2008) Log Message: ----------- - changed Command API for command help and command arguments - added command line in command context - changed to report errors to context err instead of system err Modified Paths: -------------- mspsim/se/sics/mspsim/cli/BasicCommand.java mspsim/se/sics/mspsim/cli/Command.java mspsim/se/sics/mspsim/cli/CommandContext.java mspsim/se/sics/mspsim/cli/CommandHandler.java mspsim/se/sics/mspsim/cli/DebugCommands.java Modified: mspsim/se/sics/mspsim/cli/BasicCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicCommand.java 2008-03-10 00:11:25 UTC (rev 169) +++ mspsim/se/sics/mspsim/cli/BasicCommand.java 2008-03-10 13:23:28 UTC (rev 170) @@ -52,11 +52,11 @@ argumentHelp = argHelp; } - public String getArgumentHelp(CommandContext context) { + public String getArgumentHelp(String commandName) { return argumentHelp; } - public String getCommandHelp(CommandContext context) { + public String getCommandHelp(String commandName) { return commandHelp; } } Modified: mspsim/se/sics/mspsim/cli/Command.java =================================================================== --- mspsim/se/sics/mspsim/cli/Command.java 2008-03-10 00:11:25 UTC (rev 169) +++ mspsim/se/sics/mspsim/cli/Command.java 2008-03-10 13:23:28 UTC (rev 170) @@ -1,12 +1,28 @@ -package se.sics.mspsim.cli; - - -public abstract class Command implements Cloneable { - public abstract int executeCommand(CommandContext context); - public abstract String getCommandHelp(CommandContext context); - public abstract String getArgumentHelp(CommandContext context); - - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } -} +package se.sics.mspsim.cli; + +public abstract class Command implements Cloneable { + + /** + * Returns a text describing this command. First line is a short description that may be followed by + * more lines with detailed descriptions. + * + * @param commandName the name of the command + * @return a text describing the command + */ + public abstract String getCommandHelp(String commandName); + + /** + * Returns a text describing the arguments for this command. Required arguments should be surrounded by + * '<' and '>', optional arguments should be surrounded by '[' and ']'. + * + * @param commandName the name of the command + * @return a text describing the arguments for this command + */ + public abstract String getArgumentHelp(String commandName); + + public abstract int executeCommand(CommandContext context); + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} Modified: mspsim/se/sics/mspsim/cli/CommandContext.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-10 00:11:25 UTC (rev 169) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-10 13:23:28 UTC (rev 170) @@ -1,29 +1,30 @@ package se.sics.mspsim.cli; - import java.io.PrintStream; - import se.sics.mspsim.util.MapTable; - public class CommandContext { private String[] args; + private String commandLine; private MapTable mapTable; - private int pid; + private int pid = -1; private Command command; public PrintStream out; public PrintStream err; - public CommandContext(MapTable table, String[] args, int pid, Command command, PrintStream out, PrintStream err) { - this(table, args, pid, command); + public CommandContext(MapTable table, String commandLine, String[] args, + int pid, Command command, PrintStream out, PrintStream err) { + this(table, commandLine, args, pid, command); setOutput(out, err); } - public CommandContext(MapTable table, String[] args, int pid, Command command) { + public CommandContext(MapTable table, String commandLine, String[] args, + int pid, Command command) { + this.commandLine = commandLine; this.args = args; this.pid = pid; - mapTable = table; + this.mapTable = table; this.command = command; } @@ -36,6 +37,10 @@ return command; } + String getCommandLine() { + return commandLine; + } + public int getPID() { return pid; } @@ -46,8 +51,17 @@ */ public void exit(int exitCode) { // TODO: Clean up can be done now! + pid = -1; } - + + public MapTable getMapTable() { + return mapTable; + } + + public String getCommandName() { + return args[0]; + } + public int getArgumentCount() { return args.length - 1; } @@ -56,14 +70,6 @@ return args[index + 1]; } - public MapTable getMapTable() { - return mapTable; - } - - public String getCommandName() { - return args[0]; - } - public int getArgumentAsAddress(int index) { String adr = getArgument(index); if (adr == null || adr.length() == 0) return 0; @@ -98,8 +104,8 @@ return 0; } - void setPID(int i) { - pid = i; + public String toString() { + return (pid >= 0 ? ("" + pid) : "?") + '\t' + (commandLine == null ? getCommandName() : commandLine); } - + } Modified: mspsim/se/sics/mspsim/cli/CommandHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-10 00:11:25 UTC (rev 169) +++ mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-10 13:23:28 UTC (rev 170) @@ -2,7 +2,6 @@ import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.InterruptedIOException; import java.io.PrintStream; @@ -22,16 +21,15 @@ private ArrayList<CommandContext[]> currentAsyncCommands = new ArrayList<CommandContext[]>(); private BufferedReader inReader; - private InputStream in; private PrintStream out; private PrintStream err; private MapTable mapTable; private ComponentRegistry registry; - private int pid = 1; + private int pidCounter = 0; public CommandHandler() { exit = false; - inReader = new BufferedReader(new InputStreamReader(in = System.in)); + inReader = new BufferedReader(new InputStreamReader(System.in)); out = System.out; err = System.err; @@ -79,10 +77,15 @@ String[][] parts = CommandParser.parseLine(line); if(parts.length > 0 && checkCommands(parts) == 0) { CommandContext[] commands = new CommandContext[parts.length]; + boolean error = false; + int pid = -1; for (int i = 0; i < parts.length; i++) { String[] args = parts[i]; Command cmd = getCommand(args[0]); - commands[i] = new CommandContext(mapTable, args, 0, cmd); + if (i == 0 && cmd instanceof AsyncCommand) { + pid = ++pidCounter; + } + commands[i] = new CommandContext(mapTable, line, args, pid, cmd); if (i > 0) { PrintStream po = new PrintStream(new LineOutputStream((LineListener) commands[i].getCommand())); commands[i - 1].setOutput(po, err); @@ -94,22 +97,30 @@ // TODO: Check if first command is also LineListener and set it up for input!! } // Execute when all is set-up in opposite order... + // TODO if error the command chain should be stopped for (int i = parts.length - 1; i >= 0; i--) { try { - commands[i].getCommand().executeCommand(commands[i]); + int code = commands[i].getCommand().executeCommand(commands[i]); + if (code != 0) { + err.println("command '" + commands[i].getCommandName() + + "' failed with error code " + code); + error = true; + } } catch (Exception e) { err.println("Error: Command failed: " + e.getMessage()); e.printStackTrace(err); + error = true; } } - if (commands[0].getCommand() instanceof AsyncCommand) { - commands[0].setPID(pid++); + if (error) { + // TODO close any started commands + } else if (pid >= 0) { currentAsyncCommands.add(commands); } } } } catch (IOException e) { - e.printStackTrace(); + e.printStackTrace(err); err.println("Command line tool exiting..."); exit = true; } @@ -119,10 +130,13 @@ // This will return an instance that can be configured - // which is basically not OK... TODO - fix this!!! private Command getCommand(String cmd) { - try { - return (Command) commands.get(cmd).clone(); - } catch (CloneNotSupportedException e) { - e.printStackTrace(); + Command command = commands.get(cmd); + if (command != null) { + try { + return (Command) command.clone(); + } catch (CloneNotSupportedException e) { + e.printStackTrace(err); + } } return null; } @@ -131,13 +145,29 @@ for (int i = 0; i < cmds.length; i++) { Command command = commands.get(cmds[i][0]); if (command == null) { - System.out.println("CLI: Command not found: " + cmds[i][0]); + err.println("CLI: Command not found: " + cmds[i][0]); return -1; } if (i > 0 && !(command instanceof LineListener)) { - System.out.println("CLI: Error " + cmds[i][0] + " does not take input"); + err.println("CLI: Error " + cmds[i][0] + " does not take input"); return -1; } + // TODO replace with command name + String argHelp = command.getArgumentHelp(null); + if (argHelp != null) { + int requiredCount = 0; + for (int j = 0, m = argHelp.length(); j < m; j++) { + if (argHelp.charAt(j) == '<') { + requiredCount++; + } + } + if (requiredCount > cmds[i].length - 1) { + // Too few arguments + err.println("Too few arguments for " + cmds[i][0]); + err.println("Usage: " + cmds[i][0] + ' ' + argHelp); + return -1; + } + } } return 0; } @@ -163,18 +193,15 @@ } private void registerCommands() { - registerCommand("help", new Command() { + registerCommand("help", new BasicCommand("shows help for the specified command or command list", "[command]") { public int executeCommand(CommandContext context) { if (context.getArgumentCount() == 0) { context.out.println("Available commands:"); - for(Map.Entry entry: commands.entrySet()) { - String name = (String) entry.getKey(); - Command command = (Command) entry.getValue(); - CommandContext cc = new CommandContext(mapTable, new String[] { - name - }, 0, null, context.out, context.err); - String prefix = ' ' + name + ' ' + command.getArgumentHelp(cc); - String helpText = command.getCommandHelp(cc); + for(Map.Entry<String,Command> entry: commands.entrySet()) { + String name = entry.getKey(); + Command command = entry.getValue(); + String prefix = ' ' + name + ' ' + command.getArgumentHelp(name); + String helpText = command.getCommandHelp(name); int n; if (helpText != null && (n = helpText.indexOf('\n')) > 0) { helpText = helpText.substring(0, n); @@ -194,22 +221,13 @@ String cmd = context.getArgument(0); Command command = commands.get(cmd); if (command != null) { - CommandContext cc = new CommandContext(mapTable, new String[] { - cmd - }, 0, null, context.out, context.err); - context.out.println(cmd + ' ' + command.getArgumentHelp(cc)); - context.out.println(" " + command.getCommandHelp(cc)); + context.out.println(cmd + ' ' + command.getArgumentHelp(cmd)); + context.out.println(" " + command.getCommandHelp(cmd)); return 0; } context.err.println("Error: unknown command '" + cmd + '\''); return 1; } - public String getArgumentHelp(CommandContext context) { - return "<command>"; - } - public String getCommandHelp(CommandContext context) { - return "shows help for the specified command"; - } }); registerCommand("workaround", new BasicCommand("", "") { public int executeCommand(CommandContext context) { @@ -222,19 +240,21 @@ public int executeCommand(CommandContext context) { for (int i = 0; i < currentAsyncCommands.size(); i++) { CommandContext cmd = currentAsyncCommands.get(i)[0]; - System.out.println(" " + cmd.getPID() + " " + cmd.getCommandName()); + context.out.println(" " + cmd); } return 0; } }); - registerCommand("kill", new BasicCommand("kill a current executing command", "") { + registerCommand("kill", new BasicCommand("kill a currently executing command", "<process>") { public int executeCommand(CommandContext context) { int pid = context.getArgumentAsInt(0); for (int i = 0; i < currentAsyncCommands.size(); i++) { - CommandContext cmd = currentAsyncCommands.get(i)[0]; + CommandContext[] contexts = currentAsyncCommands.get(i); + CommandContext cmd = contexts[0]; if (pid == cmd.getPID()) { - System.out.println("Should kill: " + cmd.getCommandName()); + context.out.println("Should kill: " + cmd.getCommandName()); + break; } } return 0; Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-10 00:11:25 UTC (rev 169) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-10 13:23:28 UTC (rev 170) @@ -120,11 +120,11 @@ return 0; } - public String getArgumentHelp(CommandContext context) { + public String getArgumentHelp(String commandName) { return "<address or symbol>"; } - public String getCommandHelp(CommandContext context) { + public String getCommandHelp(String commandName) { return "clears a breakpoint or watch from a given address or symbol"; } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-10 00:11:29
|
Revision: 169 http://mspsim.svn.sourceforge.net/mspsim/?rev=169&view=rev Author: nifi Date: 2008-03-09 17:11:25 -0700 (Sun, 09 Mar 2008) Log Message: ----------- added command description Modified Paths: -------------- mspsim/se/sics/mspsim/cli/ExecCommand.java Modified: mspsim/se/sics/mspsim/cli/ExecCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/ExecCommand.java 2008-03-09 23:41:42 UTC (rev 168) +++ mspsim/se/sics/mspsim/cli/ExecCommand.java 2008-03-10 00:11:25 UTC (rev 169) @@ -52,7 +52,7 @@ private PrintStream output; public ExecCommand() { - super("exec", "<command> [args...]"); + super("executes the specified command", "<cmd> [args...]"); } public int executeCommand(CommandContext context) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-09 23:41:44
|
Revision: 168 http://mspsim.svn.sourceforge.net/mspsim/?rev=168&view=rev Author: nifi Date: 2008-03-09 16:41:42 -0700 (Sun, 09 Mar 2008) Log Message: ----------- simple exec command Modified Paths: -------------- mspsim/se/sics/mspsim/cli/MiscCommands.java Added Paths: ----------- mspsim/se/sics/mspsim/cli/ExecCommand.java Added: mspsim/se/sics/mspsim/cli/ExecCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/ExecCommand.java (rev 0) +++ mspsim/se/sics/mspsim/cli/ExecCommand.java 2008-03-09 23:41:42 UTC (rev 168) @@ -0,0 +1,174 @@ +/** + * Copyright (c) 2008, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of MSPSim. + * + * ----------------------------------------------------------------- + * + * ExecCommand + * + * Author : Joakim Eriksson, Niclas Finne + * Created : Sun Mar 09 23:15:36 2008 + * Updated : $Date:$ + * $Revision:$ + */ +package se.sics.mspsim.cli; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintStream; + +public class ExecCommand extends BasicLineCommand { + + private CommandContext context; + private Process process; + private Runner runner; + private Reader stdout; + private Reader stderr; + private PrintStream output; + + public ExecCommand() { + super("exec", "<command> [args...]"); + } + + public int executeCommand(CommandContext context) { + this.context = context; + + String[] args = new String[context.getArgumentCount()]; + for (int i = 0, n = args.length; i < n; i++) { + args[i] = context.getArgument(i); + } + String name = args[0]; + + try { + process = Runtime.getRuntime().exec(args); + stdout = new Reader(name + ".out", this, + process.getInputStream(), context.out); + stdout.start(); + stderr = new Reader(name + ".err", this, + process.getErrorStream(), context.err); + stderr.start(); + + output = new PrintStream(process.getOutputStream()); + + runner = new Runner(name + ".proc", this); + runner.start(); + } catch (Exception e) { + context.err.println("failed to start command: " + e.getMessage()); + return 1; + } + return 0; + } + + public void lineRead(String line) { + output.println(line); + } + + public void stopCommand(CommandContext context) { + if (runner != null && runner.isRunning) { + process.destroy(); + } else { + context.exit(0); + } + } + + + // ------------------------------------------------------------------- + // Handler for the executer + // ------------------------------------------------------------------- + + private static class Runner extends Thread { + + public ExecCommand command; + public boolean isRunning; + + public Runner(String name, ExecCommand command) { + super(name); + this.command = command; + this.isRunning = false; + } + + public void run() { + int exitValue = -1; + isRunning = true; + try { + command.process.waitFor(); + + // Wait for the readers to be finished before reporting about + // the process exit + for (int i = 0; i < 5 && + (command.stdout.isAlive() || command.stderr.isAlive()); + i++) { + Thread.sleep(300); + } + + exitValue = command.process.exitValue(); + + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + isRunning = false; + command.context.exit(exitValue); + } + } + + } // end of inner class Runner + + + // ------------------------------------------------------------------- + // Handler for reading the input streams + // ------------------------------------------------------------------- + + private static class Reader extends Thread { + + private ExecCommand command; + private PrintStream out; + private BufferedReader input; + + public Reader(String name, ExecCommand command, + InputStream input, PrintStream out) { + super(name); + this.command = command; + this.input = new BufferedReader(new InputStreamReader(input)); + this.out = out; + } + + public void run() { + try { + String line; + while ((line = input.readLine()) != null) { + out.println(line); + } + } catch (Exception e) { + command.context.err.println("* " + getName() + + " failed: " + e.getMessage()); + } + } + + } // end of inner class Reader + +} Modified: mspsim/se/sics/mspsim/cli/MiscCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-09 23:38:51 UTC (rev 167) +++ mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-09 23:41:42 UTC (rev 168) @@ -68,6 +68,8 @@ context.exit(0); } }); + + handler.registerCommand("exec", new ExecCommand()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-09 23:38:54
|
Revision: 167 http://mspsim.svn.sourceforge.net/mspsim/?rev=167&view=rev Author: nifi Date: 2008-03-09 16:38:51 -0700 (Sun, 09 Mar 2008) Log Message: ----------- fixed to show command name Modified Paths: -------------- mspsim/se/sics/mspsim/cli/CommandHandler.java Modified: mspsim/se/sics/mspsim/cli/CommandHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 23:37:13 UTC (rev 166) +++ mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 23:38:51 UTC (rev 167) @@ -131,7 +131,7 @@ for (int i = 0; i < cmds.length; i++) { Command command = commands.get(cmds[i][0]); if (command == null) { - System.out.println("CLI: Command not found: " + cmds[i]); + System.out.println("CLI: Command not found: " + cmds[i][0]); return -1; } if (i > 0 && !(command instanceof LineListener)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-03-09 23:37:28
|
Revision: 166 http://mspsim.svn.sourceforge.net/mspsim/?rev=166&view=rev Author: nifi Date: 2008-03-09 16:37:13 -0700 (Sun, 09 Mar 2008) Log Message: ----------- added cli package Modified Paths: -------------- mspsim/Makefile Modified: mspsim/Makefile =================================================================== --- mspsim/Makefile 2008-03-09 22:12:08 UTC (rev 165) +++ mspsim/Makefile 2008-03-09 23:37:13 UTC (rev 166) @@ -68,7 +68,7 @@ BINARY := README.txt license.txt CHANGE_LOG.txt images/*.jpg firmware/*/*.firmware -PACKAGES := ${addprefix se/sics/mspsim/,core platform platform/esb platform/sky ui util chip extutil/highlight extutil/jfreechart} +PACKAGES := ${addprefix se/sics/mspsim/,core platform platform/esb platform/sky cli ui util chip extutil/highlight extutil/jfreechart} SOURCES := ${wildcard *.java $(addsuffix /*.java,$(PACKAGES))} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-09 22:12:21
|
Revision: 165 http://mspsim.svn.sourceforge.net/mspsim/?rev=165&view=rev Author: joxe Date: 2008-03-09 15:12:08 -0700 (Sun, 09 Mar 2008) Log Message: ----------- added commands ps and kill (not working) Modified Paths: -------------- mspsim/se/sics/mspsim/cli/CommandContext.java mspsim/se/sics/mspsim/cli/CommandHandler.java mspsim/se/sics/mspsim/cli/DebugCommands.java Modified: mspsim/se/sics/mspsim/cli/CommandContext.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-09 20:22:31 UTC (rev 164) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-09 22:12:08 UTC (rev 165) @@ -97,5 +97,9 @@ } return 0; } + + void setPID(int i) { + pid = i; + } } Modified: mspsim/se/sics/mspsim/cli/CommandHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 20:22:31 UTC (rev 164) +++ mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 22:12:08 UTC (rev 165) @@ -20,73 +20,22 @@ private boolean exit; private boolean workaround = false; + private ArrayList<CommandContext[]> currentAsyncCommands = new ArrayList<CommandContext[]>(); private BufferedReader inReader; private InputStream in; private PrintStream out; private PrintStream err; private MapTable mapTable; private ComponentRegistry registry; - + private int pid = 1; + public CommandHandler() { exit = false; inReader = new BufferedReader(new InputStreamReader(in = System.in)); out = System.out; err = System.err; - registerCommand("help", new Command() { - public int executeCommand(CommandContext context) { - if (context.getArgumentCount() == 0) { - context.out.println("Available commands:"); - for(Map.Entry entry: commands.entrySet()) { - String name = (String) entry.getKey(); - Command command = (Command) entry.getValue(); - CommandContext cc = new CommandContext(mapTable, new String[] { - name - }, 0, null, context.out, context.err); - String prefix = ' ' + name + ' ' + command.getArgumentHelp(cc); - String helpText = command.getCommandHelp(cc); - int n; - if (helpText != null && (n = helpText.indexOf('\n')) > 0) { - helpText = helpText.substring(0, n); - } - context.out.print(prefix); - if (prefix.length() < 8) { - context.out.print('\t'); - } - if (prefix.length() < 16) { - context.out.print('\t'); - } - context.out.println("\t " + helpText); - } - return 0; - } - - String cmd = context.getArgument(0); - Command command = commands.get(cmd); - if (command != null) { - CommandContext cc = new CommandContext(mapTable, new String[] { - cmd - }, 0, null, context.out, context.err); - context.out.println(cmd + ' ' + command.getArgumentHelp(cc)); - context.out.println(" " + command.getCommandHelp(cc)); - return 0; - } - context.err.println("Error: unknown command '" + cmd + '\''); - return 1; - } - public String getArgumentHelp(CommandContext context) { - return "<command>"; - } - public String getCommandHelp(CommandContext context) { - return "shows help for the specified command"; - } - }); - registerCommand("workaround", new BasicCommand("", "") { - public int executeCommand(CommandContext context) { - workaround = true; - return 0; - } - }); + registerCommands(); } // Add it to the hashtable (overwriting anything there) @@ -129,7 +78,6 @@ if (line != null && line.length() > 0) { String[][] parts = CommandParser.parseLine(line); if(parts.length > 0 && checkCommands(parts) == 0) { - // TODO add support for pipes CommandContext[] commands = new CommandContext[parts.length]; for (int i = 0; i < parts.length; i++) { String[] args = parts[i]; @@ -154,6 +102,10 @@ e.printStackTrace(err); } } + if (commands[0].getCommand() instanceof AsyncCommand) { + commands[0].setPID(pid++); + currentAsyncCommands.add(commands); + } } } } catch (IOException e) { @@ -209,4 +161,85 @@ } new Thread(this, "cmd").start(); } + + private void registerCommands() { + registerCommand("help", new Command() { + public int executeCommand(CommandContext context) { + if (context.getArgumentCount() == 0) { + context.out.println("Available commands:"); + for(Map.Entry entry: commands.entrySet()) { + String name = (String) entry.getKey(); + Command command = (Command) entry.getValue(); + CommandContext cc = new CommandContext(mapTable, new String[] { + name + }, 0, null, context.out, context.err); + String prefix = ' ' + name + ' ' + command.getArgumentHelp(cc); + String helpText = command.getCommandHelp(cc); + int n; + if (helpText != null && (n = helpText.indexOf('\n')) > 0) { + helpText = helpText.substring(0, n); + } + context.out.print(prefix); + if (prefix.length() < 8) { + context.out.print('\t'); + } + if (prefix.length() < 16) { + context.out.print('\t'); + } + context.out.println("\t " + helpText); + } + return 0; + } + + String cmd = context.getArgument(0); + Command command = commands.get(cmd); + if (command != null) { + CommandContext cc = new CommandContext(mapTable, new String[] { + cmd + }, 0, null, context.out, context.err); + context.out.println(cmd + ' ' + command.getArgumentHelp(cc)); + context.out.println(" " + command.getCommandHelp(cc)); + return 0; + } + context.err.println("Error: unknown command '" + cmd + '\''); + return 1; + } + public String getArgumentHelp(CommandContext context) { + return "<command>"; + } + public String getCommandHelp(CommandContext context) { + return "shows help for the specified command"; + } + }); + registerCommand("workaround", new BasicCommand("", "") { + public int executeCommand(CommandContext context) { + workaround = true; + return 0; + } + }); + + registerCommand("ps", new BasicCommand("list current executing commands", "") { + public int executeCommand(CommandContext context) { + for (int i = 0; i < currentAsyncCommands.size(); i++) { + CommandContext cmd = currentAsyncCommands.get(i)[0]; + System.out.println(" " + cmd.getPID() + " " + cmd.getCommandName()); + } + return 0; + } + }); + + registerCommand("kill", new BasicCommand("kill a current executing command", "") { + public int executeCommand(CommandContext context) { + int pid = context.getArgumentAsInt(0); + for (int i = 0; i < currentAsyncCommands.size(); i++) { + CommandContext cmd = currentAsyncCommands.get(i)[0]; + if (pid == cmd.getPID()) { + System.out.println("Should kill: " + cmd.getCommandName()); + } + } + return 0; + } + }); + } + } Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-09 20:22:31 UTC (rev 164) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-09 22:12:08 UTC (rev 165) @@ -55,10 +55,12 @@ final ELF elf = (ELF) registry.getComponent(ELF.class); final GenericNode node = (GenericNode) registry.getComponent("node"); if (cpu != null) { - ch.registerCommand("break", new Command() { + ch.registerCommand("break", new BasicAsyncCommand("adds a breakpoint to a given address or symbol", + "<address or symbol>") { + int address = 0; public int executeCommand(final CommandContext context) { int baddr = context.getArgumentAsAddress(0); - cpu.setBreakPoint(baddr, + cpu.setBreakPoint(address = baddr, new CPUMonitor() { public void cpuAction(int type, int adr, int data) { context.out.println("*** Break at " + adr); @@ -67,14 +69,9 @@ context.out.println("Breakpoint set at: " + baddr); return 0; } - - public String getArgumentHelp(CommandContext context) { - return "<address or symbol>"; + public void stopCommand(CommandContext context) { + cpu.clearBreakPoint(address); } - - public String getCommandHelp(CommandContext context) { - return "adds a breakpoint to a given address or symbol"; - } }); ch.registerCommand("watch", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-09 20:22:34
|
Revision: 164 http://mspsim.svn.sourceforge.net/mspsim/?rev=164&view=rev Author: joxe Date: 2008-03-09 13:22:31 -0700 (Sun, 09 Mar 2008) Log Message: ----------- implemented grep. Modified Paths: -------------- mspsim/se/sics/mspsim/cli/MiscCommands.java Modified: mspsim/se/sics/mspsim/cli/MiscCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-09 18:57:42 UTC (rev 163) +++ mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-09 20:22:31 UTC (rev 164) @@ -41,6 +41,7 @@ package se.sics.mspsim.cli; import java.io.PrintStream; +import java.util.regex.Pattern; import se.sics.mspsim.util.ComponentRegistry; @@ -53,15 +54,16 @@ public void setupCommands(ComponentRegistry registry, CommandHandler handler) { handler.registerCommand("grep", new BasicLineCommand("grep", "<regexp>") { private PrintStream out; + private Pattern pattern; public int executeCommand(CommandContext context) { out = context.out; + pattern = Pattern.compile(context.getArgument(0)); return 0; } - public void lineRead(String line) { - out.println("Grep: " + line); + if (pattern.matcher(line).find()) + out.println(line); } - public void stopCommand(CommandContext context) { context.exit(0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-09 18:57:57
|
Revision: 163 http://mspsim.svn.sourceforge.net/mspsim/?rev=163&view=rev Author: joxe Date: 2008-03-09 11:57:42 -0700 (Sun, 09 Mar 2008) Log Message: ----------- Fixed first working version of CLI pipes. Modified Paths: -------------- mspsim/se/sics/mspsim/cli/CommandContext.java mspsim/se/sics/mspsim/cli/CommandHandler.java Modified: mspsim/se/sics/mspsim/cli/CommandContext.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-09 17:36:36 UTC (rev 162) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-09 18:57:42 UTC (rev 163) @@ -12,19 +12,26 @@ private int pid; private Command command; - public final PrintStream out; - public final PrintStream err; + public PrintStream out; + public PrintStream err; - public CommandContext(MapTable table, String[] args, - int pid, Command command, PrintStream out, PrintStream err) { + public CommandContext(MapTable table, String[] args, int pid, Command command, PrintStream out, PrintStream err) { + this(table, args, pid, command); + setOutput(out, err); + } + + public CommandContext(MapTable table, String[] args, int pid, Command command) { this.args = args; - this.out = out; - this.err = err; this.pid = pid; mapTable = table; this.command = command; } + void setOutput(PrintStream out, PrintStream err) { + this.out = out; + this.err = err; + } + Command getCommand( ) { return command; } Modified: mspsim/se/sics/mspsim/cli/CommandHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 17:36:36 UTC (rev 162) +++ mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 18:57:42 UTC (rev 163) @@ -130,13 +130,25 @@ String[][] parts = CommandParser.parseLine(line); if(parts.length > 0 && checkCommands(parts) == 0) { // TODO add support for pipes - ArrayList<CommandContext> commandList = new ArrayList<CommandContext>(); + CommandContext[] commands = new CommandContext[parts.length]; for (int i = 0; i < parts.length; i++) { String[] args = parts[i]; Command cmd = getCommand(args[0]); - CommandContext cc = new CommandContext(mapTable, args, 0, cmd, out, err); + commands[i] = new CommandContext(mapTable, args, 0, cmd); + if (i > 0) { + PrintStream po = new PrintStream(new LineOutputStream((LineListener) commands[i].getCommand())); + commands[i - 1].setOutput(po, err); + } + // Last element also needs output! + if (i == parts.length - 1) { + commands[i].setOutput(out, err); + } + // TODO: Check if first command is also LineListener and set it up for input!! + } + // Execute when all is set-up in opposite order... + for (int i = parts.length - 1; i >= 0; i--) { try { - cmd.executeCommand(cc); + commands[i].getCommand().executeCommand(commands[i]); } catch (Exception e) { err.println("Error: Command failed: " + e.getMessage()); e.printStackTrace(err); @@ -162,7 +174,7 @@ } return null; } - + private int checkCommands(String[][] cmds) { for (int i = 0; i < cmds.length; i++) { Command command = commands.get(cmds[i][0]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-09 17:36:38
|
Revision: 162 http://mspsim.svn.sourceforge.net/mspsim/?rev=162&view=rev Author: joxe Date: 2008-03-09 10:36:36 -0700 (Sun, 09 Mar 2008) Log Message: ----------- made abstract class of Command - which implements cloneable Modified Paths: -------------- mspsim/se/sics/mspsim/cli/AsyncCommand.java mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java mspsim/se/sics/mspsim/cli/BasicCommand.java mspsim/se/sics/mspsim/cli/Command.java mspsim/se/sics/mspsim/cli/CommandContext.java mspsim/se/sics/mspsim/cli/CommandHandler.java mspsim/se/sics/mspsim/cli/DebugCommands.java Modified: mspsim/se/sics/mspsim/cli/AsyncCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/AsyncCommand.java 2008-03-09 14:36:02 UTC (rev 161) +++ mspsim/se/sics/mspsim/cli/AsyncCommand.java 2008-03-09 17:36:36 UTC (rev 162) @@ -45,6 +45,6 @@ * @author joakim * */ -public interface AsyncCommand extends Command { +public interface AsyncCommand { public void stopCommand(CommandContext context); } Modified: mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java 2008-03-09 14:36:02 UTC (rev 161) +++ mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java 2008-03-09 17:36:36 UTC (rev 162) @@ -44,8 +44,7 @@ * @author joakim * */ -public abstract class BasicAsyncCommand extends BasicCommand implements - AsyncCommand { +public abstract class BasicAsyncCommand extends BasicCommand implements AsyncCommand { public BasicAsyncCommand(String cmdHelp, String argHelp) { super(cmdHelp, argHelp); Modified: mspsim/se/sics/mspsim/cli/BasicCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicCommand.java 2008-03-09 14:36:02 UTC (rev 161) +++ mspsim/se/sics/mspsim/cli/BasicCommand.java 2008-03-09 17:36:36 UTC (rev 162) @@ -42,7 +42,7 @@ package se.sics.mspsim.cli; -public abstract class BasicCommand implements Command { +public abstract class BasicCommand extends Command { private String argumentHelp; private String commandHelp; @@ -59,5 +59,4 @@ public String getCommandHelp(CommandContext context) { return commandHelp; } - } Modified: mspsim/se/sics/mspsim/cli/Command.java =================================================================== --- mspsim/se/sics/mspsim/cli/Command.java 2008-03-09 14:36:02 UTC (rev 161) +++ mspsim/se/sics/mspsim/cli/Command.java 2008-03-09 17:36:36 UTC (rev 162) @@ -1,8 +1,12 @@ package se.sics.mspsim.cli; -public interface Command { - public int executeCommand(CommandContext context); - public String getCommandHelp(CommandContext context); - public String getArgumentHelp(CommandContext context); +public abstract class Command implements Cloneable { + public abstract int executeCommand(CommandContext context); + public abstract String getCommandHelp(CommandContext context); + public abstract String getArgumentHelp(CommandContext context); + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } } Modified: mspsim/se/sics/mspsim/cli/CommandContext.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-09 14:36:02 UTC (rev 161) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-09 17:36:36 UTC (rev 162) @@ -1,6 +1,5 @@ package se.sics.mspsim.cli; -import java.io.InputStream; import java.io.PrintStream; import se.sics.mspsim.util.MapTable; @@ -11,25 +10,29 @@ private String[] args; private MapTable mapTable; private int pid; + private Command command; public final PrintStream out; public final PrintStream err; - public final InputStream in; public CommandContext(MapTable table, String[] args, - int pid, InputStream in, PrintStream out, PrintStream err) { + int pid, Command command, PrintStream out, PrintStream err) { this.args = args; this.out = out; this.err = err; - this.in = in; this.pid = pid; mapTable = table; + this.command = command; } + Command getCommand( ) { + return command; + } + public int getPID() { return pid; } - + /** * exit needs to be called as soon as the command is completed (or stopped). * @param exitCode - the exit code of the command @@ -50,7 +53,7 @@ return mapTable; } - public String getCommand() { + public String getCommandName() { return args[0]; } Modified: mspsim/se/sics/mspsim/cli/CommandHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 14:36:02 UTC (rev 161) +++ mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-09 17:36:36 UTC (rev 162) @@ -6,6 +6,7 @@ import java.io.InputStreamReader; import java.io.InterruptedIOException; import java.io.PrintStream; +import java.util.ArrayList; import java.util.Hashtable; import java.util.Map; @@ -41,7 +42,7 @@ Command command = (Command) entry.getValue(); CommandContext cc = new CommandContext(mapTable, new String[] { name - }, 0, context.in, context.out, context.err); + }, 0, null, context.out, context.err); String prefix = ' ' + name + ' ' + command.getArgumentHelp(cc); String helpText = command.getCommandHelp(cc); int n; @@ -65,7 +66,7 @@ if (command != null) { CommandContext cc = new CommandContext(mapTable, new String[] { cmd - }, 0, context.in, context.out, context.err); + }, 0, null, context.out, context.err); context.out.println(cmd + ' ' + command.getArgumentHelp(cc)); context.out.println(" " + command.getCommandHelp(cc)); return 0; @@ -127,15 +128,13 @@ String line = readLine(inReader);//.readLine(); if (line != null && line.length() > 0) { String[][] parts = CommandParser.parseLine(line); - if(parts.length > 0) { - checkCommands(parts); + if(parts.length > 0 && checkCommands(parts) == 0) { // TODO add support for pipes - String[] args = parts[0]; - Command cmd = commands.get(args[0]); - if (cmd == null) { - out.println("Error: Unknown command " + args[0]); - } else { - CommandContext cc = new CommandContext(mapTable, args, 0, in, out, err); + ArrayList<CommandContext> commandList = new ArrayList<CommandContext>(); + for (int i = 0; i < parts.length; i++) { + String[] args = parts[i]; + Command cmd = getCommand(args[0]); + CommandContext cc = new CommandContext(mapTable, args, 0, cmd, out, err); try { cmd.executeCommand(cc); } catch (Exception e) { @@ -153,10 +152,25 @@ } } + // This will return an instance that can be configured - + // which is basically not OK... TODO - fix this!!! + private Command getCommand(String cmd) { + try { + return (Command) commands.get(cmd).clone(); + } catch (CloneNotSupportedException e) { + e.printStackTrace(); + } + return null; + } + private int checkCommands(String[][] cmds) { for (int i = 0; i < cmds.length; i++) { Command command = commands.get(cmds[i][0]); - if (i > 0 && command != null && !(command instanceof LineListener)) { + if (command == null) { + System.out.println("CLI: Command not found: " + cmds[i]); + return -1; + } + if (i > 0 && !(command instanceof LineListener)) { System.out.println("CLI: Error " + cmds[i][0] + " does not take input"); return -1; } Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-09 14:36:02 UTC (rev 161) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-09 17:36:36 UTC (rev 162) @@ -195,6 +195,7 @@ return 0; } }); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |