From: <jo...@us...> - 2008-04-16 13:31:28
|
Revision: 239 http://mspsim.svn.sourceforge.net/mspsim/?rev=239&view=rev Author: joxe Date: 2008-04-16 06:31:27 -0700 (Wed, 16 Apr 2008) Log Message: ----------- fixed the line sample chart to be an XYSeries chart. Modified Paths: -------------- mspsim/se/sics/mspsim/cli/WindowDataHandler.java mspsim/se/sics/mspsim/cli/WindowTarget.java mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java mspsim/se/sics/mspsim/util/NetworkConnection.java Added Paths: ----------- mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java Added: mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java (rev 0) +++ mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java 2008-04-16 13:31:27 UTC (rev 239) @@ -0,0 +1,67 @@ +/** + * 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: AsyncCommand.java 187 2008-03-17 19:34:12Z joxe $ + * + * ----------------------------------------------------------------- + * + * + * Author : Joakim Eriksson + * Created : 9 april 2008 + * Updated : $Date: 2008-03-17 20:34:12 +0100 (Mon, 17 Mar 2008) $ + * $Revision: 187 $ + */ +package se.sics.mspsim.cli; + +import javax.swing.JComponent; + +/** + * @author joakime + * + */ +public abstract class AbstractWindowDataHandler implements WindowDataHandler { + + @Override + public void handleCommand(String[] parts) { + String cmd = parts[0]; + if ("set".equals(cmd)) { + int index = atoi(parts[1]); + String[] args = new String[parts.length - 3]; + System.arraycopy(parts, 3, args, 0, args.length); + setProperty(index, parts[2], args); + } + } + + public abstract void setProperty(int index, String param, String[] args); + + public int atoi(String data) { + return Integer.parseInt(data); + } + +} Modified: mspsim/se/sics/mspsim/cli/WindowDataHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/WindowDataHandler.java 2008-04-16 13:26:40 UTC (rev 238) +++ mspsim/se/sics/mspsim/cli/WindowDataHandler.java 2008-04-16 13:31:27 UTC (rev 239) @@ -47,5 +47,6 @@ * */ public interface WindowDataHandler extends LineListener { - public JComponent getJComponent(); + public JComponent getComponent(); + public void handleCommand(String[] parts); } Modified: mspsim/se/sics/mspsim/cli/WindowTarget.java =================================================================== --- mspsim/se/sics/mspsim/cli/WindowTarget.java 2008-04-16 13:26:40 UTC (rev 238) +++ mspsim/se/sics/mspsim/cli/WindowTarget.java 2008-04-16 13:31:27 UTC (rev 239) @@ -9,13 +9,15 @@ private JFrame window; private String targetName; - private JTextArea jta = new JTextArea(20,20); + // Default in the current version - TODO: replace with better + private JTextArea jta = new JTextArea(40,40); private WindowDataHandler dataHandler = null; public WindowTarget(String name) { window = new JFrame(name); + window.getContentPane().add(jta); + window.pack(); window.setVisible(true); - window.getContentPane().add(jta); targetName = name; } @@ -24,6 +26,7 @@ // TODO Auto-generated method stub if (line != null && line.startsWith("#!")) { line = line.substring(2); + // TODO: replace with command parser String[] parts = line.split(" "); String cmd = parts[0]; if ("bounds".equals(cmd)) { @@ -42,8 +45,10 @@ if (dataHandler != null) { System.out.println("Replacing window data handler! " + parts[1] + " " + dataHandler); window.getContentPane().removeAll(); - window.getContentPane().add(dataHandler.getJComponent()); + window.getContentPane().add(dataHandler.getComponent()); } + } else if (dataHandler != null) { + dataHandler.handleCommand(parts); } } else { if (dataHandler != null) { Modified: mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java =================================================================== --- mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java 2008-04-16 13:26:40 UTC (rev 238) +++ mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java 2008-04-16 13:31:27 UTC (rev 239) @@ -3,37 +3,32 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; -import java.util.Date; - import javax.swing.JComponent; import javax.swing.JPanel; - import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; -import org.jfree.chart.axis.DateAxis; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.DefaultXYItemRenderer; -import org.jfree.data.time.Millisecond; -import org.jfree.data.time.TimeSeries; -import org.jfree.data.time.TimeSeriesCollection; +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; +import se.sics.mspsim.cli.AbstractWindowDataHandler; -import se.sics.mspsim.cli.WindowDataHandler; -public class LineSampleChart implements WindowDataHandler { +public class LineSampleChart extends AbstractWindowDataHandler { JPanel panel; - private TimeSeriesCollection dataset; - private TimeSeries timeSeries; + private XYSeriesCollection dataset; + private XYSeries dataSeries; public LineSampleChart() { - DateAxis domain = new DateAxis("Time"); + NumberAxis domain = new NumberAxis("Index"); NumberAxis range = new NumberAxis("Value"); XYPlot xyplot = new XYPlot(); xyplot.setDomainAxis(domain); xyplot.setRangeAxis(range); // xyplot.setBackgroundPaint(Color.black); - xyplot.setDataset(dataset = new TimeSeriesCollection()); + xyplot.setDataset(dataset = new XYSeriesCollection()); DefaultXYItemRenderer renderer = new DefaultXYItemRenderer(); renderer.setSeriesPaint(0, Color.black); @@ -54,23 +49,35 @@ panel.setPreferredSize(new Dimension(400, 200)); panel.add(chartPanel, BorderLayout.CENTER); - timeSeries = new TimeSeries("-", Millisecond.class); - timeSeries.setMaximumItemCount(200); - dataset.addSeries(timeSeries); + dataSeries = new XYSeries("-"); + dataSeries.setMaximumItemCount(200); + dataset.addSeries(dataSeries); } - public JComponent getJComponent() { + public JComponent getComponent() { return panel; } @Override public void lineRead(String line) { - System.out.println("Got line to: " + line); String parts[] = line.trim().split(" "); - timeSeries.clear(); + dataSeries.clear(); for (int i = 0; i < parts.length; i++) { - timeSeries.add(new Millisecond(new Date(i)), Integer.parseInt(parts[i])); + dataSeries.add(i, atoi(parts[i])); } panel.repaint(); } + + @Override + public void setProperty(int index, String param, String[] args) { + if (index != 0) { + throw new IndexOutOfBoundsException("Illegal index: " + index); + } + if ("label".equals(param)) { + System.out.println("setting label to: " + args[0]); + dataSeries.setKey(args[0]); + } + panel.repaint(); + } + } Modified: mspsim/se/sics/mspsim/util/NetworkConnection.java =================================================================== --- mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-04-16 13:26:40 UTC (rev 238) +++ mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-04-16 13:31:27 UTC (rev 239) @@ -103,7 +103,8 @@ } } - // Data incoming from the network!!! + // Data incoming from the network!!! - forward to radio and if server, to + // all other nodes private void dataReceived(byte[] data, int len, ConnectionThread source) { int[] buf = new int[len]; if (listener != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-04-16 16:44:14
|
Revision: 242 http://mspsim.svn.sourceforge.net/mspsim/?rev=242&view=rev Author: nifi Date: 2008-04-16 09:42:52 -0700 (Wed, 16 Apr 2008) Log Message: ----------- added defaultValue to atoi() instead of throwing exception for non-number arguments Modified Paths: -------------- mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java Modified: mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java 2008-04-16 13:42:34 UTC (rev 241) +++ mspsim/se/sics/mspsim/cli/AbstractWindowDataHandler.java 2008-04-16 16:42:52 UTC (rev 242) @@ -39,8 +39,6 @@ */ package se.sics.mspsim.cli; -import javax.swing.JComponent; - /** * @author joakime * @@ -51,17 +49,23 @@ public void handleCommand(String[] parts) { String cmd = parts[0]; if ("set".equals(cmd)) { - int index = atoi(parts[1]); + int index = atoi(parts[1], 0); String[] args = new String[parts.length - 3]; System.arraycopy(parts, 3, args, 0, args.length); setProperty(index, parts[2], args); + } else { + System.err.println("unknown command: " + cmd); } } - + public abstract void setProperty(int index, String param, String[] args); - - public int atoi(String data) { - return Integer.parseInt(data); + + public int atoi(String data, int defaultValue) { + try { + return Integer.parseInt(data); + } catch (NumberFormatException e) { + return defaultValue; + } } - + } Modified: mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java =================================================================== --- mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java 2008-04-16 13:42:34 UTC (rev 241) +++ mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java 2008-04-16 16:42:52 UTC (rev 242) @@ -63,7 +63,7 @@ String parts[] = line.trim().split(" "); dataSeries.clear(); for (int i = 0; i < parts.length; i++) { - dataSeries.add(i, atoi(parts[i])); + dataSeries.add(i, atoi(parts[i], 0)); } panel.repaint(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-04-17 08:40:39
|
Revision: 245 http://mspsim.svn.sourceforge.net/mspsim/?rev=245&view=rev Author: joxe Date: 2008-04-17 01:40:24 -0700 (Thu, 17 Apr 2008) Log Message: ----------- minor fix. Modified Paths: -------------- mspsim/se/sics/mspsim/core/ADC12.java mspsim/se/sics/mspsim/platform/esb/ESBGui.java Modified: mspsim/se/sics/mspsim/core/ADC12.java =================================================================== --- mspsim/se/sics/mspsim/core/ADC12.java 2008-04-17 00:23:19 UTC (rev 244) +++ mspsim/se/sics/mspsim/core/ADC12.java 2008-04-17 08:40:24 UTC (rev 245) @@ -206,9 +206,11 @@ int reg = address - ADC12MEM0; // Clear ifg! adc12ifg &= ~(1 << reg); - if (adc12iv == reg) { +// System.out.println("Read ADCMEM" + (reg / 2)); + if (adc12iv == reg + 6) { core.flagInterrupt(adc12Vector, this, false); adc12iv = 0; +// System.out.println("** de-Trigger ADC12 IRQ for ADCMEM" + adc12Pos); } return adc12mem[reg]; } @@ -228,6 +230,7 @@ adc12ifg |= (1 << adc12Pos); // This should check if there already is an hihger iv! adc12iv = adc12Pos * 2 + 6; +// System.out.println("** Trigger ADC12 IRQ for ADCMEM" + adc12Pos); core.flagInterrupt(adc12Vector, this, true); } // Increase Modified: mspsim/se/sics/mspsim/platform/esb/ESBGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-04-17 00:23:19 UTC (rev 244) +++ mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-04-17 08:40:24 UTC (rev 245) @@ -158,11 +158,11 @@ } } - byte[] data = new byte[2]; + byte[] data = new byte[4]; public int nextData() { - inDataLine.read(data, 0, 2); + inDataLine.read(data, 0, 4); //System.out.println("sampled: " + ((data[1] << 8) + data[0])); - return data[0]; + return (((data[1] & 0xff) << 8) | data[0] & 0xff) >> 4; } public void mouseMoved(MouseEvent e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-04-23 19:06:45
|
Revision: 258 http://mspsim.svn.sourceforge.net/mspsim/?rev=258&view=rev Author: joxe Date: 2008-04-23 12:06:13 -0700 (Wed, 23 Apr 2008) Log Message: ----------- fixed so that illegal write to WDTCTL resets MSPSim + fixed argument to reset method. Modified Paths: -------------- mspsim/se/sics/mspsim/cli/DebugCommands.java mspsim/se/sics/mspsim/core/IOPort.java mspsim/se/sics/mspsim/core/IOUnit.java mspsim/se/sics/mspsim/core/MSP430Constants.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/core/SFR.java mspsim/se/sics/mspsim/core/Timer.java mspsim/se/sics/mspsim/core/USART.java mspsim/se/sics/mspsim/core/Watchdog.java Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-04-23 19:06:13 UTC (rev 258) @@ -280,6 +280,17 @@ return 0; } }); + + ch.registerCommand("set", new BasicCommand("set memory", "<address> <value> [type]") { + public int executeCommand(final CommandContext context) { + int adr = context.getArgumentAsAddress(0); + int val = context.getArgumentAsInt(1); + boolean word = val > 0xff; + cpu.write(adr, val, word); + return 0; + }}); + + } Modified: mspsim/se/sics/mspsim/core/IOPort.java =================================================================== --- mspsim/se/sics/mspsim/core/IOPort.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/IOPort.java 2008-04-23 19:06:13 UTC (rev 258) @@ -200,7 +200,7 @@ } - public void reset() { + public void reset(int type) { for (int i = 0, n = 8; i < n; i++) { pinState[i] = PIN_LOW; } Modified: mspsim/se/sics/mspsim/core/IOUnit.java =================================================================== --- mspsim/se/sics/mspsim/core/IOUnit.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/IOUnit.java 2008-04-23 19:06:13 UTC (rev 258) @@ -51,7 +51,7 @@ this.offset = offset; } - public void reset() { + public void reset(int type) { } public boolean needsTick() { Modified: mspsim/se/sics/mspsim/core/MSP430Constants.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-04-23 19:06:13 UTC (rev 258) @@ -45,6 +45,9 @@ public static final String VERSION = "0.90"; + public static final int RESET_PUC = 0; + public static final int RESET_POR = 1; + // MODES public static final int MODE_ACTIVE = 0; public static final int MODE_LPM0 = 1; Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-23 19:06:13 UTC (rev 258) @@ -492,18 +492,15 @@ private void resetIOUnits() { for (int i = 0, n = lastIOUnitPos; i < n; i++) { - ioUnits[i].reset(); + ioUnits[i].reset(RESET_POR); } for (int i = 0, n = passiveIOUnits.length; i < n; i++) { - passiveIOUnits[i].reset(); + passiveIOUnits[i].reset(RESET_POR); } } - public void reset() { + private void internalReset() { resetIOUnits(); - reg[PC] = memory[0xfffe] + (memory[0xffff] << 8); - System.out.println("Reset the CPU: " + reg[PC]); - for (int i = 0, n = 16; i < n; i++) { interruptSource[i] = null; } @@ -514,8 +511,14 @@ cycleEventQueue.removeAll(); vTimeEventQueue.removeAll(); - } + + public void reset() { +// flagInterrupt(15, null, true); + reg[PC] = memory[0xfffe] + (memory[0xffff] << 8); + System.out.println("Reset the CPU: " + reg[PC]); + internalReset(); + } // Indicate that we have an interrupt now! // We should only get same IOUnit for same interrupt level @@ -527,8 +530,12 @@ System.out.println("### Interrupt flagged ON by " + source.getName()); } + // MAX priority is executed first - update max if this is higher! if (interrupt > interruptMax) { interruptMax = interrupt; + if (interruptMax == 15) { + System.out.println("Triggering reset IRQ!!!!!"); + } } } else { if (interruptSource[interrupt] == source) { @@ -648,6 +655,12 @@ // executed things might change! interruptMax = -1; + if (servicedInterrupt == 15) { + System.out.println("Servicing RESET! => " + Utils.hex16(pc)); + internalReset(); + } + + // Interrupts take 6 cycles! cycles += 6; Modified: mspsim/se/sics/mspsim/core/SFR.java =================================================================== --- mspsim/se/sics/mspsim/core/SFR.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/SFR.java 2008-04-23 19:06:13 UTC (rev 258) @@ -71,7 +71,7 @@ this.memory = memory; } - public void reset() { + public void reset(int type) { } public boolean needsTick() { Modified: mspsim/se/sics/mspsim/core/Timer.java =================================================================== --- mspsim/se/sics/mspsim/core/Timer.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/Timer.java 2008-04-23 19:06:13 UTC (rev 258) @@ -72,7 +72,6 @@ public class Timer extends IOUnit { public static final boolean DEBUG = false; - public static final int TIMER_A = 0; public static final int TIMER_B = 1; private String[] name = new String[] {"A", "B"}; @@ -235,10 +234,10 @@ ccr0Vector = type == TIMER_A ? TACCR0_VECTOR : TBCCR0_VECTOR; ccr1Vector = type == TIMER_A ? TACCR1_VECTOR : TBCCR1_VECTOR; - reset(); + reset(0); } - public void reset() { + public void reset(int type) { for (int i = 0, n = expCompare.length; i < n; i++) { expCompare[i] = -1; expCaptureTime[i] = -1; @@ -320,12 +319,15 @@ case TCCR6: i = (index - TCCR0) / 2; val = tccr[i]; + if (i == 2) { + System.out.println("Read CCR2: " + val); + } break; default: System.out.println("Not supported read, returning zero!!!"); } - if (DEBUG) { + if (DEBUG && false) { System.out.println(getName() + ": Read " + getName(address) + "(" + Utils.hex16(address) + ") => " + Utils.hex16(val) + " (" + val + ")"); } @@ -385,6 +387,7 @@ counter = 0; counterStart = cycles; // inputDivider = 1; ???? + updateCaptures(-1, cycles); } int newMode = (data >> 4) & 3; @@ -438,9 +441,9 @@ triggerInterrupts(); - if (DEBUG) { + if (DEBUG || index == 2) { System.out.println(getName() + " Write: CCTL" + - index + " => " + Utils.hex16(data) + + index + ": => " + Utils.hex16(data) + " CM: " + capNames[capMode[index]] + " CCIS:" + inputSel[index] + " name: " + getSourceName(inputSrc[index]) + @@ -521,7 +524,7 @@ if (DEBUG) { System.out.println(getName() + " expCapInterval[" + i + "] frq = " + - frqClk + " div = " + divisor); + frqClk + " div = " + divisor + " SMCLK_FRQ: " + core.smclkFrq); } // This is used to calculate expected time before next capture of @@ -611,6 +614,10 @@ // Write the expected capture time to the register (counter could // differ slightly) tccr[i] = expCompare[i]; + if (i == 2) { + updateCounter(cycles); + System.out.println("CCR2 set to: " + tccr[i] + " should be " + counter); + } // Update capture times... for next capture expCompare[i] = (expCompare[i] + expCapInterval[i]) & 0xffff; expCaptureTime[i] += expCapInterval[i] * cyclesMultiplicator; Modified: mspsim/se/sics/mspsim/core/USART.java =================================================================== --- mspsim/se/sics/mspsim/core/USART.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/USART.java 2008-04-23 19:06:13 UTC (rev 258) @@ -132,7 +132,7 @@ nextTXReady = cpu.cycles + 1000; } - public void reset() { + public void reset(int type) { nextTXReady = cpu.cycles + 1000; } Modified: mspsim/se/sics/mspsim/core/Watchdog.java =================================================================== --- mspsim/se/sics/mspsim/core/Watchdog.java 2008-04-22 19:04:23 UTC (rev 257) +++ mspsim/se/sics/mspsim/core/Watchdog.java 2008-04-23 19:06:13 UTC (rev 258) @@ -55,6 +55,7 @@ private static final int WDTSSEL = 0x04; private static final int WDTISx = 0x03; + private static final int RESET_VECTOR = 15; private int wdtctl; private boolean wdtOn = true; @@ -83,7 +84,7 @@ @Override public void interruptServiced(int vector) { // TODO Auto-generated method stub - + cpu.flagInterrupt(RESET_VECTOR, this, false); } private void triggerWDT(long time) { @@ -110,6 +111,7 @@ } else { // Trigger reset!! System.out.println("WDTCTL: illegal write - should reset!!!! " + value); + cpu.flagInterrupt(RESET_VECTOR, this, true); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-04-24 15:18:42
|
Revision: 263 http://mspsim.svn.sourceforge.net/mspsim/?rev=263&view=rev Author: nifi Date: 2008-04-24 08:18:03 -0700 (Thu, 24 Apr 2008) Log Message: ----------- added support for CC2420 TX_ACTIVE and SFD, remove CRC & RSSI from radio packets when using network connection Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-04-24 15:14:09 UTC (rev 262) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-04-24 15:18:03 UTC (rev 263) @@ -172,6 +172,9 @@ private IOPort fifoPort = null; private int fifoPin; + private IOPort sfdPort = null; + private int sfdPin; + private boolean rxPacket; private int rxCursor; private int rxLen; @@ -193,6 +196,8 @@ System.arraycopy(memory, RAM_TXFIFO + 1, data, 0, len); packetListener.transmissionEnded(data); } + status &= ~STATUS_TX_ACTIVE; + updateSFDPin(); } }; @@ -428,9 +433,11 @@ if (DEBUG) { System.out.println(getName() + " Transmitting " + len + " bytes => " + time + " sec"); } + status |= STATUS_TX_ACTIVE; + cpu.scheduleTimeEventMillis(transmissionEvent, 1000 * time); + updateSFDPin(); if (packetListener != null) { packetListener.transmissionStarted(); - cpu.scheduleTimeEventMillis(transmissionEvent, 1000 * time); memory[RAM_TXFIFO + len - 1] = 1; memory[RAM_TXFIFO + len - 0] = 2; } @@ -474,7 +481,12 @@ fifoPin = pin; } + public void setSFDPort(IOPort port, int pin) { + sfdPort = port; + sfdPin = pin; + } + // ------------------------------------------------------------------- // Methods for accessing and writing to registers, etc from outside // ------------------------------------------------------------------- @@ -489,11 +501,15 @@ // Length is not assumed to be and no CRC?! public void setIncomingPacket(int[] packet) { + setIncomingPacket(packet, 0, packet.length); + } + + public void setIncomingPacket(int[] packet, int start, int end) { int adr = RAM_RXFIFO; // length of packet is data size + RSSI and CRC/Correlation! - memory[adr++] = packet.length + 2; - for (int element : packet) { - memory[adr++] = element & 0xff; + memory[adr++] = end - start + 2; + for (int i = start; i < end; i++) { + memory[adr++] = packet[i] & 0xff; } // Should take a RSSI value as input or use a set-RSSI value... memory[adr++] = (registers[REG_RSSI]) & 0xff; @@ -526,6 +542,10 @@ fifopPort.setPinState(fifopPin, rxPacket ? 1 : 0); } + private void updateSFDPin() { + sfdPort.setPinState(sfdPin, (status & STATUS_TX_ACTIVE) != 0 ? 1 : 0); + } + public void setCCA(boolean cca) { ccaPort.setPinState(ccaPin, cca ? 1 : 0); } Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-04-24 15:14:09 UTC (rev 262) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-04-24 15:18:03 UTC (rev 263) @@ -83,8 +83,10 @@ public static final int CC2420_FIFO = 3; public static final int CC2420_CCA = 4; + /* P4.1 - Input: SFD from CC2420 */ /* P4.5 - Output: VREG_EN to CC2420 */ /* P4.2 - Output: SPI Chip Select (CS_N) */ + public static final int CC2420_SFD = 1; public static final int CC2420_VREG = (1 << 5); public static final int CC2420_CHIP_SELECT = 0x04; @@ -95,8 +97,8 @@ public CC2420 radio; public NetworkConnection network; - - + + private M25P80 flash; private String flashFile; @@ -216,7 +218,8 @@ ((USART) usart0).setUSARTListener(this); port4 = (IOPort) cpu.getIOUnit("Port 4"); if (port4 != null && port4 instanceof IOPort) { - (port4).setPortListener(this); + port4.setPortListener(this); + radio.setSFDPort(port4, CC2420_SFD); } } } @@ -256,7 +259,7 @@ network = new NetworkConnection(); network.addPacketListener(new PacketListener() { public void transmissionEnded(int[] receivedData) { - radio.setIncomingPacket(receivedData); + radio.setIncomingPacket(receivedData, 0, receivedData.length - 2); } public void transmissionStarted() { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-04-24 22:04:47
|
Revision: 265 http://mspsim.svn.sourceforge.net/mspsim/?rev=265&view=rev Author: nifi Date: 2008-04-24 15:04:23 -0700 (Thu, 24 Apr 2008) Log Message: ----------- CC2420 and packet radio API cleanup Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java mspsim/se/sics/mspsim/chip/PacketListener.java mspsim/se/sics/mspsim/platform/sky/SkyGui.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java mspsim/se/sics/mspsim/util/NetworkConnection.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-04-24 15:29:13 UTC (rev 264) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-04-24 22:04:23 UTC (rev 265) @@ -192,8 +192,10 @@ if (packetListener != null) { // First byte is length and is not included in the data buffer (and its length) int len = memory[RAM_TXFIFO]; - int[] data = new int[len]; - System.arraycopy(memory, RAM_TXFIFO + 1, data, 0, len); + byte[] data = new byte[len + 1]; + for (int i = 0, n = data.length; i < n; i++) { + data[i] = (byte) (memory[RAM_TXFIFO + i] & 0xff); + } packetListener.transmissionEnded(data); } status &= ~STATUS_TX_ACTIVE; @@ -500,21 +502,16 @@ } // Length is not assumed to be and no CRC?! - public void setIncomingPacket(int[] packet) { - setIncomingPacket(packet, 0, packet.length); - } - - public void setIncomingPacket(int[] packet, int start, int end) { + public void setIncomingPacket(byte[] receivedData) { int adr = RAM_RXFIFO; // length of packet is data size + RSSI and CRC/Correlation! - memory[adr++] = end - start + 2; - for (int i = start; i < end; i++) { - memory[adr++] = packet[i] & 0xff; + for (byte element: receivedData) { + memory[adr++] = element & 0xff; } // Should take a RSSI value as input or use a set-RSSI value... - memory[adr++] = (registers[REG_RSSI]) & 0xff; + memory[adr - 2] = (registers[REG_RSSI]) & 0xff; // Set CRC ok and add a correlation - memory[adr++] = (37) | 0x80; + memory[adr - 1] = 37 | 0x80; rxPacket = true; rxCursor = 0; rxLen = adr; Modified: mspsim/se/sics/mspsim/chip/PacketListener.java =================================================================== --- mspsim/se/sics/mspsim/chip/PacketListener.java 2008-04-24 15:29:13 UTC (rev 264) +++ mspsim/se/sics/mspsim/chip/PacketListener.java 2008-04-24 22:04:23 UTC (rev 265) @@ -40,5 +40,5 @@ public interface PacketListener { public void transmissionStarted(); - public void transmissionEnded(int[] receivedData); + public void transmissionEnded(byte[] receivedData); } Modified: mspsim/se/sics/mspsim/platform/sky/SkyGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2008-04-24 15:29:13 UTC (rev 264) +++ mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2008-04-24 22:04:23 UTC (rev 265) @@ -183,9 +183,6 @@ // System.out.println("Key Pressed: " + key.getKeyChar()); if (key.getKeyChar() == 'd') { node.setDebug(!node.getDebug()); - } else if (key.getKeyChar() == 'r') { - System.out.println("Setting incoming radio packet..."); - node.radioIncomingPacket(new int[] {11,0,42,0,'H','e','j','s','a','n'}); } } Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-04-24 15:29:13 UTC (rev 264) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-04-24 22:04:23 UTC (rev 265) @@ -176,11 +176,6 @@ flash.dataReceived(source, data); } - - public void radioIncomingPacket(int[] data) { - radio.setIncomingPacket(data); - } - public int getModeMax() { return MODE_MAX; } @@ -258,15 +253,15 @@ network = new NetworkConnection(); network.addPacketListener(new PacketListener() { - public void transmissionEnded(int[] receivedData) { - radio.setIncomingPacket(receivedData, 0, receivedData.length - 2); + public void transmissionEnded(byte[] receivedData) { + radio.setIncomingPacket(receivedData); } public void transmissionStarted() { } }); // TODO: remove this test... radio.setPacketListener(new PacketListener() { - public void transmissionEnded(int[] receivedData) { + public void transmissionEnded(byte[] receivedData) { // System.out.println(getName() + " got packet from radio " + SkyNode.this.cpu.getTimeMillis()); network.dataSent(receivedData); } Modified: mspsim/se/sics/mspsim/util/NetworkConnection.java =================================================================== --- mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-04-24 15:29:13 UTC (rev 264) +++ mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-04-24 22:04:23 UTC (rev 265) @@ -105,39 +105,30 @@ // Data incoming from the network!!! - forward to radio and if server, to // all other nodes - private void dataReceived(byte[] data, int len, ConnectionThread source) { - int[] buf = new int[len]; - for (int i = 0; i < buf.length; i++) { - buf[i] = data[i]; - } + private void dataReceived(byte[] data, ConnectionThread source) { if (listener != null) { // Send this data to the transmitter in this node! listener.transmissionStarted(); - listener.transmissionEnded(buf); + listener.transmissionEnded(data); } // And if this is the server, propagate to the others if (serverSocket != null) { - dataSent(buf, source); + dataSent(data, source); } } - private byte[] buf = new byte[256]; - // Data was sent from the radio in the node (or other node) and should // be sent out to other nodes!!! - public void dataSent(int[] data) { - dataSent(data, null); + public void dataSent(byte[] receivedData) { + dataSent(receivedData, null); } // Data was sent either from radio, or came from another "radio" - // and if so it should be propagated to all others. - public void dataSent(int[] data, ConnectionThread source) { + public void dataSent(byte[] receivedData, ConnectionThread source) { if (connections.size() > 0) { - for (int i = 0; i < data.length; i++) { - buf[i] = (byte) data[i]; - } ConnectionThread[] cthr = connections.toArray(new ConnectionThread[connections.size()]); for (int i = 0; i < cthr.length; i++) { if (cthr[i].isClosed()) { @@ -145,11 +136,10 @@ // Do not write back to the source } else if (cthr[i] != source){ try { - cthr[i].output.write((byte) data.length); - cthr[i].output.write(buf, 0, data.length); + cthr[i].output.write(receivedData, 0, receivedData.length); if (DEBUG) { - System.out.println("NetworkConnection: wrote " + data.length + " bytes"); - printPacket(buf, data.length); + System.out.println("NetworkConnection: wrote " + receivedData.length + " bytes"); + printPacket(receivedData); } } catch (IOException e) { e.printStackTrace(); @@ -160,8 +150,8 @@ } } - private void printPacket(byte[] data, int len) { - for (int i = 0; i < len; i++) { + private void printPacket(byte[] data) { + for (int i = 0, len = data.length; i < len; i++) { System.out.print(Utils.hex8(data[i]) + " "); } System.out.println(); @@ -184,8 +174,6 @@ } class ConnectionThread implements Runnable { - byte[] buffer = new byte[256]; - Socket socket; DataInputStream input; OutputStream output; @@ -216,15 +204,16 @@ if (DEBUG) System.out.println("NetworkConnection: Started connection thread..."); try { while (socket != null) { - int len; - len = input.read(); + int len = input.read(); if (len > 0) { - input.readFully(buffer, 0, len); + byte[] buffer = new byte[len + 1]; + buffer[0] = (byte) (len & 0xff); + input.readFully(buffer, 1, len); if (DEBUG) { System.out.println("NetworkConnection: Read packet with " + len + " bytes"); - printPacket(buffer, len); + printPacket(buffer); } - dataReceived(buffer, len, this); + dataReceived(buffer, this); } } } catch (IOException e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-05-07 16:25:20
|
Revision: 270 http://mspsim.svn.sourceforge.net/mspsim/?rev=270&view=rev Author: nifi Date: 2008-05-07 09:20:07 -0700 (Wed, 07 May 2008) Log Message: ----------- moved the mode handling to Chip and added getMode() Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java mspsim/se/sics/mspsim/chip/TR1001.java mspsim/se/sics/mspsim/core/Chip.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-05-07 16:16:15 UTC (rev 269) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-05-07 16:20:07 UTC (rev 270) @@ -124,7 +124,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; - public static final String[] MODE_NAMES = new String[] { + private static final String[] MODE_NAMES = new String[] { "off", "listen", "transmit" }; @@ -155,8 +155,6 @@ 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]; @@ -200,7 +198,7 @@ } status &= ~STATUS_TX_ACTIVE; updateSFDPin(); - if (mode == MODE_TXRX_ON) { + if (getMode() == MODE_TXRX_ON) { setMode(MODE_RX_ON); } } @@ -213,6 +211,7 @@ registers[REG_TXCTRL] = 0xa0ff; this.cpu = cpu; setModeNames(MODE_NAMES); + setMode(MODE_TXRX_OFF); } public void dataReceived(USART source, int data) { @@ -448,12 +447,6 @@ } } - private void setMode(int mode) { -// System.out.println(cpu.getTimeMillis() + ": MODE " + getModeName(mode)); - this.mode = mode; - modeChanged(mode); - } - public void setPacketListener(PacketListener listener) { packetListener = listener; } @@ -506,7 +499,7 @@ } public void setIncomingPacket(byte[] receivedData) { - if (mode != MODE_RX_ON) { + if (getMode() != MODE_RX_ON) { // System.out.println(cpu.getTimeMillis() + ": DROPPING"); } else if (rxPacket) { // Already have a waiting packet Modified: mspsim/se/sics/mspsim/chip/TR1001.java =================================================================== --- mspsim/se/sics/mspsim/chip/TR1001.java 2008-05-07 16:16:15 UTC (rev 269) +++ mspsim/se/sics/mspsim/chip/TR1001.java 2008-05-07 16:20:07 UTC (rev 270) @@ -54,7 +54,6 @@ public static final int MODE_MAX = MODE_TXRX_ON; private final USART usart; - private int mode; public TR1001(USART usart) { this.usart = usart; @@ -65,20 +64,17 @@ return "TR1001"; } + public void setMode(int mode) { + super.setMode(mode); + } + @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) { } - + } Modified: mspsim/se/sics/mspsim/core/Chip.java =================================================================== --- mspsim/se/sics/mspsim/core/Chip.java 2008-05-07 16:16:15 UTC (rev 269) +++ mspsim/se/sics/mspsim/core/Chip.java 2008-05-07 16:20:07 UTC (rev 270) @@ -39,8 +39,7 @@ * $Revision$ */ package se.sics.mspsim.core; -import java.util.ArrayList; -import java.util.Iterator; +import se.sics.mspsim.util.Utils; /** * @author Joakim @@ -48,40 +47,45 @@ */ public abstract class Chip { - private ArrayList<OperatingModeListener> omListeners; + private OperatingModeListener[] omListeners; private String[] modeNames = null; + private int mode; public void addOperatingModeListener(OperatingModeListener listener) { - if (omListeners == null) - omListeners = new ArrayList<OperatingModeListener>(); - omListeners.add(listener); + omListeners = (OperatingModeListener[]) Utils.add(OperatingModeListener.class, omListeners, listener); } public void removeOperatingModeListener(OperatingModeListener listener) { - if (omListeners != null) - omListeners.remove(listener); + omListeners = (OperatingModeListener[]) Utils.remove(omListeners, listener); } - - protected void modeChanged(int mode) { - if (omListeners != null) { - for (Iterator<OperatingModeListener> iterator = omListeners.iterator(); iterator.hasNext();) { - OperatingModeListener type = iterator.next(); - type.modeChanged(this, mode); + + public int getMode() { + return mode; + } + + protected void setMode(int mode) { + if (mode != this.mode) { + this.mode = mode; + OperatingModeListener[] listeners = omListeners; + if (listeners != null) { + for (int i = 0, n = listeners.length; i < n; i++) { + listeners[i].modeChanged(this, mode); + } } } } - + protected void setModeNames(String[] names) { modeNames = names; } - + public String getModeName(int index) { if (modeNames == null) { return null; } return modeNames[index]; } - + public int getModeByName(String mode) { if (modeNames != null) { for (int i = 0; i < modeNames.length; i++) { @@ -90,14 +94,13 @@ } try { // If it is just an int it can be parsed! - System.out.println("Parsing as int: " + mode); int modei = Integer.parseInt(mode); return modei; } catch (Exception e) { } return -1; } - + public abstract String getName(); public abstract int getModeMax(); } Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-05-07 16:16:15 UTC (rev 269) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-05-07 16:20:07 UTC (rev 270) @@ -296,18 +296,18 @@ boolean scg1 = (value & SCG1) == SCG1; boolean oscoff = (value & OSCOFF) == OSCOFF; if (oscoff && scg1 && scg0) { - modeChanged(MODE_LPM4); + setMode(MODE_LPM4); } else if (scg1 && scg0){ - modeChanged(MODE_LPM3); + setMode(MODE_LPM3); } else if (scg1) { - modeChanged(MODE_LPM2); + setMode(MODE_LPM2); } else if (scg0) { - modeChanged(MODE_LPM1); + setMode(MODE_LPM1); } else { - modeChanged(MODE_LPM0); + setMode(MODE_LPM0); } } else { - modeChanged(MODE_ACTIVE); + setMode(MODE_ACTIVE); } } } Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-05-07 16:16:15 UTC (rev 269) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-05-07 16:20:07 UTC (rev 270) @@ -55,7 +55,6 @@ import se.sics.mspsim.extutil.jfreechart.DataChart; import se.sics.mspsim.extutil.jfreechart.DataSourceSampler; import se.sics.mspsim.platform.GenericNode; -//import se.sics.mspsim.util.ArgumentManager; import se.sics.mspsim.util.ArgumentManager; import se.sics.mspsim.util.ELF; import se.sics.mspsim.util.NetworkConnection; @@ -109,7 +108,6 @@ public boolean redLed; public boolean blueLed; public boolean greenLed; - private int mode = MODE_LEDS_OFF; public SkyGui gui; /** @@ -117,6 +115,7 @@ * */ public SkyNode() { + setMode(MODE_LEDS_OFF); } public void setButton(boolean hi) { @@ -153,10 +152,7 @@ blueLed = (data & BLUE_LED) == 0; greenLed = (data & GREEN_LED) == 0; int newMode = (redLed ? 1 : 0) + (greenLed ? 1 : 0) + (blueLed ? 1 : 0); - if (mode != newMode) { - mode = newMode; - modeChanged(mode); - } + setMode(newMode); if (gui != null) { gui.repaint(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2008-05-12 17:23:47
|
Revision: 279 http://mspsim.svn.sourceforge.net/mspsim/?rev=279&view=rev Author: nifi Date: 2008-05-12 10:23:29 -0700 (Mon, 12 May 2008) Log Message: ----------- Added profiler commands to access profiler data from CLI. Modified Paths: -------------- mspsim/se/sics/mspsim/core/Profiler.java mspsim/se/sics/mspsim/platform/GenericNode.java mspsim/se/sics/mspsim/ui/ControlUI.java mspsim/se/sics/mspsim/util/SimpleProfiler.java mspsim/se/sics/mspsim/util/Test.java Added Paths: ----------- mspsim/se/sics/mspsim/cli/ProfilerCommands.java Added: mspsim/se/sics/mspsim/cli/ProfilerCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/ProfilerCommands.java (rev 0) +++ mspsim/se/sics/mspsim/cli/ProfilerCommands.java 2008-05-12 17:23:29 UTC (rev 279) @@ -0,0 +1,99 @@ +/* + * 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. + * + * $Id$ + * + * ----------------------------------------------------------------- + * + * ProfilerCommands + * + * Authors : Joakim Eriksson, Niclas Finne + * Created : 12 maj 2008 + * Updated : $Date$ + * $Revision$ + */ + +package se.sics.mspsim.cli; +import se.sics.mspsim.core.MSP430; +import se.sics.mspsim.core.Profiler; +import se.sics.mspsim.util.ComponentRegistry; + +/** + * + */ +public class ProfilerCommands implements CommandBundle { + + public void setupCommands(ComponentRegistry registry, CommandHandler ch) { + final MSP430 cpu = (MSP430) registry.getComponent(MSP430.class); + if (cpu != null) { + ch.registerCommand("profiler", new BasicCommand("show profile information", + "[-clear] [regexp]") { + + @Override + public int executeCommand(final CommandContext context) { + Profiler profiler = cpu.getProfiler(); + if (profiler == null) { + context.err.println("No profiler found."); + return 1; + } + if (context.getArgumentCount() > 1) { + context.err.println("Too many arguments. Either clear or show profile information."); + return 1; + } + String namematch = null; + if (context.getArgumentCount() > 0) { + namematch = context.getArgument(0); + if ("-clear".equals(namematch)) { + profiler.clearProfile(); + context.out.println("Cleared profile information."); + return 0; + } + } + profiler.printProfile(context.out, namematch); + return 0; + } + + }); + ch.registerCommand("stacktrace", new BasicCommand("show stack trace", "") { + + @Override + public int executeCommand(CommandContext context) { + Profiler profiler = cpu.getProfiler(); + if (profiler == null) { + context.err.println("No profiler found."); + return 1; + } + profiler.printStackTrace(context.out); + return 0; + } + + }); + } + } + +} Property changes on: mspsim/se/sics/mspsim/cli/ProfilerCommands.java ___________________________________________________________________ Name: svn:keywords + Rev Date Id Name: svn:eol-style + LF Modified: mspsim/se/sics/mspsim/core/Profiler.java =================================================================== --- mspsim/se/sics/mspsim/core/Profiler.java 2008-05-12 17:19:50 UTC (rev 278) +++ mspsim/se/sics/mspsim/core/Profiler.java 2008-05-12 17:23:29 UTC (rev 279) @@ -40,19 +40,22 @@ */ package se.sics.mspsim.core; +import java.io.PrintStream; import se.sics.mspsim.util.MapEntry; public interface Profiler { public void setCPU(MSP430Core cpu); - + public void profileCall(MapEntry entry, long cycles); public void profileReturn(long cycles); public void clearProfile(); - public void printProfile(); + public void printProfile(PrintStream out); - public void printStackTrace(); - + public void printProfile(PrintStream out, String functionNameRegexp); + + public void printStackTrace(PrintStream out); + } Modified: mspsim/se/sics/mspsim/platform/GenericNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/GenericNode.java 2008-05-12 17:19:50 UTC (rev 278) +++ mspsim/se/sics/mspsim/platform/GenericNode.java 2008-05-12 17:23:29 UTC (rev 279) @@ -43,6 +43,7 @@ import se.sics.mspsim.cli.CommandHandler; import se.sics.mspsim.cli.DebugCommands; import se.sics.mspsim.cli.MiscCommands; +import se.sics.mspsim.cli.ProfilerCommands; import se.sics.mspsim.cli.WindowCommands; import se.sics.mspsim.core.Chip; import se.sics.mspsim.core.MSP430; @@ -88,9 +89,10 @@ registry.registerComponent("misccmd", new MiscCommands()); registry.registerComponent("statcmd", new StatCommands(cpu, stats)); registry.registerComponent("wincmd", new WindowCommands()); + registry.registerComponent("profilecmd", new ProfilerCommands()); registry.registerComponent("node", this); registry.registerComponent("config", config); - + // Monitor execution cpu.setMonitorExec(true); //cpu.setDebug(true); Modified: mspsim/se/sics/mspsim/ui/ControlUI.java =================================================================== --- mspsim/se/sics/mspsim/ui/ControlUI.java 2008-05-12 17:19:50 UTC (rev 278) +++ mspsim/se/sics/mspsim/ui/ControlUI.java 2008-05-12 17:23:29 UTC (rev 279) @@ -188,7 +188,7 @@ } else if ("Profile Dump".equals(cmd)) { if (cpu.getProfiler() != null) { - cpu.getProfiler().printProfile(); + cpu.getProfiler().printProfile(System.out); } else { System.out.println("*** No profiler available"); } @@ -214,7 +214,7 @@ } } } else if ("Stack Trace".equals(cmd)) { - cpu.getProfiler().printStackTrace(); + cpu.getProfiler().printStackTrace(System.out); } dui.updateRegs(); } Modified: mspsim/se/sics/mspsim/util/SimpleProfiler.java =================================================================== --- mspsim/se/sics/mspsim/util/SimpleProfiler.java 2008-05-12 17:19:50 UTC (rev 278) +++ mspsim/se/sics/mspsim/util/SimpleProfiler.java 2008-05-12 17:23:29 UTC (rev 279) @@ -42,8 +42,10 @@ package se.sics.mspsim.util; import se.sics.mspsim.core.MSP430Core; import se.sics.mspsim.core.Profiler; +import java.io.PrintStream; import java.util.Arrays; import java.util.Hashtable; +import java.util.regex.Pattern; public class SimpleProfiler implements Profiler { @@ -61,7 +63,7 @@ public void setCPU(MSP430Core cpu) { this.cpu = cpu; } - + public void profileCall(MapEntry entry, long cycles) { // System.out.println("Call at: " + Utils.hex16(reg[PC])); if (callStack[cSP] == null) { @@ -91,7 +93,7 @@ public void clearProfile() { if (profileData != null) { CallEntry[] entries = - profileData.values().toArray(new CallEntry[0]); + profileData.values().toArray(new CallEntry[profileData.size()]); for (int i = 0, n = entries.length; i < n; i++) { entries[i].cycles = 0; entries[i].calls = 0; @@ -105,47 +107,56 @@ } } - public void printProfile() { - CallEntry[] entries = - profileData.values().toArray(new CallEntry[0]); + public void printProfile(PrintStream out) { + printProfile(out, null); + } + + public void printProfile(PrintStream out, String functionNameRegexp) { + Pattern pattern = null; + CallEntry[] entries = profileData.values().toArray(new CallEntry[profileData.size()]); Arrays.sort(entries); - System.out.println("************************* Profile Data **************************************"); - System.out.println("Function Average Calls Tot.Cycles"); + out.println("************************* Profile Data **************************************"); + out.println("Function Average Calls Tot.Cycles"); - + if (functionNameRegexp != null && functionNameRegexp.length() > 0) { + pattern = Pattern.compile(functionNameRegexp); + } for (int i = 0, n = entries.length; i < n; i++) { int c = entries[i].calls; if (c > 0) { - String cyclesS = "" + entries[i].cycles; - String callS = "" + c; - String avgS = "" + (c > 0 ? (entries[i].cycles / c) : 0); - System.out.print(entries[i].function.getName()); - printSpace(56 - entries[i].function.getName().length() - avgS.length()); - System.out.print(avgS); - System.out.print(' '); - printSpace(8 - callS.length()); - System.out.print(callS); - System.out.print(' '); - printSpace(10 - cyclesS.length()); - System.out.println(cyclesS); + String functionName = entries[i].function.getName(); + if (pattern == null || pattern.matcher(functionName).find()) { + String cyclesS = "" + entries[i].cycles; + String callS = "" + c; + String avgS = "" + (c > 0 ? (entries[i].cycles / c) : 0); + out.print(functionName); + printSpace(out, 56 - functionName.length() - avgS.length()); + out.print(avgS); + out.print(' '); + printSpace(out, 8 - callS.length()); + out.print(callS); + out.print(' '); + printSpace(out, 10 - cyclesS.length()); + out.println(cyclesS); + } } } } - private void printSpace(int len) { + private void printSpace(PrintStream out, int len) { for (int i = 0; i < len; i++) { - System.out.print(' '); + out.print(' '); } } - public void printStackTrace() { - System.out.println("Stack Trace: number of calls: " + cSP); + public void printStackTrace(PrintStream out) { + out.println("Stack Trace: number of calls: " + cSP); for (int i = 0; i < cSP; i++) { - System.out.println(" " + callStack[cSP - i - 1].function.getInfo()); + out.println(" " + callStack[cSP - i - 1].function.getInfo()); } } - + private static class CallEntry implements Comparable<CallEntry> { MapEntry function; long cycles; Modified: mspsim/se/sics/mspsim/util/Test.java =================================================================== --- mspsim/se/sics/mspsim/util/Test.java 2008-05-12 17:19:50 UTC (rev 278) +++ mspsim/se/sics/mspsim/util/Test.java 2008-05-12 17:23:29 UTC (rev 279) @@ -73,7 +73,7 @@ } else if (line.startsWith("DEBUG")) { cpu.setDebug(true); } else if (line.startsWith("PROFILE")) { - cpu.getProfiler().printProfile(); + cpu.getProfiler().printProfile(System.out); } else if (line.startsWith("CLEARPROFILE")) { cpu.getProfiler().clearProfile(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-07-04 06:07:50
|
Revision: 289 http://mspsim.svn.sourceforge.net/mspsim/?rev=289&view=rev Author: joxe Date: 2008-07-03 23:07:31 -0700 (Thu, 03 Jul 2008) Log Message: ----------- fixed bug with missed cycles on some instructions Modified Paths: -------------- mspsim/se/sics/mspsim/cli/DebugCommands.java mspsim/se/sics/mspsim/core/MSP430.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/platform/GenericNode.java Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-06-11 21:59:07 UTC (rev 288) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-07-04 06:07:31 UTC (rev 289) @@ -39,6 +39,8 @@ * $Revision$ */ package se.sics.mspsim.cli; +import javax.swing.MenuSelectionManager; + import se.sics.mspsim.core.CPUMonitor; import se.sics.mspsim.core.MSP430; import se.sics.mspsim.core.MSP430Constants; @@ -78,7 +80,7 @@ }); ch.registerCommand("watch", - new BasicAsyncCommand("add a write watch to a given address or symbol", "<address or symbol>") { + new BasicAsyncCommand("add a write/read watch to a given address or symbol", "<address or symbol> [char | break]") { int mode = 0; int address = 0; public int executeCommand(final CommandContext context) { @@ -91,17 +93,28 @@ String modeStr = context.getArgument(1); if ("char".equals(modeStr)) { mode = 1; + } else if ("break".equals(modeStr)) { + mode = 2; } } cpu.setBreakPoint(address = baddr, new CPUMonitor() { public void cpuAction(int type, int adr, int data) { - if (mode == 0) { + if (mode == 0 || mode == 2) { int pc = cpu.readRegister(0); String adrStr = getSymOrAddr(context, adr); String pcStr = getSymOrAddrELF(elf, pc); - context.out.println("*** Write from " + pcStr + + String op = "op"; + if (type == MEMORY_READ) { + op = "Read"; + } else if (type == MEMORY_WRITE){ + op = "Write"; + } + context.out.println("*** " + op + " from " + pcStr + ": " + adrStr + " = " + data); + if (mode == 2) { + cpu.stop(); + } } else { context.out.print((char) data); } @@ -205,9 +218,10 @@ ch.registerCommand("step", new BasicCommand("singlestep the CPU", "[number of instructions]") { public int executeCommand(CommandContext context) { int nr = context.getArgumentCount() > 0 ? context.getArgumentAsInt(0) : 1; - while(nr-- > 0) - node.step(); - context.out.println("CPU stepped to: $" + Utils.hex16(cpu.readRegister(0))); + long cyc = cpu.cycles; + node.step(nr); + context.out.println("CPU stepped to: $" + Utils.hex16(cpu.readRegister(0)) + + " in " + (cpu.cycles - cyc) + " cycles (" + cpu.cycles + ")"); return 0; } }); Modified: mspsim/se/sics/mspsim/core/MSP430.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430.java 2008-06-11 21:59:07 UTC (rev 288) +++ mspsim/se/sics/mspsim/core/MSP430.java 2008-07-04 06:07:31 UTC (rev 289) @@ -153,6 +153,49 @@ return step(0); } + public long stepInstructions(int count) { + if (isRunning()) { + throw new IllegalStateException("step not possible when CPU is running"); + } + setRunning(true); + // ------------------------------------------------------------------- + // Debug information + // ------------------------------------------------------------------- + + + while (count-- > 0 && isRunning()) { + if (debug) { + if (servicedInterrupt >= 0) { + disAsm.disassemble(reg[PC], memory, reg, servicedInterrupt); + } else { + disAsm.disassemble(reg[PC], memory, reg); + } + } + + boolean emuOP = emulateOP(); + if (emuOP) { + if (execCounter != null) { + execCounter[reg[PC]]++; + } + + if (profiler != null) { + if ((instruction & 0xff80) == CALL) { + /* The profiling should only be made on actual cpuCycles */ + MapEntry function = map.getEntry(reg[PC]); + if (function == null) { + function = getFunction(map, reg[PC]); + } + profiler.profileCall(function, cpuCycles); + } else if (instruction == RETURN) { + profiler.profileReturn(cpuCycles); + } + } + } + } + setRunning(false); + return cycles; + } + public long step(long max_cycles) { if (isRunning()) { throw new IllegalStateException("step not possible when CPU is running"); Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-06-11 21:59:07 UTC (rev 288) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-07-04 06:07:31 UTC (rev 289) @@ -48,7 +48,7 @@ public class MSP430Core extends Chip implements MSP430Constants { public static final boolean DEBUG = false; - public static final boolean debugInterrupts = false; + public static final boolean debugInterrupts = true; //false; // Try it out with 64 k memory public static final int MAX_MEM = 64*1024; @@ -528,7 +528,11 @@ interruptSource[interrupt] = source; if (debugInterrupts) { - System.out.println("### Interrupt flagged ON by " + source.getName()); + if (source != null) { + System.out.println("### Interrupt flagged ON by " + source.getName()); + } else { + System.out.println("### Interrupt flagged ON by <null>"); + } } // MAX priority is executed first - update max if this is higher! @@ -594,9 +598,6 @@ // Read method that handles read from IO units! public int read(int address, boolean word) { int val = 0; -// if (breakPoints[address] != null) { -// breakPoints[address].call -// } // Only word reads at 0x1fe which is highest address... if (address < 0x1ff && memIn[address] != null) { val = memIn[address].read(address, word, cycles); @@ -607,6 +608,9 @@ val |= (memory[(address + 1) & 0xffff] << 8); } } + if (breakPoints[address] != null) { + breakPoints[address].cpuAction(CPUMonitor.MEMORY_READ, address, val); + } return val; } @@ -693,6 +697,7 @@ /* returns true if any instruction was emulated - false if CpuOff */ public boolean emulateOP() { + //System.out.println("CYCLES BEFORE: " + cycles); int pc = readRegister(PC); long startCycles = cycles; @@ -726,7 +731,7 @@ } // This is quite costly... should probably be made more - // efficiently (maybe in CORE where PC is read anyway?) + // efficiently if (breakPoints[pc] != null) { if (breakpointActive) { breakPoints[pc].cpuAction(CPUMonitor.BREAK, pc, 0); @@ -929,8 +934,8 @@ 2 * jmpOffset : -(2 * (0x200 - (jmpOffset & 0x1ff))); boolean jump = false; - // All jump takes one extra cycle - cycles++; + // All jump takes two cycles + cycles += 2; sr = readRegister(SR); switch(instruction & 0xfc00) { case JNE: @@ -986,7 +991,7 @@ if (!word) { src &= 0xff; } - + cycles += dstRegMode ? 1 : 4; } else { switch(as) { // Operand in register! @@ -996,6 +1001,7 @@ if (!word) { src &= 0xff; } + cycles += dstRegMode ? 1 : 4; break; case AM_INDEX: // Indexed if reg != PC & CG1/CG2 - will PC be incremented? @@ -1188,6 +1194,8 @@ writeRegister(SR, sr); } + //System.out.println("CYCLES AFTER: " + cycles); + cpuCycles += cycles - startCycles; return true; } Modified: mspsim/se/sics/mspsim/platform/GenericNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/GenericNode.java 2008-06-11 21:59:07 UTC (rev 288) +++ mspsim/se/sics/mspsim/platform/GenericNode.java 2008-07-04 06:07:31 UTC (rev 289) @@ -159,4 +159,12 @@ cpu.step(); } } + + // A step that will break out of breakpoints! + public void step(int nr) { + if (!cpu.isRunning()) { + cpu.stepInstructions(nr); + } + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-02-13 18:10:02
|
Revision: 128 http://mspsim.svn.sourceforge.net/mspsim/?rev=128&view=rev Author: joxe Date: 2008-02-13 10:10:00 -0800 (Wed, 13 Feb 2008) Log Message: ----------- fixed bug that caused CC2420 to be on without VREG active. Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java mspsim/se/sics/mspsim/util/DebugInfo.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-02-12 23:09:18 UTC (rev 127) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-02-13 18:10:00 UTC (rev 128) @@ -177,7 +177,7 @@ private TimeEvent transmissionEvent = new TimeEvent(0) { public void execute(long t) { - 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]; @@ -186,6 +186,8 @@ } } }; + + private boolean on; public CC2420(MSP430Core cpu) { registers[REG_SNOP] = 0; @@ -193,7 +195,7 @@ } public void dataReceived(USART source, int data) { - if (chipSelect) { + if (on && chipSelect) { if (DEBUG) System.out.println("CC2420 byte received: " + Utils.hex8(data) + '\'' + (char) data + '\'' + @@ -297,20 +299,20 @@ switch (data) { case REG_SRXON: -// System.out.println("CC2420: Strobe RX-ON!!!"); + if (DEBUG) System.out.println("CC2420: Strobe RX-ON!!!"); setMode(MODE_RX_ON); break; case REG_SRFOFF: -// System.out.println("CC2420: Strobe RXTX-OFF!!!"); + if (DEBUG) System.out.println("CC2420: Strobe RXTX-OFF!!!"); setMode(MODE_TXRX_OFF); break; case REG_STXON: -// System.out.println("CC2420: Strobe TXON!"); + if (DEBUG) System.out.println("CC2420: Strobe TXON!"); setMode(MODE_TXRX_ON); transmitPacket(); break; case REG_STXONCCA: -// System.out.println("CC2420: Strobe TXONCCA!"); + if (DEBUG) System.out.println("CC2420: Strobe TXONCCA!"); setMode(MODE_TXRX_ON); transmitPacket(); break; @@ -327,7 +329,7 @@ int len = memory[RAM_TXFIFO]; int kBps = 250000 / 8; double time = 1.0 * len / kBps; - 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); @@ -343,11 +345,16 @@ packetListener = listener; } + public void setVRegOn(boolean on) { + this.on = on; + } + public void setChipSelect(boolean select) { chipSelect = select; if (!chipSelect) state = WAITING; -// System.out.println("CC2420: chipSelect: " + chipSelect); + if (DEBUG) + System.out.println("CC2420: setting chipSelect: " + chipSelect); } public void setCCAPort(IOPort port, int pin) { Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-02-12 23:09:18 UTC (rev 127) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-02-13 18:10:00 UTC (rev 128) @@ -43,9 +43,12 @@ import java.io.File; import java.io.IOException; +import com.sun.org.apache.bcel.internal.generic.BREAKPOINT; + import se.sics.mspsim.chip.CC2420; import se.sics.mspsim.chip.M25P80; import se.sics.mspsim.chip.PacketListener; +import se.sics.mspsim.core.CPUMonitor; import se.sics.mspsim.core.Chip; import se.sics.mspsim.core.IOPort; import se.sics.mspsim.core.IOUnit; @@ -80,14 +83,18 @@ // Port 2. public static final int BUTTON_PIN = 7; - public static final int CC2420_CHIP_SELECT = 0x04; /* P1.0 - Input: FIFOP from CC2420 */ /* P1.3 - Input: FIFO from CC2420 */ /* P1.4 - Input: CCA from CC2420 */ 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 MSP430 cpu; private IOPort port1; private IOPort port2; @@ -97,6 +104,7 @@ private CC2420 radio; private M25P80 flash; private String flashFile; + private ELF elf; public static final int BLUE_LED = 0x40; public static final int GREEN_LED = 0x20; @@ -170,6 +178,14 @@ } }); + // UART0 TXreg = 0x77? +// cpu.setBreakPoint(0x77, new CPUMonitor() { +// public void cpuAction(int type, int adr, int data) { +// System.out.println("Write to USART0 TX: " + data + " at " + +// SkyNode.this.elf.getDebugInfo(SkyNode.this.cpu.readRegister(0))); +// } +// }); + } public void setButton(boolean hi) { @@ -207,6 +223,7 @@ } else if (source == port4) { // Chip select = active low... radio.setChipSelect((data & CC2420_CHIP_SELECT) == 0); + radio.setVRegOn((data & CC2420_VREG) != 0); //radio.portWrite(source, data); flash.portWrite(source, data); } @@ -261,7 +278,7 @@ MapTable map = elf.getMap(); cpu.getDisAsm().setMap(map); cpu.setMap(map); - registry.registerComponent("mapTable", map); + registry.registerComponent("mapTable", map); } // create a filename for the flash file @@ -276,6 +293,7 @@ cpu.reset(); SkyNode node = new SkyNode(cpu, fileName); + node.elf = elf; node.gui = new SkyGui(node); ControlUI control = new ControlUI(cpu, elf); HighlightSourceViewer sourceViewer = new HighlightSourceViewer(); Modified: mspsim/se/sics/mspsim/util/DebugInfo.java =================================================================== --- mspsim/se/sics/mspsim/util/DebugInfo.java 2008-02-12 23:09:18 UTC (rev 127) +++ mspsim/se/sics/mspsim/util/DebugInfo.java 2008-02-13 18:10:00 UTC (rev 128) @@ -69,5 +69,9 @@ public int getLine() { return lineNo; } + + public String toString() { + return "Line: " + lineNo + " in file: " + file + " (function: " + function + ")"; + } } // DebugInfo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-02-18 20:06:04
|
Revision: 135 http://mspsim.svn.sourceforge.net/mspsim/?rev=135&view=rev Author: joxe Date: 2008-02-18 12:05:45 -0800 (Mon, 18 Feb 2008) Log Message: ----------- moved some code of platform node setup into generic node class. Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/extutil/jfreechart/DataChart.java mspsim/se/sics/mspsim/extutil/jfreechart/DataSourceSampler.java mspsim/se/sics/mspsim/platform/esb/ESBNode.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java mspsim/se/sics/mspsim/ui/ControlUI.java Added Paths: ----------- mspsim/se/sics/mspsim/platform/GenericNode.java Modified: mspsim/se/sics/mspsim/core/MSP430.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430.java 2008-02-16 10:11:57 UTC (rev 134) +++ mspsim/se/sics/mspsim/core/MSP430.java 2008-02-18 20:05:45 UTC (rev 135) @@ -83,17 +83,17 @@ } public void cpuloop() { - if (running) { + if (isRunning()) { throw new IllegalStateException("already running"); } - running = true; + setRunning(true); // ??? - power-up reset should be executed?! time = System.currentTimeMillis(); run(); } private void run() { - while (running) { + while (isRunning()) { // ------------------------------------------------------------------- // Debug information // ------------------------------------------------------------------- @@ -151,7 +151,7 @@ } public long step(long max_cycles) { - if (running) { + if (isRunning()) { throw new IllegalStateException("step not possible when CPU is running"); } @@ -213,7 +213,7 @@ } public void stop() { - running = false; + setRunning(false); } public int getExecCount(int address) { @@ -277,4 +277,12 @@ this.profiler = new SimpleProfiler(); } } + + public boolean setRunning(boolean running) { + return this.running = running; + } + + public boolean isRunning() { + return running; + } } Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-02-16 10:11:57 UTC (rev 134) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-02-18 20:05:45 UTC (rev 135) @@ -370,6 +370,10 @@ private void executeEvents() { if (cycles >= nextVTimeEventCycles) { + if (vTimeEventQueue.nextTime == 0) { + nextEventCycles = cycles + 1000; + return; + } TimeEvent te = vTimeEventQueue.popFirst(); long now = getTime(); te.execute(now); Modified: mspsim/se/sics/mspsim/extutil/jfreechart/DataChart.java =================================================================== --- mspsim/se/sics/mspsim/extutil/jfreechart/DataChart.java 2008-02-16 10:11:57 UTC (rev 134) +++ mspsim/se/sics/mspsim/extutil/jfreechart/DataChart.java 2008-02-18 20:05:45 UTC (rev 135) @@ -21,6 +21,7 @@ import se.sics.mspsim.chip.CC2420; import se.sics.mspsim.core.MSP430; import se.sics.mspsim.ui.WindowUtils; +import se.sics.mspsim.util.DataSource; import se.sics.mspsim.util.OperatingModeStatistics; import se.sics.mspsim.util.StackMonitor; @@ -94,29 +95,18 @@ jw.setVisible(true); } - public void setupChipFrame(OperatingModeStatistics oms, MSP430 cpu) { + public DataSourceSampler setupChipFrame(MSP430 cpu) { JFrame jw = openFrame("Duty-Cycle Monitor"); DataSourceSampler dss = new DataSourceSampler(cpu); dss.setInterval(50); - TimeSeries ts = new TimeSeries("LEDS", Millisecond.class); - ts.setMaximumItemCount(200); - addTimeSeries(ts); - dss.addDataSource(oms.getMultiDataSource("Tmote Sky"), ts); + jw.setVisible(true); + return dss; + } - ts = new TimeSeries("Listen", Millisecond.class); + public void addDataSource(DataSourceSampler dss, String name, DataSource src) { + TimeSeries ts = new TimeSeries(name, Millisecond.class); ts.setMaximumItemCount(200); addTimeSeries(ts); - dss.addDataSource(oms.getDataSource("CC2420", CC2420.MODE_RX_ON), ts); - - ts = new TimeSeries("Transmit", Millisecond.class); - ts.setMaximumItemCount(200); - addTimeSeries(ts); - dss.addDataSource(oms.getDataSource("CC2420", CC2420.MODE_TXRX_ON), ts); - - ts = new TimeSeries("CPU", Millisecond.class); - ts.setMaximumItemCount(200); - addTimeSeries(ts); - dss.addDataSource(oms.getDataSource("MSP430 Core", MSP430.MODE_ACTIVE), ts); - jw.setVisible(true); - } + dss.addDataSource(src, ts); + } } Modified: mspsim/se/sics/mspsim/extutil/jfreechart/DataSourceSampler.java =================================================================== --- mspsim/se/sics/mspsim/extutil/jfreechart/DataSourceSampler.java 2008-02-16 10:11:57 UTC (rev 134) +++ mspsim/se/sics/mspsim/extutil/jfreechart/DataSourceSampler.java 2008-02-18 20:05:45 UTC (rev 135) @@ -20,21 +20,9 @@ private Timer timer; private ArrayList<TimeSource> sources = new ArrayList<TimeSource>(); -// private TimeSeries test; -// private TimeSeries test2; -// private TimeSeriesCollection dataset; - public DataSourceSampler(MSP430Core cpu) { this.cpu = cpu; timer = new Timer(interval, this); -// test = new TimeSeries("Data", Millisecond.class); -// test.setMaximumItemAge(30000); -// test2 = new TimeSeries("Data 2", Millisecond.class); -// test2.setMaximumItemAge(30000); -//// test2.setMaximumItemCount(30000); -// dataset = new TimeSeriesCollection(); -// dataset.addSeries(test); -// dataset.addSeries(test2); timer.start(); } @@ -55,9 +43,10 @@ private void sampleAll() { if (sources.size() > 0) { - TimeSource[] srcs = (TimeSource[]) sources.toArray(new TimeSource[0]); + TimeSource[] srcs = (TimeSource[]) sources.toArray(new TimeSource[0]); for (int i = 0; i < srcs.length; i++) { - srcs[i].update(); + if (srcs[i] != null) + srcs[i].update(); } } @@ -68,43 +57,7 @@ public void actionPerformed(ActionEvent arg0) { sampleAll(); } - - -// public static void main(String[] args) { -// DataSourceSampler samp = new DataSourceSampler(); -// DateAxis domain = new DateAxis("Time"); -// NumberAxis range = new NumberAxis("Memory"); -// XYPlot xyplot = new XYPlot(); -// xyplot.setDataset(samp.dataset); -// xyplot.setDomainAxis(domain); -// xyplot.setRangeAxis(range); -// xyplot.setBackgroundPaint(Color.black); -// -// XYItemRenderer renderer = new DefaultXYItemRenderer(); -// renderer.setSeriesPaint(0, Color.red); -// renderer.setSeriesPaint(1, Color.green); -// renderer.setBaseStroke( -// new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL) -// ); -// xyplot.setRenderer(renderer); -// -// domain.setAutoRange(true); -// domain.setLowerMargin(0.0); -// domain.setUpperMargin(0.0); -// domain.setTickLabelsVisible(true); -// range.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); -// JFreeChart chart = new JFreeChart( -// "Memory Usage", -// JFreeChart.DEFAULT_TITLE_FONT, -// xyplot,true); -// ChartPanel chartPanel = new ChartPanel(chart); -// JFrame jw = new JFrame("test"); -// jw.add(chartPanel); -// jw.setBounds(100, 100, 400, 200); -// jw.setVisible(true); -// -// } - + private static class TimeSource { private MSP430Core cpu; Added: mspsim/se/sics/mspsim/platform/GenericNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/GenericNode.java (rev 0) +++ mspsim/se/sics/mspsim/platform/GenericNode.java 2008-02-18 20:05:45 UTC (rev 135) @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2007, 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: $ + * + * ----------------------------------------------------------------- + * + * GenericNode + * + * Author : Joakim Eriksson + */ + +package se.sics.mspsim.platform; + +import java.io.File; +import java.io.IOException; + +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.CommandHandler; +import se.sics.mspsim.util.ComponentRegistry; +import se.sics.mspsim.util.DebugCommands; +import se.sics.mspsim.util.ELF; +import se.sics.mspsim.util.IHexReader; +import se.sics.mspsim.util.MapTable; +import se.sics.mspsim.util.OperatingModeStatistics; + +public abstract class GenericNode extends Chip implements Runnable { + + protected ComponentRegistry registry = new ComponentRegistry(); + protected MSP430 cpu = new MSP430(0); + protected String firmwareFile = null; + protected ELF elf; + protected OperatingModeStatistics stats; + + public abstract void setupNode(); + + public void setup(String[] args) throws IOException { + if (args.length == 0) { + System.out.println("Usage: mspsim.platform.sky.SkyNode <firmware>"); + System.exit(1); + } + + CommandHandler ch = new CommandHandler(); + registry.registerComponent("cpu", cpu); + registry.registerComponent("commandHandler", ch); + registry.registerComponent("debugcmd", new DebugCommands()); + registry.registerComponent("node", this); + + // Monitor execution + cpu.setMonitorExec(true); + //cpu.setDebug(true); + int[] memory = cpu.getMemory(); + + if (args[0].endsWith("ihex")) { + // IHEX Reading + IHexReader reader = new IHexReader(); + reader.readFile(memory, firmwareFile = args[0]); + } else { + elf = ELF.readELF(firmwareFile = args[0]); + elf.loadPrograms(memory); + MapTable map = elf.getMap(); + cpu.getDisAsm().setMap(map); + cpu.setMap(map); + registry.registerComponent("elf", elf); + registry.registerComponent("mapTable", map); + } + + cpu.reset(); + stats = new OperatingModeStatistics(cpu); + setupNode(); + + // Setup control and other UI components + ControlUI control = new ControlUI(registry); + HighlightSourceViewer sourceViewer = new HighlightSourceViewer(); + sourceViewer.addSearchPath(new File("../../contiki-2.x/examples/energest-demo/")); + control.setSourceViewer(sourceViewer); + + if (args.length > 1) { + MapTable map = new MapTable(args[1]); + cpu.getDisAsm().setMap(map); + registry.registerComponent("mapTable", map); + } + + registry.start(); + } + + + public void run() { + System.out.println("Starting new CPU thread..."); + cpu.cpuloop(); + System.out.println("Stopping CPU thread..."); + } + public void start() { + if (!cpu.isRunning()) { + new Thread(this).start(); + } + } + + public void stop() { + cpu.setRunning(false); + } + + public void step() { + if (!cpu.isRunning()) { + cpu.step(); + } + } +} Modified: mspsim/se/sics/mspsim/platform/esb/ESBNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-02-16 10:11:57 UTC (rev 134) +++ mspsim/se/sics/mspsim/platform/esb/ESBNode.java 2008-02-18 20:05:45 UTC (rev 135) @@ -42,11 +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; -public class ESBNode implements PortListener { +import se.sics.mspsim.extutil.jfreechart.DataChart; +import se.sics.mspsim.extutil.jfreechart.DataSourceSampler; +public class ESBNode extends GenericNode implements PortListener { public static final boolean DEBUG = false; @@ -55,7 +60,6 @@ // Port 2. public static final int BUTTON_PIN = 7; - private MSP430 cpu; private IOPort port1; private IOPort port2; @@ -73,20 +77,7 @@ * Creates a new <code>ESBNode</code> instance. * */ - public ESBNode(MSP430 cpu) { - this.cpu = cpu; - IOUnit unit = cpu.getIOUnit("Port 2"); - if (unit instanceof IOPort) { - port2 = (IOPort) unit; - System.out.println("Found port 2!!!"); - port2.setPortListener(this); - } - - unit = cpu.getIOUnit("Port 1"); - if (unit instanceof IOPort) { - port1 = (IOPort) unit; - } - + public ESBNode() { } public void setPIR(boolean hi) { @@ -134,51 +125,46 @@ } } - public static void main(String[] args) throws IOException { - final MSP430 cpu = new MSP430(0); - // Monitor execution - cpu.setMonitorExec(true); - ELF elf = null; - int[] memory = cpu.getMemory(); + public void setupNode() { + IOUnit unit = cpu.getIOUnit("Port 2"); + if (unit instanceof IOPort) { + port2 = (IOPort) unit; + System.out.println("Found port 2!!!"); + port2.setPortListener(this); + } - if (args[0].endsWith("ihex")) { - // IHEX Reading - IHexReader reader = new IHexReader(); - reader.readFile(memory, args[0]); - } else { - elf = ELF.readELF(args[0]); - elf.loadPrograms(memory); - MapTable map = elf.getMap(); - cpu.getDisAsm().setMap(map); - cpu.setMap(map); + unit = cpu.getIOUnit("Port 1"); + if (unit instanceof IOPort) { + port1 = (IOPort) unit; } + + gui = new ESBGui(this); + + stats.addMonitor(this); +// stats.addMonitor(radio); + stats.addMonitor(cpu); - cpu.reset(); - ESBNode node = new ESBNode(cpu); - node.gui = new ESBGui(node); - ControlUI control = new ControlUI(cpu, elf); - HighlightSourceViewer sourceViewer = new HighlightSourceViewer(); - control.setSourceViewer(sourceViewer); + // 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, "CPU", stats.getDataSource("MSP430 Core", MSP430.MODE_ACTIVE)); + } - if (args.length > 1) { - MapTable map = new MapTable(args[1]); - cpu.getDisAsm().setMap(map); - cpu.setMap(map); + public int getModeMax() { + return 0; + } - // An illustration on how to add a breakpoint! -// if (map != null) { -// int adr = map.getFunctionAddress("process_run"); -// if (adr != -1) { -// cpu.setBreakPoint(adr, new CPUMonitor() { -// public void cpuAction(int type, int adr, int data) { -// System.out.println("Break at: " + cpu.reg[cpu.PC]); -// cpu.stop(); -// } -// }); -// } -// } - - } - cpu.cpuloop(); + public String getName() { + return "ESB Node"; } + + public static void main(String[] args) throws IOException { + ESBNode node = new ESBNode(); + node.setup(args); + node.start(); + } + } Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-02-16 10:11:57 UTC (rev 134) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2008-02-18 20:05:45 UTC (rev 135) @@ -57,9 +57,12 @@ 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.CommandHandler; import se.sics.mspsim.util.ComponentRegistry; +import se.sics.mspsim.util.DataSource; import se.sics.mspsim.util.DebugCommands; import se.sics.mspsim.util.ELF; import se.sics.mspsim.util.IHexReader; @@ -69,7 +72,7 @@ /** * Emulation of Sky Mote */ -public class SkyNode extends Chip implements PortListener, USARTListener { +public class SkyNode extends GenericNode implements PortListener, USARTListener { public static final boolean DEBUG = false; @@ -93,7 +96,6 @@ public static final int CC2420_VREG = (1 << 5); public static final int CC2420_CHIP_SELECT = 0x04; - private MSP430 cpu; private IOPort port1; private IOPort port2; private IOPort port4; @@ -102,7 +104,6 @@ private CC2420 radio; private M25P80 flash; private String flashFile; - private ELF elf; public static final int BLUE_LED = 0x40; public static final int GREEN_LED = 0x20; @@ -112,78 +113,13 @@ public boolean blueLed; public boolean greenLed; private int mode = MODE_LEDS_OFF; - - private OperatingModeStatistics stats; - + public SkyGui gui; /** * Creates a new <code>SkyNode</code> instance. * */ - public SkyNode(MSP430 cpu, String flashFile) { - this.cpu = cpu; - this.flashFile = flashFile; - IOUnit unit = cpu.getIOUnit("Port 5"); - if (unit instanceof IOPort) { - port5 = (IOPort) unit; - port5.setPortListener(this); - } - - unit = cpu.getIOUnit("Port 1"); - if (unit instanceof IOPort) { - port1 = (IOPort) unit; - } - - unit = cpu.getIOUnit("Port 2"); - if (unit instanceof IOPort) { - port2 = (IOPort) unit; - } - - IOUnit usart0 = cpu.getIOUnit("USART 0"); - if (usart0 instanceof USART) { - radio = new CC2420(cpu); - radio.setCCAPort(port1, CC2420_CCA); - radio.setFIFOPPort(port1, CC2420_FIFOP); - radio.setFIFOPort(port1, CC2420_FIFO); - flash = new M25P80(cpu, flashFile); - ((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 = new OperatingModeStatistics(cpu); - stats.addMonitor(this); - stats.addMonitor(radio); - stats.addMonitor(cpu); - - cpu.scheduleTimeEventMillis(new TimeEvent(0) { - public void execute(long t) { - System.out.println("SkyNode: a second elapsed (wall time): " + t + " millis: " + SkyNode.this.cpu.getTimeMillis()); - SkyNode.this.cpu.scheduleTimeEventMillis(this, 1000.0); - } - }, 1000.0); - - // TODO: remove this test... - radio.setPacketListener(new PacketListener() { - public void transmissionEnded(int[] receivedData) { - System.out.println(getName() + " got packet from radio " + SkyNode.this.cpu.getTimeMillis()); - } - 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) { -// System.out.println("Write to USART0 TX: " + data + " at " + -// SkyNode.this.elf.getDebugInfo(SkyNode.this.cpu.readRegister(0))); -// } -// }); - + public SkyNode() { } public void setButton(boolean hi) { @@ -250,70 +186,94 @@ return "Tmote Sky"; } - - public static void main(String[] args) throws IOException { - if (args.length == 0) { - System.out.println("Usage: mspsim.platform.sky.SkyNode <firmware>"); - System.exit(1); - } - - ComponentRegistry registry = new ComponentRegistry(); - final MSP430 cpu = new MSP430(0); - CommandHandler ch = new CommandHandler(); - registry.registerComponent("cpu", cpu); - registry.registerComponent("commandHandler", ch); - registry.registerComponent("debugcmd", new DebugCommands()); - - // Monitor execution - cpu.setMonitorExec(true); - //cpu.setDebug(true); - ELF elf = null; - int[] memory = cpu.getMemory(); - - if (args[0].endsWith("ihex")) { - // IHEX Reading - IHexReader reader = new IHexReader(); - reader.readFile(memory, args[0]); - } else { - elf = ELF.readELF(args[0]); - elf.loadPrograms(memory); - MapTable map = elf.getMap(); - cpu.getDisAsm().setMap(map); - cpu.setMap(map); - registry.registerComponent("mapTable", map); - } - + public void setupNode() { // create a filename for the flash file // This should be possible to take from a config file later! - String fileName = args[0]; + 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; + IOUnit unit = cpu.getIOUnit("Port 5"); + if (unit instanceof IOPort) { + port5 = (IOPort) unit; + port5.setPortListener(this); + } + + unit = cpu.getIOUnit("Port 1"); + if (unit instanceof IOPort) { + port1 = (IOPort) unit; + } + + unit = cpu.getIOUnit("Port 2"); + if (unit instanceof IOPort) { + port2 = (IOPort) unit; + } + + IOUnit usart0 = cpu.getIOUnit("USART 0"); + if (usart0 instanceof USART) { + radio = new CC2420(cpu); + radio.setCCAPort(port1, CC2420_CCA); + radio.setFIFOPPort(port1, CC2420_FIFOP); + radio.setFIFOPort(port1, CC2420_FIFO); + flash = new M25P80(cpu, flashFile); + ((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); + } + } - cpu.reset(); - SkyNode node = new SkyNode(cpu, fileName); - node.elf = elf; - node.gui = new SkyGui(node); - ControlUI control = new ControlUI(cpu, elf); - HighlightSourceViewer sourceViewer = new HighlightSourceViewer(); - sourceViewer.addSearchPath(new File("../../contiki-2.x/examples/energest-demo/")); - control.setSourceViewer(sourceViewer); + stats.addMonitor(this); + stats.addMonitor(radio); + stats.addMonitor(cpu); + + cpu.scheduleTimeEventMillis(new TimeEvent(0) { + public void execute(long t) { + System.out.println("SkyNode: a second elapsed (wall time): " + t + " millis: " + SkyNode.this.cpu.getTimeMillis()); + SkyNode.this.cpu.scheduleTimeEventMillis(this, 1000.0); + } + }, 1000.0); - if (args.length > 1) { - MapTable map = new MapTable(args[1]); - cpu.getDisAsm().setMap(map); - registry.registerComponent("mapTable", map); - } + // TODO: remove this test... + radio.setPacketListener(new PacketListener() { + public void transmissionEnded(int[] receivedData) { + System.out.println(getName() + " got packet from radio " + SkyNode.this.cpu.getTimeMillis()); + } + 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) { +// System.out.println("Write to USART0 TX: " + data + " at " + +// SkyNode.this.elf.getDebugInfo(SkyNode.this.cpu.readRegister(0))); +// } +// }); - // A HACK!!! + gui = new SkyGui(this); + + // A HACK for some "graphs"!!! DataChart dataChart = new DataChart("Duty Cycle", "Duty Cycle"); - dataChart.setupChipFrame(node.stats, cpu); - - registry.start(); - cpu.cpuloop(); + 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, "CPU", stats.getDataSource("MSP430 Core", MSP430.MODE_ACTIVE)); } + + + public static void main(String[] args) throws IOException { + SkyNode node = new SkyNode(); + node.setup(args); + node.start(); + } + } Modified: mspsim/se/sics/mspsim/ui/ControlUI.java =================================================================== --- mspsim/se/sics/mspsim/ui/ControlUI.java 2008-02-16 10:11:57 UTC (rev 134) +++ mspsim/se/sics/mspsim/ui/ControlUI.java 2008-02-18 20:05:45 UTC (rev 135) @@ -55,6 +55,8 @@ import se.sics.mspsim.core.*; import se.sics.mspsim.extutil.jfreechart.DataChart; +import se.sics.mspsim.platform.GenericNode; +import se.sics.mspsim.util.ComponentRegistry; import se.sics.mspsim.util.DebugInfo; import se.sics.mspsim.util.ELF; @@ -65,6 +67,7 @@ private JFrame window; private MSP430 cpu; + private GenericNode node; private DebugUI dui; private JFrame stackWindow; private StackUI stackUI; @@ -74,14 +77,12 @@ private Action stepAction; - public ControlUI(MSP430 cpu) { - this(cpu, null); - } - - public ControlUI(MSP430 cpu, ELF elf) { + public ControlUI(ComponentRegistry registry) { super(new GridLayout(0, 1)); - this.cpu = cpu; - + this.cpu = (MSP430) registry.getComponent("cpu"); + this.node = (GenericNode) registry.getComponent("node"); + elfData = (ELF) registry.getComponent("elf"); + DataChart test = new DataChart("Stack Monitor", "Bytes"); test.setupStackFrame(cpu); if (USE_STACKUI) { @@ -105,7 +106,7 @@ createButton("Stop"); stepAction = new AbstractAction("Single Step") { public void actionPerformed(ActionEvent e) { - ControlUI.this.cpu.step(); + ControlUI.this.node.step(); dui.updateRegs(); dui.repaint(); if (elfData != null && sourceViewer != null @@ -132,7 +133,7 @@ add(stepButton); createButton("Stack Trace"); - if (elf != null) { + if (elfData != null) { createButton("Show Source"); } createButton("Profile Dump"); @@ -146,7 +147,6 @@ WindowUtils.restoreWindowBounds("ControlUI", window); WindowUtils.addSaveOnShutdown("ControlUI", window); window.setVisible(true); - elfData = elf; } public void setSourceViewer(SourceViewer viewer) { @@ -177,18 +177,15 @@ ((JButton) ae.getSource()).setText("Debug On"); } else if ("Run".equals(cmd)) { - new Thread(new Runnable() { - public void run() { - cpu.cpuloop(); - }}).start(); + node.start(); ((JButton) ae.getSource()).setText("Stop"); stepAction.setEnabled(false); - + } else if ("Stop".equals(cmd)) { - cpu.stop(); + node.stop(); ((JButton) ae.getSource()).setText("Run"); stepAction.setEnabled(true); - + } else if ("Profile Dump".equals(cmd)) { if (cpu.getProfiler() != null) { cpu.getProfiler().printProfile(); @@ -221,5 +218,4 @@ } dui.updateRegs(); } - -} +} \ 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-02-27 01:01:37
|
Revision: 145 http://mspsim.svn.sourceforge.net/mspsim/?rev=145&view=rev Author: joxe Date: 2008-02-26 17:01:35 -0800 (Tue, 26 Feb 2008) Log Message: ----------- fixed transmit interrupt in USART Modified Paths: -------------- mspsim/se/sics/mspsim/core/SFR.java mspsim/se/sics/mspsim/core/USART.java mspsim/se/sics/mspsim/util/ELF.java Modified: mspsim/se/sics/mspsim/core/SFR.java =================================================================== --- mspsim/se/sics/mspsim/core/SFR.java 2008-02-22 10:58:38 UTC (rev 144) +++ mspsim/se/sics/mspsim/core/SFR.java 2008-02-27 01:01:35 UTC (rev 145) @@ -80,6 +80,7 @@ // write a value to the IO unit public void write(int address, int value, boolean word, long cycles) { + System.out.println(getName() + " write to: " + address + " = " + value); switch (address) { case IE1: ie1 = value; @@ -107,6 +108,7 @@ // read // read a value from the IO unit public int read(int address, boolean word, long cycles) { + System.out.println(getName() + " read from: " + address); switch (address) { case IE1: return ie1; Modified: mspsim/se/sics/mspsim/core/USART.java =================================================================== --- mspsim/se/sics/mspsim/core/USART.java 2008-02-22 10:58:38 UTC (rev 144) +++ mspsim/se/sics/mspsim/core/USART.java 2008-02-27 01:01:35 UTC (rev 145) @@ -43,7 +43,7 @@ public class USART extends IOUnit { - public static final boolean DEBUG = false; + public static final boolean DEBUG = true; // USART 0/1 register offset (0x70 / 0x78) public static final int UCTL = 0; @@ -96,6 +96,16 @@ private MSP430Core cpu; private SFR sfr; + private int uctl; + private int utctl; + private int urctl; + private int umctl; + private int ubr0; + private int ubr1; + private int urxbuf; + + private int utxbuf; + /** * Creates a new <code>USART</code> instance. * @@ -148,24 +158,53 @@ // Only 8 bits / read! public void write(int address, int data, boolean word, long cycles) { - memory[address] = data & 0xff; - if (word) { - memory[address + 1] = (data >> 8) & 0xff; - } - - address = address - offset; // Indicate ready to write!!! - this should not be done here... // if (uartID == 0) memory[IFG1] |= 0x82; // else memory[IFG1 + 1] |= 0x20; - setBitIFG(utxifg); // System.out.println(">>>> Write to " + getName() + " at " + // address + " = " + data); switch (address) { + case UCTL: + uctl = data; + System.out.println(getName() + " write to UCTL " + data); + break; + case UTCTL: + utctl = data; + System.out.println(getName() + " write to UTCTL " + data); + + if (((data >> 4) & 3) == 1) { + clockSource = MSP430Constants.CLK_ACLK; + if (DEBUG) { + System.out.println(getName() + " Selected ACLK as source"); + } + } else { + clockSource = MSP430Constants.CLK_SMCLK; + if (DEBUG) { + System.out.println(getName() + " Selected SMCLK as source"); + } + } + updateBaudRate(); + break; + case URCTL: + urctl = data; + break; + case UMCTL: + umctl = data; + System.out.println(getName() + " write to UMCTL " + data); + break; + case UBR0: + ubr0 = data; + updateBaudRate(); + break; + case UBR1: + ubr1 = data; + updateBaudRate(); + break; case UTXBUF: -// System.out.print(">>>> USART_UTXBUF:" + (char) data + "\n"); + if (DEBUG) System.out.print(getName() + ": USART_UTXBUF:" + (char) data + "\n"); if (listener != null) { listener.dataReceived(this, data); @@ -173,49 +212,70 @@ // Interruptflag not set! clrBitIFG(utxifg); - memory[UTCTL + offset] &= ~UTCTL_TXEMPTY; + utctl &= ~UTCTL_TXEMPTY; + utxbuf = data; + if (DEBUG) System.out.println(getName() + " flagging off transmit interrupt"); + cpu.flagInterrupt(transmitInterrupt, this, false); nextTXReady = cycles + tickPerByte; // We should set the "not-ready" flag here! // When should the reception interrupt be received!? break; + } + } + + public int read(int address, boolean word, long cycles) { + address = address - offset; +// System.out.println(">>>>> Read from " + getName() + " at " + +// address + " = " + memory[address]); + + switch (address) { + case UCTL: + System.out.println(getName() + " read from UCTL"); + return uctl; case UTCTL: - if (((data >> 4) & 3) == 1) { - clockSource = MSP430Constants.CLK_ACLK; - if (DEBUG) { - System.out.println(getName() + " Selected ACLK as source"); - } - } else { - clockSource = MSP430Constants.CLK_SMCLK; - if (DEBUG) { - System.out.println(getName() + " Selected SMCLK as source"); - } - } - updateBaudRate(); - break; + System.out.println(getName() + " read from UTCTL: " + utctl); + return utctl; + case URCTL: + return urctl; + case UMCTL: + return umctl; case UBR0: + return ubr0; case UBR1: - updateBaudRate(); + return ubr1; + case UTXBUF: + return utxbuf; + case URXBUF: + // When byte is read - the interruptflag is cleared! + // and error status should also be cleared later... + if (MSP430Constants.DEBUGGING_LEVEL > 0) { + System.out.println(getName() + " clearing rx interrupt flag"); + } + clrBitIFG(urxifg); + return urxbuf; } + return 0; } private void updateBaudRate() { - int div = memory[offset + UBR0] + (memory[offset + UBR1] << 8); + int div = ubr0 + (ubr1 << 8); if (div == 0) { div = 1; } if (clockSource == MSP430Constants.CLK_ACLK) { if (DEBUG) { - System.out.println(getName() + " Baud rate is: " + cpu.aclkFrq/div); + System.out.println(getName() + " Baud rate is: " + cpu.aclkFrq / div); } baudRate = cpu.aclkFrq / div; } else { if (DEBUG) { - System.out.println(getName() + " Baud rate is: " + cpu.smclkFrq/div); + System.out.println(getName() + " Baud rate is: " + cpu.smclkFrq / div); } baudRate = cpu.smclkFrq / div; } + if (baudRate == 0) baudRate = 1; // Is this correct??? Is it the DCO or smclkFRQ we should have here??? tickPerByte = (8 * cpu.smclkFrq) / baudRate; if (DEBUG) { @@ -223,30 +283,7 @@ } } - public int read(int address, boolean word, long cycles) { - int val = memory[address]; - if (word) { - val |= memory[(address + 1) & 0xffff] << 8; - } - address = address - offset; -// System.out.println(">>>>> Read from " + getName() + " at " + -// address + " = " + memory[address]); - - switch (address) { - case URXBUF: - // When byte is read - the interruptflag is cleared! - // and error status should also be cleared later... - if (MSP430Constants.DEBUGGING_LEVEL > 0) { - System.out.println(getName() + " clearing rx interrupt flag"); - } - clrBitIFG(urxifg); - break; - } - - return val; - } - public String getName() { return "USART " + uartID; } @@ -267,10 +304,14 @@ // Ready to transmit new byte! setBitIFG(utxifg); - memory[offset + UTCTL] |= UTCTL_TXEMPTY; - - if (MSP430Constants.DEBUGGING_LEVEL > 0) { - System.out.println("Ready to transmit next: " + cycles + " " + + utctl |= UTCTL_TXEMPTY; + cpu.flagInterrupt(transmitInterrupt, this, isIEBitsSet(utxifg)); + + if (DEBUG) { + if (isIEBitsSet(utxifg)) { + System.out.println(getName() + " flagging on transmit interrupt"); + } + System.out.println(getName() + " Ready to transmit next: " + cycles + " " + tickPerByte); } nextTXReady = -1; @@ -294,7 +335,7 @@ if (MSP430Constants.DEBUGGING_LEVEL > 0) { System.out.println(getName() + " byteReceived: " + b); } - memory[offset + URXBUF] = b & 0xff; + urxbuf = b & 0xff; // Indicate interrupt also! setBitIFG(urxifg); Modified: mspsim/se/sics/mspsim/util/ELF.java =================================================================== --- mspsim/se/sics/mspsim/util/ELF.java 2008-02-22 10:58:38 UTC (rev 144) +++ mspsim/se/sics/mspsim/util/ELF.java 2008-02-27 01:01:35 UTC (rev 145) @@ -51,7 +51,7 @@ public static final int EI_NIDENT = 16; public static final int EI_ENCODING = 5; - public static final boolean DEBUG = true; //false; + public static final boolean DEBUG = false; boolean encMSB = true; int type; @@ -313,13 +313,13 @@ if (type == ELFSection.SYMTYPE_NONE && sn != null){ if ("Letext".equals(sn)) { if (currentFile != null) { - System.out.println("Found file addr for " + currentFile + " : 0x" + - Utils.hex16(currentAddress) + " - 0x" + Utils.hex16(sAddr)); +// System.out.println("Found file addr for " + currentFile + " : 0x" + +// Utils.hex16(currentAddress) + " - 0x" + Utils.hex16(sAddr)); files.add(new FileInfo(currentFile, currentAddress, sAddr)); currentAddress = sAddr; } } else if (!sn.startsWith("_")) { - System.out.println("Adding entry: " + sn + " at " + sAddr); +// System.out.println("Adding entry: " + sn + " at " + sAddr); map.setEntry(new MapEntry(MapEntry.TYPE.variable, sAddr, sn, currentFile, false)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-02-27 14:51:35
|
Revision: 150 http://mspsim.svn.sourceforge.net/mspsim/?rev=150&view=rev Author: joxe Date: 2008-02-27 06:51:32 -0800 (Wed, 27 Feb 2008) Log Message: ----------- added char mode for watch Modified Paths: -------------- mspsim/se/sics/mspsim/core/SFR.java mspsim/se/sics/mspsim/core/USART.java mspsim/se/sics/mspsim/util/DebugCommands.java Modified: mspsim/se/sics/mspsim/core/SFR.java =================================================================== --- mspsim/se/sics/mspsim/core/SFR.java 2008-02-27 14:34:17 UTC (rev 149) +++ mspsim/se/sics/mspsim/core/SFR.java 2008-02-27 14:51:32 UTC (rev 150) @@ -46,6 +46,8 @@ */ public class SFR extends IOUnit { + private boolean DEBUG = false;//true; + public static final int IE1 = 0; public static final int IE2 = 1; public static final int IFG1 = 2; @@ -62,7 +64,6 @@ private int[] memory; private MSP430Core cpu; - private boolean DEBUG = true; public SFR(MSP430Core cpu, int[] memory) { super(memory, 0); Modified: mspsim/se/sics/mspsim/core/USART.java =================================================================== --- mspsim/se/sics/mspsim/core/USART.java 2008-02-27 14:34:17 UTC (rev 149) +++ mspsim/se/sics/mspsim/core/USART.java 2008-02-27 14:51:32 UTC (rev 150) @@ -43,7 +43,7 @@ public class USART extends IOUnit { - public static final boolean DEBUG = true; + public static final boolean DEBUG = false;//true; // USART 0/1 register offset (0x70 / 0x78) public static final int UCTL = 0; @@ -172,11 +172,11 @@ switch (address) { case UCTL: uctl = data; - System.out.println(getName() + " write to UCTL " + data); + if (DEBUG) System.out.println(getName() + " write to UCTL " + data); break; case UTCTL: utctl = data; - System.out.println(getName() + " write to UTCTL " + data); + if (DEBUG) System.out.println(getName() + " write to UTCTL " + data); if (((data >> 4) & 3) == 1) { clockSource = MSP430Constants.CLK_ACLK; @@ -196,7 +196,7 @@ break; case UMCTL: umctl = data; - System.out.println(getName() + " write to UMCTL " + data); + if (DEBUG) System.out.println(getName() + " write to UMCTL " + data); break; case UBR0: ubr0 = data; @@ -235,10 +235,10 @@ switch (address) { case UCTL: - System.out.println(getName() + " read from UCTL"); + if (DEBUG) System.out.println(getName() + " read from UCTL"); return uctl; case UTCTL: - System.out.println(getName() + " read from UTCTL: " + utctl); + if (DEBUG) System.out.println(getName() + " read from UTCTL: " + utctl); return utctl; case URCTL: return urctl; Modified: mspsim/se/sics/mspsim/util/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/util/DebugCommands.java 2008-02-27 14:34:17 UTC (rev 149) +++ mspsim/se/sics/mspsim/util/DebugCommands.java 2008-02-27 14:51:32 UTC (rev 150) @@ -73,20 +73,31 @@ }); ch.registerCommand("watch", new Command() { + int mode = 0; public int executeCommand(final CommandContext context) { int baddr = context.getArgumentAsAddress(0); if (baddr == -1) { context.out.println("Error: unkown symbol:" + context.getArgument(0)); return -1; } + if (context.getArgumentCount() > 1) { + String modeStr = context.getArgument(1); + if ("char".equals(modeStr)) { + mode = 1; + } + } cpu.setBreakPoint(baddr, new CPUMonitor() { public void cpuAction(int type, int adr, int data) { - int pc = cpu.readRegister(0); - String adrStr = getSymOrAddr(context, adr); - String pcStr = getSymOrAddrELF(elf, pc); - context.out.println("*** Write from " + pcStr + - ": " + adrStr + " = " + data); + if (mode == 0) { + int pc = cpu.readRegister(0); + String adrStr = getSymOrAddr(context, adr); + String pcStr = getSymOrAddrELF(elf, pc); + context.out.println("*** Write from " + pcStr + + ": " + adrStr + " = " + data); + } else { + context.out.print((char) data); + } } }); context.out.println("Watch set at: " + baddr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-03-07 13:56:23
|
Revision: 157 http://mspsim.svn.sourceforge.net/mspsim/?rev=157&view=rev Author: joxe Date: 2008-03-07 05:56:21 -0800 (Fri, 07 Mar 2008) Log Message: ----------- fixed multiplication bug Modified Paths: -------------- mspsim/se/sics/mspsim/chip/M25P80.java mspsim/se/sics/mspsim/core/Multiplier.java Modified: mspsim/se/sics/mspsim/chip/M25P80.java =================================================================== --- mspsim/se/sics/mspsim/chip/M25P80.java 2008-03-07 00:12:57 UTC (rev 156) +++ mspsim/se/sics/mspsim/chip/M25P80.java 2008-03-07 13:56:21 UTC (rev 157) @@ -252,6 +252,9 @@ System.out.println("M25P80: Loading memory: " + (address & 0xfff00)); file.seek(address & 0xfff00); file.readFully(readMemory); + for (int i = 0; i < readMemory.length; i++) { + readMemory[i] = (byte) (~readMemory[i] & 0xff); + } } catch (IOException e) { e.printStackTrace(); } @@ -310,10 +313,14 @@ private void writeBack(int address, byte[] data) { try { + byte[] tmp = new byte[data.length]; if (DEBUG) System.out.println("M25P80: Writing data to disk at " + Integer.toHexString(address)); file.seek(address & 0xfff00); - file.write(data); + for (int i = 0; i < data.length; i++) { + tmp[i] = (byte) (~data[i] & 0xff); + } + file.write(tmp); } catch (IOException e) { e.printStackTrace(); } Modified: mspsim/se/sics/mspsim/core/Multiplier.java =================================================================== --- mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-07 00:12:57 UTC (rev 156) +++ mspsim/se/sics/mspsim/core/Multiplier.java 2008-03-07 13:56:21 UTC (rev 157) @@ -132,16 +132,20 @@ break; case MAC: mac = data; - currentSum = 0; if (DEBUG) System.out.println(getName() + " Write to MAC: " + data); lastWriteOP = address; break; case MACS: macs = data; - currentSum = 0; if (DEBUG) System.out.println(getName() + " Write to MACS: " + data); lastWriteOP = address; break; + case RESLO: + resLo = data; + break; + case RESHI: + resHi = data; + break; case OP2: if (DEBUG) System.out.println(getName() + " Write to OP2: " + data); sumext = 0; @@ -151,7 +155,7 @@ boolean signMode = false; boolean sum = false; if (lastWriteOP == MPYS) { - o1 = MPYS; + o1 = mpys; signMode = true; } else if (lastWriteOP == MAC) { o1 = mac; @@ -168,14 +172,15 @@ sumext = 0xffff; } } - int res = o1 * op2; - - if (sum) { + long res = o1 * op2; + System.out.println("O1:" + o1 + " * " + op2 + " = " + res); + if (sum) { + currentSum = (resHi << 16) + resLo; currentSum += res; res = currentSum; } - resHi = (res >> 16) & 0xffff; - resLo = res & 0xffff; + resHi = (int) ((res >> 16) & 0xffff); + resLo = (int) (res & 0xffff); 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: <jo...@us...> - 2008-03-08 17:59:43
|
Revision: 158 http://mspsim.svn.sourceforge.net/mspsim/?rev=158&view=rev Author: joxe Date: 2008-03-07 23:56:03 -0800 (Fri, 07 Mar 2008) Log Message: ----------- initial refactoring for improving CLI Added Paths: ----------- mspsim/se/sics/mspsim/cli/ mspsim/se/sics/mspsim/cli/BasicCommand.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/LineListener.java Copied: mspsim/se/sics/mspsim/cli/BasicCommand.java (from rev 157, mspsim/se/sics/mspsim/util/BasicCommand.java) =================================================================== --- mspsim/se/sics/mspsim/cli/BasicCommand.java (rev 0) +++ mspsim/se/sics/mspsim/cli/BasicCommand.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,63 @@ +/** + * 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$ + * + * ----------------------------------------------------------------- + * + * BasicCommand + * + * Author : Joakim Eriksson, Niclas Finne + * Created : Mon Feb 11 21:28:00 2008 + * Updated : $Date: 2007/10/21 21:17:34 $ + * $Revision: 1.3 $ + */ + +package se.sics.mspsim.cli; + + +public abstract class BasicCommand implements Command { + + private String argumentHelp; + private String commandHelp; + + public BasicCommand(String cmdHelp, String argHelp) { + commandHelp = cmdHelp; + argumentHelp = argHelp; + } + + public String getArgumentHelp(CommandContext context) { + return argumentHelp; + } + + public String getCommandHelp(CommandContext context) { + return commandHelp; + } + +} Copied: mspsim/se/sics/mspsim/cli/Command.java (from rev 157, mspsim/se/sics/mspsim/util/Command.java) =================================================================== --- mspsim/se/sics/mspsim/cli/Command.java (rev 0) +++ mspsim/se/sics/mspsim/cli/Command.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,8 @@ +package se.sics.mspsim.cli; + + +public interface Command { + public int executeCommand(CommandContext context); + public String getCommandHelp(CommandContext context); + public String getArgumentHelp(CommandContext context); +} Copied: mspsim/se/sics/mspsim/cli/CommandBundle.java (from rev 157, mspsim/se/sics/mspsim/util/CommandBundle.java) =================================================================== --- mspsim/se/sics/mspsim/cli/CommandBundle.java (rev 0) +++ mspsim/se/sics/mspsim/cli/CommandBundle.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,50 @@ +/** + * 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$ + * + * ----------------------------------------------------------------- + * + * CommandBundle + * + * Author : Joakim Eriksson, Niclas Finne + * Created : Mon Feb 11 21:28:00 2008 + * Updated : $Date: 2007/10/21 21:17:34 $ + * $Revision: 1.3 $ + */ + +package se.sics.mspsim.cli; + +import se.sics.mspsim.util.ComponentRegistry; + +public interface CommandBundle { + + public void setupCommands(ComponentRegistry registry, CommandHandler handler); + +} Copied: mspsim/se/sics/mspsim/cli/CommandContext.java (from rev 157, mspsim/se/sics/mspsim/util/CommandContext.java) =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java (rev 0) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,85 @@ +package se.sics.mspsim.cli; + +import java.io.InputStream; +import java.io.PrintStream; + +import se.sics.mspsim.util.MapTable; + + +public class CommandContext { + + private String[] args; + private MapTable mapTable; + public final PrintStream out; + public final PrintStream err; + public final InputStream in; + + public CommandContext(MapTable table, String[] args, + InputStream in, PrintStream out, PrintStream err) { + this.args = args; + this.out = out; + this.err = err; + this.in = in; + mapTable = table; + } + + + /** + * exit needs to be called as soon as the command is completed (or stopped). + * @param exitCode - the exit code of the command + */ + public void exit(int exitCode) { + // TODO: Clean up can be done now! + } + + public int getArgumentCount() { + return args.length - 1; + } + + public String getArgument(int index) { + return args[index + 1]; + } + + public MapTable getMapTable() { + return mapTable; + } + + public String getCommand() { + return args[0]; + } + + public int getArgumentAsAddress(int index) { + String adr = getArgument(index); + if (adr == null || adr.length() == 0) return 0; + adr = adr.trim(); + if (adr.charAt(0) == '$') { + try { + return Integer.parseInt(adr.substring(1), 16); + } catch (Exception e) { + err.println("Illegal hex number format: " + adr); + } + } else if (Character.isDigit(adr.charAt(0))) { + try { + return Integer.parseInt(adr); + } catch (Exception e) { + err.println("Illegal number format: " + adr); + } + } else { + // Assume that it is a symbol + if (mapTable != null) { + return mapTable.getFunctionAddress(adr); + } + } + return 0; + } + + public int getArgumentAsInt(int i) { + try { + return Integer.parseInt(getArgument(i)); + } catch (Exception e) { + err.println("Illegal number format: " + getArgument(i)); + } + return 0; + } + +} Copied: mspsim/se/sics/mspsim/cli/CommandHandler.java (from rev 157, mspsim/se/sics/mspsim/util/CommandHandler.java) =================================================================== --- mspsim/se/sics/mspsim/cli/CommandHandler.java (rev 0) +++ mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,174 @@ +package se.sics.mspsim.cli; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.InterruptedIOException; +import java.io.PrintStream; +import java.util.Hashtable; +import java.util.Map; + +import se.sics.mspsim.util.ActiveComponent; +import se.sics.mspsim.util.ComponentRegistry; +import se.sics.mspsim.util.MapTable; + +public class CommandHandler implements ActiveComponent, Runnable { + + private Hashtable<String, Command> commands = new Hashtable<String, Command>(); + private boolean exit; + private boolean workaround = false; + + private BufferedReader inReader; + private InputStream in; + private PrintStream out; + private PrintStream err; + private MapTable mapTable; + private ComponentRegistry registry; + + 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 + }, context.in, 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 + }, context.in, 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; + } + }); + } + + // Add it to the hashtable (overwriting anything there) + public void registerCommand(String cmd, Command command) { + commands.put(cmd, command); + } + + + private String readLine(BufferedReader inReader2) throws IOException { + if (workaround) { + StringBuilder str = new StringBuilder(); + while(true) { + if (inReader2.ready()) { + int c = inReader2.read(); + if (c == '\n') { + return str.toString(); + } + if (c != '\r') { + str.append((char)c); + } + } else { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + throw new InterruptedIOException(); + } + } + } + } else { + return inReader2.readLine(); + } + } + + public void run() { + while(!exit) { + try { + out.print(">"); + out.flush(); + String line = readLine(inReader);//.readLine(); + if (line != null && line.length() > 0) { + String[][] parts = CommandParser.parseLine(line); + if(parts.length > 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, in, out, err); + try { + cmd.executeCommand(cc); + } catch (Exception e) { + err.println("Error: Command failed: " + e.getMessage()); + e.printStackTrace(err); + } + } + } + } + } catch (IOException e) { + e.printStackTrace(); + err.println("Command line tool exiting..."); + exit = true; + } + } + } + + public void setComponentRegistry(ComponentRegistry registry) { + this.registry = registry; + } + + public void setWorkaround(boolean w) { + workaround = w; + } + + public void start() { + mapTable = (MapTable) registry.getComponent(MapTable.class); + + Object[] commandBundles = registry.getAllComponents(CommandBundle.class); + if (commandBundles != null) { + for (int i = 0, n = commandBundles.length; i < n; i++) { + ((CommandBundle) commandBundles[i]).setupCommands(registry, this); + } + } + new Thread(this, "cmd").start(); + } +} Copied: mspsim/se/sics/mspsim/cli/CommandParser.java (from rev 157, mspsim/se/sics/mspsim/util/CommandParser.java) =================================================================== --- mspsim/se/sics/mspsim/cli/CommandParser.java (rev 0) +++ mspsim/se/sics/mspsim/cli/CommandParser.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,179 @@ +/** + * 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. + * + * ----------------------------------------------------------------- + * + * CommandParser + * + * Author : Joakim Eriksson, Niclas Finne + * Created : Sun Mar 2 19:41:00 2008 + * Updated : $Date: 2007/10/21 21:17:34 $ + * $Revision: 1.3 $ + */ +package se.sics.mspsim.cli; +import java.util.ArrayList; + +public class CommandParser { + + private static final int TEXT = 0; + private static final int ARG = 1; + private static final int QUOTE = 2; + + private CommandParser() { + // Prevent instances of this class + } + + public static String[][] parseLine(String line) { + ArrayList<String[]> list = new ArrayList<String[]>(); + ArrayList<String> args = new ArrayList<String>(); + StringBuilder sb = null; + int state = TEXT; + int index = 0; + char quote = 0; + + for (int i = 0, n = line.length(); i < n; i++) { + char c = line.charAt(i); + if (c <= 32) { + // White space + if (state == ARG) { + if (sb == null) { + args.add(line.substring(index, i)); + } else { + args.add(sb.append(line.substring(index, i)).toString()); + sb = null; + } + state = TEXT; + } + + } else { + switch (c) { + case '\\': + i++; + if (i >= n) { + throw new IllegalArgumentException("unexpected end of line"); + } + if (state == TEXT) { + state = ARG; + } else { + if (sb == null) { + sb = new StringBuilder(); + } + sb.append(line.substring(index, i - 1)); + } + index = i; + break; + case '"': + case '\'': + if (state == QUOTE) { + if (c == quote) { + // End of quote + if (sb == null) { + args.add(line.substring(index, i)); + } else { + args.add(sb.append(line.substring(index, i)).toString()); + sb = null; + } + state = TEXT; + } + } else { + // Start new quote + if (state != TEXT) { + if (sb == null) { + args.add(line.substring(index, i)); + } else { + args.add(sb.append(line.substring(index, i)).toString()); + sb = null; + } + } + index = i + 1; + state = QUOTE; + quote = c; + } + break; + case '|': + if (state != QUOTE) { + // PIPE + if (state == ARG) { + if (sb == null) { + args.add(line.substring(index, i)); + } else { + args.add(sb.append(line.substring(index, i)).toString()); + sb = null; + } + } + state = TEXT; + if (args.size() == 0) { + throw new IllegalArgumentException("empty command"); + } + list.add(args.toArray(new String[args.size()])); + args.clear(); + } + break; + default: + if (state == TEXT) { + index = i; + state = ARG; + } + break; + } + } + } + if (state == QUOTE) { + throw new IllegalArgumentException("unexpected end of line"); + } + if (state == ARG) { + if (sb == null) { + args.add(line.substring(index)); + } else { + args.add(sb.append(line.substring(index)).toString()); + } + } + if (args.size() > 0) { + list.add(args.toArray(new String[args.size()])); + } + return list.toArray(new String[list.size()][]); + } + +// public static void main(String[] args) { +// StringBuilder sb = new StringBuilder(); +// for (int i = 0, n = args.length; i < n; i++) { +// if (i > 0) sb.append(' '); +// sb.append(args[0]); +// } +// String[][] list = parseLine(sb.toString()); +// for (int j = 0, m = list.length; j < m; j++) { +// String[] a = list[j]; +// System.out.println("PARSED LINE:"); +// for (int i = 0, n = a.length; i < n; i++) { +// System.out.println(" ARG " + (i + 1) + ": '" + a[i] + '\''); +// } +// } +// } + +} Copied: mspsim/se/sics/mspsim/cli/DebugCommands.java (from rev 157, mspsim/se/sics/mspsim/util/DebugCommands.java) =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java (rev 0) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,222 @@ +/** + * 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$ + * + * ----------------------------------------------------------------- + * + * CommandBundle + * + * Author : Joakim Eriksson, Niclas Finne + * Created : Mon Feb 11 2008 + * Updated : $Date: 2007/10/21 21:17:34 $ + * $Revision: 1.3 $ + */ +package se.sics.mspsim.cli; +import se.sics.mspsim.core.CPUMonitor; +import se.sics.mspsim.core.MSP430; +import se.sics.mspsim.platform.GenericNode; +import se.sics.mspsim.util.ComponentRegistry; +import se.sics.mspsim.util.DebugInfo; +import se.sics.mspsim.util.ELF; +import se.sics.mspsim.util.MapEntry; +import se.sics.mspsim.util.Utils; + +public class DebugCommands implements CommandBundle { + + public void setupCommands(ComponentRegistry registry, CommandHandler ch) { + final MSP430 cpu = (MSP430) registry.getComponent(MSP430.class); + final ELF elf = (ELF) registry.getComponent(ELF.class); + final GenericNode node = (GenericNode) registry.getComponent("node"); + if (cpu != null) { + ch.registerCommand("break", new Command() { + public int executeCommand(final CommandContext context) { + int baddr = context.getArgumentAsAddress(0); + cpu.setBreakPoint(baddr, + new CPUMonitor() { + public void cpuAction(int type, int adr, int data) { + context.out.println("*** Break at " + adr); + } + }); + context.out.println("Breakpoint set at: " + baddr); + return 0; + } + + public String getArgumentHelp(CommandContext context) { + return "<address or symbol>"; + } + + public String getCommandHelp(CommandContext context) { + return "adds a breakpoint to a given address or symbol"; + } + }); + + ch.registerCommand("watch", new Command() { + int mode = 0; + public int executeCommand(final CommandContext context) { + int baddr = context.getArgumentAsAddress(0); + if (baddr == -1) { + context.out.println("Error: unkown symbol:" + context.getArgument(0)); + return -1; + } + if (context.getArgumentCount() > 1) { + String modeStr = context.getArgument(1); + if ("char".equals(modeStr)) { + mode = 1; + } + } + cpu.setBreakPoint(baddr, + new CPUMonitor() { + public void cpuAction(int type, int adr, int data) { + if (mode == 0) { + int pc = cpu.readRegister(0); + String adrStr = getSymOrAddr(context, adr); + String pcStr = getSymOrAddrELF(elf, pc); + context.out.println("*** Write from " + pcStr + + ": " + adrStr + " = " + data); + } else { + context.out.print((char) data); + } + } + }); + context.out.println("Watch set at: " + baddr); + return 0; + } + + public String getArgumentHelp(CommandContext context) { + return "<address or symbol>"; + } + + public String getCommandHelp(CommandContext context) { + return "adds a write watch to a given address or symbol"; + } + }); + + ch.registerCommand("clear", new Command() { + public int executeCommand(final CommandContext context) { + int baddr = context.getArgumentAsAddress(0); + cpu.setBreakPoint(baddr, null); + return 0; + } + + public String getArgumentHelp(CommandContext context) { + return "<address or symbol>"; + } + + public String getCommandHelp(CommandContext context) { + return "clears a breakpoint or watch from a given address or symbol"; + } + }); + + + + ch.registerCommand("symbol", new BasicCommand("lists matching symbold", "<regexp>") { + public int executeCommand(final CommandContext context) { + String regExp = context.getArgument(0); + MapEntry[] entries = context.getMapTable().getEntries(regExp); + for (int i = 0; i < entries.length; i++) { + MapEntry mapEntry = entries[i]; + context.out.println(" " + mapEntry.getName() + " at " + + Utils.hex16(mapEntry.getAddress())); + } + return 0; + } + }); + + if (node != null) { + 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))); + return 0; + } + }); + ch.registerCommand("start", new BasicCommand("starts mspsim", "") { + public int executeCommand(CommandContext context) { + node.start(); + return 0; + } + }); + ch.registerCommand("step", new BasicCommand("singlesteps mspsim", "<number of lines>") { + public int executeCommand(CommandContext context) { + int nr = context.getArgumentCount() > 0 ? context.getArgumentAsInt(0) : 1; + while(nr-- > 0) + node.step(); + context.out.println("CPU stepped to: " + Utils.hex16(cpu.readRegister(0))); + return 0; + } + }); + ch.registerCommand("print", new BasicCommand("prints value of an address or symbol", "<address or symbol>") { + public int executeCommand(CommandContext context) { + int adr = context.getArgumentAsAddress(0); + if (adr != -1) { + context.out.println("" + context.getArgument(0) + " = " + Utils.hex16(cpu.read(adr, adr >= 0x100))); + } else { + context.out.println("unkown symbol"); + } + return 0; + } + }); + 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; + } + }); + 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); + return 0; + } + }); + } + } + } + + private static String getSymOrAddr(CommandContext context, int adr) { + MapEntry me = context.getMapTable().getEntry(adr); + if (me != null) { + return me.getName(); + } else { + return Utils.hex16(adr); + } + } + + private static String getSymOrAddrELF(ELF elf, int adr) { + DebugInfo me = elf.getDebugInfo(adr); + if (me != null) { + return me.toString(); + } else { + return Utils.hex16(adr); + } + } + +} Added: mspsim/se/sics/mspsim/cli/LineListener.java =================================================================== --- mspsim/se/sics/mspsim/cli/LineListener.java (rev 0) +++ mspsim/se/sics/mspsim/cli/LineListener.java 2008-03-08 07:56:03 UTC (rev 158) @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2007, 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: $ + * + * ----------------------------------------------------------------- + * + * LineListener + * + * Author : Joakim Eriksson + * Created : 8 mar 2008 + * Updated : $Date:$ + * $Revision:$ + */ +package se.sics.mspsim.cli; + +/** + * @author joakim + * + */ +public interface LineListener { + + public void lineRead(String line); + +} 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: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: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: <jo...@us...> - 2008-03-17 19:34:27
|
Revision: 187 http://mspsim.svn.sourceforge.net/mspsim/?rev=187&view=rev Author: joxe Date: 2008-03-17 12:34:12 -0700 (Mon, 17 Mar 2008) Log Message: ----------- fixed kill command and cleanup after exit Modified Paths: -------------- 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/BasicLineCommand.java mspsim/se/sics/mspsim/cli/CommandContext.java mspsim/se/sics/mspsim/cli/CommandHandler.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/Chip.java mspsim/se/sics/mspsim/core/OperatingModeListener.java mspsim/se/sics/mspsim/util/OperatingModeStatistics.java Modified: mspsim/se/sics/mspsim/chip/PacketListener.java =================================================================== --- mspsim/se/sics/mspsim/chip/PacketListener.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/chip/PacketListener.java 2008-03-17 19:34:12 UTC (rev 187) @@ -27,7 +27,7 @@ * * This file is part of MSPSim. * - * $Id:$ + * $Id$ * * ----------------------------------------------------------------- * Modified: mspsim/se/sics/mspsim/cli/AsyncCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/AsyncCommand.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/AsyncCommand.java 2008-03-17 19:34:12 UTC (rev 187) @@ -36,8 +36,8 @@ * * Author : Joakim Eriksson * Created : 9 mar 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; Modified: mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/BasicAsyncCommand.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : 9 mar 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; Modified: mspsim/se/sics/mspsim/cli/BasicLineCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/BasicLineCommand.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/BasicLineCommand.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : 9 mar 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; Modified: mspsim/se/sics/mspsim/cli/CommandContext.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/CommandContext.java 2008-03-17 19:34:12 UTC (rev 187) @@ -10,24 +10,27 @@ private String commandLine; private MapTable mapTable; private int pid = -1; + private boolean exited = false; private Command command; public PrintStream out; public PrintStream err; + private CommandHandler commandHandler; - public CommandContext(MapTable table, String commandLine, String[] args, + public CommandContext(CommandHandler ch, MapTable table, String commandLine, String[] args, int pid, Command command, PrintStream out, PrintStream err) { - this(table, commandLine, args, pid, command); + this(ch, table, commandLine, args, pid, command); setOutput(out, err); } - public CommandContext(MapTable table, String commandLine, String[] args, + public CommandContext(CommandHandler ch,MapTable table, String commandLine, String[] args, int pid, Command command) { this.commandLine = commandLine; this.args = args; this.pid = pid; this.mapTable = table; this.command = command; + this.commandHandler = ch; } void setOutput(PrintStream out, PrintStream err) { @@ -47,13 +50,18 @@ return pid; } + public boolean hasExited() { + return exited; + } + /** * exit needs to be called as soon as the command is completed (or stopped). * @param exitCode - the exit code of the command */ public void exit(int exitCode) { // TODO: Clean up can be done now! - pid = -1; + exited = true; + commandHandler.exit(this, exitCode, pid); } public MapTable getMapTable() { Modified: mspsim/se/sics/mspsim/cli/CommandHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/CommandHandler.java 2008-03-17 19:34:12 UTC (rev 187) @@ -85,7 +85,7 @@ if (i == 0 && cmd instanceof AsyncCommand) { pid = ++pidCounter; } - commands[i] = new CommandContext(mapTable, line, args, pid, cmd); + commands[i] = new CommandContext(this, mapTable, line, args, pid, cmd); if (i > 0) { PrintStream po = new PrintStream(new LineOutputStream((LineListener) commands[i].getCommand())); commands[i - 1].setOutput(po, err); @@ -249,17 +249,35 @@ 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[] contexts = currentAsyncCommands.get(i); - CommandContext cmd = contexts[0]; - if (pid == cmd.getPID()) { - context.out.println("Should kill: " + cmd.getCommandName()); - break; - } - } + removePid(pid); return 0; } }); } + public void exit(CommandContext commandContext, int exitCode, int pid) { + if (pid >= 0) { + removePid(pid); + } + } + + private void removePid(int pid) { + System.out.println("Removing pid: " + pid); + for (int i = 0; i < currentAsyncCommands.size(); i++) { + CommandContext[] contexts = currentAsyncCommands.get(i); + CommandContext cmd = contexts[0]; + if (pid == cmd.getPID()) { + for (int j = 0; j < contexts.length; j++) { + Command command = contexts[i].getCommand(); + // Stop any commands that have not yet been stopped... + if (command instanceof AsyncCommand && !contexts[i].hasExited()) { + AsyncCommand ac = (AsyncCommand) command; + ac.stopCommand(contexts[i]); + } + } + currentAsyncCommands.remove(contexts); + break; + } + } + } } Modified: mspsim/se/sics/mspsim/cli/ExecCommand.java =================================================================== --- mspsim/se/sics/mspsim/cli/ExecCommand.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/ExecCommand.java 2008-03-17 19:34:12 UTC (rev 187) @@ -33,8 +33,8 @@ * * Author : Joakim Eriksson, Niclas Finne * Created : Sun Mar 09 23:15:36 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; import java.io.BufferedReader; Modified: mspsim/se/sics/mspsim/cli/LineListener.java =================================================================== --- mspsim/se/sics/mspsim/cli/LineListener.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/LineListener.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : 8 mar 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; Modified: mspsim/se/sics/mspsim/cli/LineOutputStream.java =================================================================== --- mspsim/se/sics/mspsim/cli/LineOutputStream.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/LineOutputStream.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : 8 mar 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; Modified: mspsim/se/sics/mspsim/cli/MiscCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,12 +35,14 @@ * * Author : Joakim Eriksson * Created : 9 mar 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.cli; +import java.io.FileNotFoundException; import java.io.PrintStream; +import java.util.Hashtable; import java.util.regex.Pattern; import se.sics.mspsim.util.ComponentRegistry; @@ -50,6 +52,7 @@ * */ public class MiscCommands implements CommandBundle { + Hashtable <String, FileTarget> fileTargets = new Hashtable<String, FileTarget>(); public void setupCommands(ComponentRegistry registry, CommandHandler handler) { handler.registerCommand("grep", new BasicLineCommand("grep", "<regexp>") { @@ -69,6 +72,44 @@ } }); + // TODO: this should also be "registered" as a "sink". + // probably this should be handled using ">" instead! + handler.registerCommand("file", new BasicLineCommand("file", "<filename>") { + FileTarget ft; + public int executeCommand(CommandContext context) { + String fileName = context.getArgument(0); + ft = fileTargets.get(fileName); + if (ft == null) { + try { + ft = new FileTarget(fileName); + fileTargets.put(fileName, ft); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + } + return 0; + } + public void lineRead(String line) { + ft.lineRead(line); + } + public void stopCommand(CommandContext context) { + // Should this do anything? + // Probably depending on the ft's config + } + }); + + handler.registerCommand("fclose", new BasicCommand("fclose", "<filename>") { + public int executeCommand(CommandContext context) { + String name = context.getArgument(0); + FileTarget ft = fileTargets.get(name); + if (ft != null) { + ft.close(); + } + return 0; + } + }); + + handler.registerCommand("exec", new ExecCommand()); } Modified: mspsim/se/sics/mspsim/core/Chip.java =================================================================== --- mspsim/se/sics/mspsim/core/Chip.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/core/Chip.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : 17 jan 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; import java.util.ArrayList; Modified: mspsim/se/sics/mspsim/core/OperatingModeListener.java =================================================================== --- mspsim/se/sics/mspsim/core/OperatingModeListener.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/core/OperatingModeListener.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : 17 jan 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.core; Modified: mspsim/se/sics/mspsim/util/OperatingModeStatistics.java =================================================================== --- mspsim/se/sics/mspsim/util/OperatingModeStatistics.java 2008-03-17 09:46:42 UTC (rev 186) +++ mspsim/se/sics/mspsim/util/OperatingModeStatistics.java 2008-03-17 19:34:12 UTC (rev 187) @@ -35,8 +35,8 @@ * * Author : Joakim Eriksson * Created : 17 jan 2008 - * Updated : $Date:$ - * $Revision:$ + * Updated : $Date$ + * $Revision$ */ package se.sics.mspsim.util; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-04-15 18:49:48
|
Revision: 231 http://mspsim.svn.sourceforge.net/mspsim/?rev=231&view=rev Author: joxe Date: 2008-04-15 11:49:21 -0700 (Tue, 15 Apr 2008) Log Message: ----------- added first version of window subsystem with management commands from CLI. Modified Paths: -------------- mspsim/se/sics/mspsim/cli/MiscCommands.java mspsim/se/sics/mspsim/platform/GenericNode.java Added Paths: ----------- mspsim/se/sics/mspsim/cli/WindowCommands.java mspsim/se/sics/mspsim/cli/WindowTarget.java Modified: mspsim/se/sics/mspsim/cli/MiscCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-04-04 08:34:41 UTC (rev 230) +++ mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-04-15 18:49:21 UTC (rev 231) @@ -157,6 +157,13 @@ } }); + handler.registerCommand("echo", new BasicCommand("echoes argument", "") { + public int executeCommand(CommandContext context) { + context.out.println(context.getArgument(0)); + return 0; + } + }); + handler.registerCommand("exec", new ExecCommand()); } Added: mspsim/se/sics/mspsim/cli/WindowCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/WindowCommands.java (rev 0) +++ mspsim/se/sics/mspsim/cli/WindowCommands.java 2008-04-15 18:49:21 UTC (rev 231) @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2007, 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: WindowCommands.java 187 2008-03-17 19:34:12Z joxe $ + * + * ----------------------------------------------------------------- + * + * WindowCommands - + * + * Author : Joakim Eriksson + * Created : 9 april 2008 + * Updated : $Date: 2008-03-17 20:34:12 +0100 (Mon, 17 Mar 2008) $ + * $Revision: 187 $ + */ +package se.sics.mspsim.cli; + +import java.util.Hashtable; + +import se.sics.mspsim.util.ComponentRegistry; + +public class WindowCommands implements CommandBundle { + + private Hashtable <String, WindowTarget> windowTargets = new Hashtable<String, WindowTarget>(); + + public void setupCommands(ComponentRegistry registry, CommandHandler handler) { + handler.registerCommand(">#", new BasicLineCommand(null, "<windowname>") { + WindowTarget wt; + public int executeCommand(CommandContext context) { + String windowName = context.getArgument(0); + wt = windowTargets.get(windowName); + if (wt == null) { + wt = new WindowTarget(windowName); + windowTargets.put(windowName, wt); + } + return 0; + } + public void lineRead(String line) { + wt.lineRead(line); + } + public void stopCommand(CommandContext context) { + // Should this do anything? + // Probably depending on the wt's config + System.out.println("Stopping window target: " + wt.getName()); + } + }); + + handler.registerCommand("wclose", new BasicCommand("close the specified window", "<windowname>") { + public int executeCommand(CommandContext context) { + String name = context.getArgument(0); + WindowTarget wt = windowTargets.get(name); + if (wt != null) { + context.out.println("Closing window " + name); + windowTargets.remove(name); + wt.close(); + return 0; + } else { + context.err.println("Could not find the window " + name); + return 1; + } + } + }); + } +} Added: mspsim/se/sics/mspsim/cli/WindowTarget.java =================================================================== --- mspsim/se/sics/mspsim/cli/WindowTarget.java (rev 0) +++ mspsim/se/sics/mspsim/cli/WindowTarget.java 2008-04-15 18:49:21 UTC (rev 231) @@ -0,0 +1,56 @@ +package se.sics.mspsim.cli; + +import javax.swing.JFrame; +import javax.swing.JTextArea; + +public class WindowTarget implements LineListener { + + private JFrame window; + private String targetName; + private JTextArea jta = new JTextArea(20,20); + + public WindowTarget(String name) { + window = new JFrame(name); + window.setVisible(true); + window.add(jta); + targetName = name; + } + + @Override + public void lineRead(String line) { + // TODO Auto-generated method stub + if (line != null && line.startsWith("#!")) { + line = line.substring(2); + String[] parts = line.split(" "); + String cmd = parts[0]; + if ("bounds".equals(cmd)) { + try { + window.setBounds(Integer.parseInt(parts[1]), Integer.parseInt(parts[2]), + Integer.parseInt(parts[3]), Integer.parseInt(parts[4])); + } catch (Exception e) { + System.err.println("Cound not set bounds: " + line); + } + } + if ("title".equals(cmd)) { + window.setTitle(parts[1]); + } + } else { + jta.append(line + '\n'); + } + // jta.set + } + + public void close() { + // Notify all the currently active "streams" of lines to this windows + // data-handlers + window.setVisible(false); + window.removeAll(); + window = null; + } + + public String getName() { + // TODO Auto-generated method stub + return targetName; + } + +} Modified: mspsim/se/sics/mspsim/platform/GenericNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/GenericNode.java 2008-04-04 08:34:41 UTC (rev 230) +++ mspsim/se/sics/mspsim/platform/GenericNode.java 2008-04-15 18:49:21 UTC (rev 231) @@ -43,6 +43,7 @@ import se.sics.mspsim.cli.CommandHandler; import se.sics.mspsim.cli.DebugCommands; import se.sics.mspsim.cli.MiscCommands; +import se.sics.mspsim.cli.WindowCommands; import se.sics.mspsim.core.Chip; import se.sics.mspsim.core.MSP430; import se.sics.mspsim.extutil.highlight.HighlightSourceViewer; @@ -85,6 +86,7 @@ registry.registerComponent("debugcmd", new DebugCommands()); registry.registerComponent("misccmd", new MiscCommands()); registry.registerComponent("statcmd", new StatCommands(cpu, stats)); + registry.registerComponent("wincmd", new WindowCommands()); registry.registerComponent("node", this); registry.registerComponent("config", config); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-04-17 00:23:41
|
Revision: 244 http://mspsim.svn.sourceforge.net/mspsim/?rev=244&view=rev Author: joxe Date: 2008-04-16 17:23:19 -0700 (Wed, 16 Apr 2008) Log Message: ----------- added source command for the cli and ADC12 subsystem including sound-sampler for the ESB (demo purpose). Modified Paths: -------------- mspsim/se/sics/mspsim/cli/MiscCommands.java mspsim/se/sics/mspsim/core/ADC12.java mspsim/se/sics/mspsim/platform/esb/ESBGui.java Added Paths: ----------- mspsim/se/sics/mspsim/core/ADCInput.java Modified: mspsim/se/sics/mspsim/cli/MiscCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-04-16 18:26:57 UTC (rev 243) +++ mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-04-17 00:23:19 UTC (rev 244) @@ -39,7 +39,12 @@ * $Revision$ */ package se.sics.mspsim.cli; +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; +import java.io.InputStreamReader; import java.io.PrintStream; import java.util.Hashtable; import java.util.Iterator; @@ -170,6 +175,30 @@ } }); + handler.registerCommand("source", new BasicCommand("run script", "<filename>") { + public int executeCommand(CommandContext context) { + FileInputStream infs = null; + try { + infs = new FileInputStream(context.getArgument(0)); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + BufferedReader input = new BufferedReader(new InputStreamReader(infs)); + String line = null; + try { + while ((line = input.readLine()) != null) { + context.executeCommand(line); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return 0; + } + }); + + handler.registerCommand("repeat", new BasicAsyncCommand("repeat the specified command line", "[-t delay] [-c count] <command line>") { private MSP430 cpu; Modified: mspsim/se/sics/mspsim/core/ADC12.java =================================================================== --- mspsim/se/sics/mspsim/core/ADC12.java 2008-04-16 18:26:57 UTC (rev 243) +++ mspsim/se/sics/mspsim/core/ADC12.java 2008-04-17 00:23:19 UTC (rev 244) @@ -35,7 +35,8 @@ * * Each time a sample is converted the ADC12 system will check for EOS flag * and if not set it just continues with the next conversion (x + 1). - * If EOS next conv is startMem. + * If EOS next conv is startMem. + * Interrupt is triggered when the IE flag are set! * * * Author : Joakim Eriksson @@ -46,6 +47,8 @@ package se.sics.mspsim.core; +import com.sun.org.apache.xpath.internal.operations.Div; + public class ADC12 extends IOUnit { private static final boolean DEBUG = true; //false; @@ -93,32 +96,52 @@ 256, 384, 512, 768, 1024, 1024, 1024, 1024 }; + public static final int EOS_MASK = 0x80; private int adc12ctl0 = 0; private int adc12ctl1 = 0; private int[] adc12mctl = new int[16]; private int[] adc12mem = new int[16]; + private int adc12Pos = 0; private int shTime0 = 4; private int shTime1 = 4; private boolean adc12On = false; private boolean enableConversion; private boolean startConversion; - + private int shSource = 0; private int startMem = 0; private int adcDiv = 1; + private ADCInput adcInput[] = new ADCInput[8]; + private int conSeq; private int adc12ie; private int adc12ifg; + private int adc12iv; + + private int adcSSel; + private MSP430Core core; + private int adc12Vector = 7; - private int adcSSel; + private TimeEvent adcTrigger = new TimeEvent(0) { + public void execute(long t) { +// System.out.println(getName() + " **** executing update timers at " + t + " cycles=" + core.cycles); + convert(); + } + }; + public ADC12(MSP430Core cpu) { super(cpu.memory, 0); + core = cpu; } + + public void setADCInput(int adindex, ADCInput input) { + adcInput[adindex] = input; + } // write a value to the IO unit public void write(int address, int value, boolean word, @@ -134,8 +157,12 @@ if (DEBUG) System.out.println(getName() + ": Set SHTime0: " + shTime0 + " SHTime1: " + shTime1 + " ENC:" + enableConversion + " Start: " + startConversion + " ADC12ON: " + adc12On); + if (adc12On && enableConversion && startConversion) { + convert(); + } break; case ADC12CTL1: + adc12ctl1 = value; startMem = (value >> 12) & 0xf; shSource = (value >> 10) & 0x3; adcDiv = ((value >> 5) & 0x7) + 1; @@ -143,7 +170,6 @@ adcSSel = (value >> 3) & 0x03; if (DEBUG) System.out.println(getName() + ": Set startMem: " + startMem + " SHSource: " + shSource + " ConSeq-mode:" + conSeq + " Div: " + adcDiv + " ADCSSEL: " + adcSSel); - break; case ADC12IE: adc12ie = value; @@ -154,6 +180,7 @@ default: if (address >= ADC12MCTL0 && address <= ADC12MCTL15) { adc12mctl[address - ADC12MCTL0] = value & 0xff; + System.out.println("ADC12MCTL" + (address - ADC12MCTL0) + " source = " + (value & 0xf)); if ((value & 0x80) != 0) { System.out.println("ADC12MCTL" + (address - ADC12MCTL0) + " EOS bit set"); } @@ -176,7 +203,14 @@ if (address >= ADC12MCTL0 && address <= ADC12MCTL15) { return adc12mctl[address - ADC12MCTL0]; } else if (address >= ADC12MEM0) { - return adc12mem[address - ADC12MEM0]; + int reg = address - ADC12MEM0; + // Clear ifg! + adc12ifg &= ~(1 << reg); + if (adc12iv == reg) { + core.flagInterrupt(adc12Vector, this, false); + adc12iv = 0; + } + return adc12mem[reg]; } } return 0; @@ -186,6 +220,27 @@ return "ADC12"; } + private void convert() { + // Some noice... + ADCInput input = adcInput[adc12mctl[adc12Pos] & 0x7]; + adc12mem[adc12Pos] = input != null ? input.nextData() : 2048 + 100 - (int) Math.random() * 200; + if ((adc12ie & (1 << adc12Pos)) > 0) { + adc12ifg |= (1 << adc12Pos); + // This should check if there already is an hihger iv! + adc12iv = adc12Pos * 2 + 6; + core.flagInterrupt(adc12Vector, this, true); + } + // Increase + if ((adc12mctl[adc12Pos] & EOS_MASK) == EOS_MASK) { + adc12Pos = startMem; + } else { + adc12Pos = (adc12Pos + 1) & 0x0f; + } + int delay = adcDiv * (shTime0 + 13); + //System.out.println("Sampling again after: " + delay + " => " + adc12Pos); + core.scheduleTimeEvent(adcTrigger, adcTrigger.time + delay); + } + public void interruptServiced(int vector) { } } Added: mspsim/se/sics/mspsim/core/ADCInput.java =================================================================== --- mspsim/se/sics/mspsim/core/ADCInput.java (rev 0) +++ mspsim/se/sics/mspsim/core/ADCInput.java 2008-04-17 00:23:19 UTC (rev 244) @@ -0,0 +1,5 @@ +package se.sics.mspsim.core; + +public interface ADCInput { + public int nextData(); +} Modified: mspsim/se/sics/mspsim/platform/esb/ESBGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-04-16 18:26:57 UTC (rev 243) +++ mspsim/se/sics/mspsim/platform/esb/ESBGui.java 2008-04-17 00:23:19 UTC (rev 244) @@ -48,6 +48,11 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.awt.event.MouseListener; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.DataLine; +import javax.sound.sampled.TargetDataLine; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JFrame; @@ -59,7 +64,7 @@ public class ESBGui extends JComponent implements KeyListener, MouseMotionListener, - MouseListener { + MouseListener, ADCInput { private static final long serialVersionUID = -139331418649524704L; @@ -76,6 +81,9 @@ public static final Color YELLOW_C = new Color(0xffffff00); public static final Color GREEN_C = new Color(0xff40ff40); + private static final float SAMPLE_RATE = 22050; + private static final int DL_BUFFER_SIZE = 2200; + private SerialMon serial; Beeper beeper; @@ -85,6 +93,8 @@ private boolean buttonDown = false; private boolean resetDown = false; + private TargetDataLine inDataLine; + public ESBGui(ESBNode node) { this.node = node; @@ -118,10 +128,43 @@ ((USART) usart).setUSARTListener(serial); } + IOUnit adc = cpu.getIOUnit("ADC12"); + if (adc instanceof ADC12) { + ((ADC12) adc).setADCInput(0, this); + } + beeper = new Beeper(); cpu.addIOUnit(-1,0,-1,0,beeper, true); + + + // Just a test... TODO: remove!!! + AudioFormat af = new AudioFormat(SAMPLE_RATE, 16, 1, true, false); + DataLine.Info dlin = + new DataLine.Info(TargetDataLine.class, af, DL_BUFFER_SIZE); + + try { + inDataLine = (TargetDataLine) AudioSystem.getLine(dlin); + + if (inDataLine == null) { + System.out.println("No in dataline"); + } else { + System.out.println("Format: " + inDataLine.getFormat()); + inDataLine.open(inDataLine.getFormat(), DL_BUFFER_SIZE); + inDataLine.start(); + } + } catch (Exception e) { + System.out.println("Problem while getting data line "); + e.printStackTrace(); + } } + byte[] data = new byte[2]; + public int nextData() { + inDataLine.read(data, 0, 2); + //System.out.println("sampled: " + ((data[1] << 8) + data[0])); + return data[0]; + } + public void mouseMoved(MouseEvent e) { // System.out.println("Mouse moved: " + e.getX() + "," + e.getY()); int x = e.getX(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-04-18 22:39:36
|
Revision: 246 http://mspsim.svn.sourceforge.net/mspsim/?rev=246&view=rev Author: joxe Date: 2008-04-18 15:39:21 -0700 (Fri, 18 Apr 2008) Log Message: ----------- fixed another type of window for showing multiple line-graphs. Modified Paths: -------------- mspsim/se/sics/mspsim/chip/CC2420.java mspsim/se/sics/mspsim/cli/WindowDataHandler.java mspsim/se/sics/mspsim/cli/WindowTarget.java mspsim/se/sics/mspsim/core/ADC12.java mspsim/se/sics/mspsim/core/Chip.java mspsim/se/sics/mspsim/core/MSP430Constants.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java mspsim/se/sics/mspsim/util/OperatingModeStatistics.java mspsim/se/sics/mspsim/util/StatCommands.java Added Paths: ----------- mspsim/se/sics/mspsim/extutil/jfreechart/JFreeWindowDataHandler.java mspsim/se/sics/mspsim/extutil/jfreechart/LineChart.java Modified: mspsim/se/sics/mspsim/chip/CC2420.java =================================================================== --- mspsim/se/sics/mspsim/chip/CC2420.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/chip/CC2420.java 2008-04-18 22:39:21 UTC (rev 246) @@ -119,11 +119,15 @@ public static final int RAM_PANID = 0x168; public static final int RAM_SHORTADDR = 0x16A; + // The Operation modes of the CC2420 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; - + public static final String[] MODE_NAMES = new String[] { + "off", "listen", "transmit" + }; + // when reading registers this flag is set! public static final int FLAG_READ = 0x40; @@ -198,6 +202,7 @@ registers[REG_SNOP] = 0; registers[REG_TXCTRL] = 0xa0ff; this.cpu = cpu; + setModeNames(MODE_NAMES); } public void dataReceived(USART source, int data) { Modified: mspsim/se/sics/mspsim/cli/WindowDataHandler.java =================================================================== --- mspsim/se/sics/mspsim/cli/WindowDataHandler.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/cli/WindowDataHandler.java 2008-04-18 22:39:21 UTC (rev 246) @@ -49,4 +49,5 @@ public interface WindowDataHandler extends LineListener { public JComponent getComponent(); public void handleCommand(String[] parts); + public void setProperty(String name, String[] args); } Modified: mspsim/se/sics/mspsim/cli/WindowTarget.java =================================================================== --- mspsim/se/sics/mspsim/cli/WindowTarget.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/cli/WindowTarget.java 2008-04-18 22:39:21 UTC (rev 246) @@ -3,6 +3,7 @@ import javax.swing.JFrame; import javax.swing.JTextArea; +import se.sics.mspsim.extutil.jfreechart.LineChart; import se.sics.mspsim.extutil.jfreechart.LineSampleChart; public class WindowTarget implements LineListener { @@ -37,9 +38,14 @@ } } else if ("title".equals(cmd)) { window.setTitle(parts[1]); + if (dataHandler != null) { + dataHandler.setProperty("title", new String[] {parts[1]}); + } } else if ("type".equals(cmd)) { if ("line-sample".equals(parts[1])) { dataHandler = new LineSampleChart(); + } else if ("line".equals(parts[1])) { + dataHandler = new LineChart(); } if (dataHandler != null) { System.out.println("Replacing window data handler! " + parts[1] + " " + dataHandler); Modified: mspsim/se/sics/mspsim/core/ADC12.java =================================================================== --- mspsim/se/sics/mspsim/core/ADC12.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/core/ADC12.java 2008-04-18 22:39:21 UTC (rev 246) @@ -47,8 +47,6 @@ package se.sics.mspsim.core; -import com.sun.org.apache.xpath.internal.operations.Div; - public class ADC12 extends IOUnit { private static final boolean DEBUG = true; //false; Modified: mspsim/se/sics/mspsim/core/Chip.java =================================================================== --- mspsim/se/sics/mspsim/core/Chip.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/core/Chip.java 2008-04-18 22:39:21 UTC (rev 246) @@ -49,7 +49,8 @@ public abstract class Chip { private ArrayList<OperatingModeListener> omListeners; - + private String[] modeNames = null; + public void addOperatingModeListener(OperatingModeListener listener) { if (omListeners == null) omListeners = new ArrayList<OperatingModeListener>(); @@ -70,6 +71,33 @@ } } + protected void setModeNames(String[] names) { + modeNames = names; + } + + public String getModeName(int index) { + if (modeNames == null) { + return null; + } + return modeNames[index]; + } + + public int getModeByName(String mode) { + if (modeNames != null) { + for (int i = 0; i < modeNames.length; i++) { + if (mode.equals(modeNames[i])) return i; + } + } + try { + // If it is just an int it can be parsed! + System.out.println("Parsing as int: " + mode); + int modei = Integer.parseInt(mode); + return modei; + } catch (Exception e) { + } + return -1; + } + public abstract String getName(); public abstract int getModeMax(); } Modified: mspsim/se/sics/mspsim/core/MSP430Constants.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-04-18 22:39:21 UTC (rev 246) @@ -44,6 +44,19 @@ public interface MSP430Constants { public static final String VERSION = "0.90"; + + // MODES + public static final int MODE_ACTIVE = 0; + public static final int MODE_LPM0 = 1; + public static final int MODE_LPM1 = 2; + public static final int MODE_LPM2 = 3; + public static final int MODE_LPM3 = 4; + public static final int MODE_LPM4 = 5; + public static final int MODE_MAX = MODE_LPM4; + + public static String[] MODE_NAMES = { + "active", "lpm0", "lpm1", "lpm2", "lpm3", "lpm4" + }; public static final int CLK_ACLK = 1; public static final int CLK_SMCLK = 2; Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-18 22:39:21 UTC (rev 246) @@ -55,14 +55,6 @@ public static final int INTERNAL_IO_SIZE = 3; public static final int PORTS = 6; - public static final int MODE_ACTIVE = 0; - public static final int MODE_LPM0 = 1; - public static final int MODE_LPM1 = 2; - public static final int MODE_LPM2 = 3; - public static final int MODE_LPM3 = 4; - public static final int MODE_LPM4 = 5; - private static final int MODE_MAX = MODE_LPM4; - // 16 registers of which some are "special" - PC, SP, etc. public int[] reg = new int[16]; @@ -129,7 +121,7 @@ public MSP430Core(int type) { // Ignore type for now... - + setModeNames(MODE_NAMES); // Internal Active IOUnits int passIO = 0; int actIO = 0; Added: mspsim/se/sics/mspsim/extutil/jfreechart/JFreeWindowDataHandler.java =================================================================== --- mspsim/se/sics/mspsim/extutil/jfreechart/JFreeWindowDataHandler.java (rev 0) +++ mspsim/se/sics/mspsim/extutil/jfreechart/JFreeWindowDataHandler.java 2008-04-18 22:39:21 UTC (rev 246) @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2007, 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: $ + * + * ----------------------------------------------------------------- + * + * JFreeWindowDataHandler + * + * Author : Joakim Eriksson + * Created : 18 apr 2008 + * Updated : $Date:$ + * $Revision:$ + */ +package se.sics.mspsim.extutil.jfreechart; + +import javax.swing.JComponent; + +import org.jfree.data.general.Series; + +import se.sics.mspsim.cli.AbstractWindowDataHandler; + +/** + * @author joakim + * + */ +public abstract class JFreeWindowDataHandler extends AbstractWindowDataHandler { + + + public abstract int getDataSeriesCount(); + public abstract Series getDataSeries(int index); + + /* (non-Javadoc) + * @see se.sics.mspsim.cli.AbstractWindowDataHandler#setProperty(int, java.lang.String, java.lang.String[]) + */ + @Override + public void setProperty(int index, String param, String[] args) { + System.out.println("setProperty called!!! " + param); + if (index > getDataSeriesCount()) { + throw new IndexOutOfBoundsException("Illegal index: " + index); + } + if ("label".equals(param)) { + System.out.println("setting label to: " + args[0]); + getDataSeries(index).setKey(args[0]); + } + getComponent().revalidate(); + } + +} Added: mspsim/se/sics/mspsim/extutil/jfreechart/LineChart.java =================================================================== --- mspsim/se/sics/mspsim/extutil/jfreechart/LineChart.java (rev 0) +++ mspsim/se/sics/mspsim/extutil/jfreechart/LineChart.java 2008-04-18 22:39:21 UTC (rev 246) @@ -0,0 +1,148 @@ +/** + * 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: $ + * + * ----------------------------------------------------------------- + * + * LineChart + * + * Author : Joakim Eriksson + * Created : 17 apr 2008 + * Updated : $Date:$ + * $Revision:$ + */ +package se.sics.mspsim.extutil.jfreechart; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; + +import javax.swing.JComponent; +import javax.swing.JPanel; + +import org.jfree.chart.ChartPanel; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.DateAxis; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.renderer.xy.DefaultXYItemRenderer; +import org.jfree.data.general.Series; +import org.jfree.data.time.Millisecond; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.TimeSeriesCollection; +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; + +import se.sics.mspsim.cli.AbstractWindowDataHandler; + +/** + * @author joakim + * + */ +public class LineChart extends JFreeWindowDataHandler { + + JPanel panel; + private JFreeChart chart; + private XYSeriesCollection dataset; + private DefaultXYItemRenderer renderer = new DefaultXYItemRenderer(); + + public LineChart() { + NumberAxis domain = new NumberAxis("Time"); + NumberAxis range = new NumberAxis("Value"); + XYPlot xyplot = new XYPlot(); + xyplot.setDomainAxis(domain); + xyplot.setRangeAxis(range); + xyplot.setDataset(dataset = new XYSeriesCollection()); + xyplot.setRenderer(renderer); + + domain.setAutoRange(true); + domain.setAutoRangeIncludesZero(false); + domain.setLowerMargin(0.0); + domain.setUpperMargin(0.0); + domain.setTickLabelsVisible(true); + range.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); + chart = new JFreeChart("Data", JFreeChart.DEFAULT_TITLE_FONT, xyplot, true); + ChartPanel chartPanel = new ChartPanel(chart); + panel = new JPanel(); + panel.setLayout(new BorderLayout()); + panel.setPreferredSize(new Dimension(400, 200)); + panel.add(chartPanel, BorderLayout.CENTER); + + } + + @Override + public JComponent getComponent() { + return panel; + } + + public int getDataSeriesCount() { + return dataset.getSeriesCount(); + } + + public Series getDataSeries(int index) { + while (index >= dataset.getSeriesCount()) { + addSeries(); + } + return dataset.getSeries(index); + } + + public void setProperty(String param, String[] args) { + if ("title".equals(param)) { + chart.setTitle(args[0]); + } + } + + private void addSeries() { + XYSeries dataSeries = new XYSeries("series " + (getDataSeriesCount() + 1)); + dataSeries.setMaximumItemCount(200); +// renderer.setSeriesPaint(0, Color.black); + renderer.setSeriesShapesVisible(getDataSeriesCount(), false); + dataset.addSeries(dataSeries); + } + + int point = 0; + @Override + public void lineRead(String line) { + String parts[] = line.trim().split(" "); + while (parts.length > getDataSeriesCount()) { + addSeries(); + } + for (int i = 0; i < parts.length; i++) { + dataset.getSeries(i).add(point, atoi(parts[i], 0)); + } + point++; + panel.repaint(); + } + + @Override + public void setProperty(int index, String param, String[] args) { + super.setProperty(index, param, args); + } +} Modified: mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java =================================================================== --- mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/extutil/jfreechart/LineSampleChart.java 2008-04-18 22:39:21 UTC (rev 246) @@ -10,17 +10,19 @@ import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.DefaultXYItemRenderer; +import org.jfree.data.general.Series; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; import se.sics.mspsim.cli.AbstractWindowDataHandler; -public class LineSampleChart extends AbstractWindowDataHandler { +public class LineSampleChart extends JFreeWindowDataHandler { JPanel panel; private XYSeriesCollection dataset; private XYSeries dataSeries; - + private JFreeChart chart; + public LineSampleChart() { NumberAxis domain = new NumberAxis("Index"); NumberAxis range = new NumberAxis("Value"); @@ -41,7 +43,7 @@ domain.setTickLabelsVisible(true); range.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); - JFreeChart chart = new JFreeChart("Test", + chart = new JFreeChart("Test", JFreeChart.DEFAULT_TITLE_FONT, xyplot, true); ChartPanel chartPanel = new ChartPanel(chart); panel = new JPanel(); @@ -68,16 +70,23 @@ panel.repaint(); } + public void setProperty(String param, String[] args) { + if ("title".equals(param)) { + chart.setTitle(args[0]); + } + } + + public int getDataSeriesCount() { + return 1; + } + + public Series getDataSeries(int index) { + return dataSeries; + } + @Override public void setProperty(int index, String param, String[] args) { - if (index != 0) { - throw new IndexOutOfBoundsException("Illegal index: " + index); - } - if ("label".equals(param)) { - System.out.println("setting label to: " + args[0]); - dataSeries.setKey(args[0]); - } - panel.repaint(); - } + super.setProperty(index, param, args); + } } Modified: mspsim/se/sics/mspsim/util/OperatingModeStatistics.java =================================================================== --- mspsim/se/sics/mspsim/util/OperatingModeStatistics.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/util/OperatingModeStatistics.java 2008-04-18 22:39:21 UTC (rev 246) @@ -93,6 +93,18 @@ return getDataSource(chip, mode, OP_NORMAL); } + public DataSource getDataSource(String chip, String modeStr) { + StatEntry se = statistics.get(chip); + if (se != null) { + int mode = se.chip.getModeByName(modeStr); + if (mode != -1) { + return new StatDataSource(se, mode, OP_NORMAL); + } + } + return null; + } + + public DataSource getDataSource(String chip, int mode, int operation) { StatEntry se = statistics.get(chip); if (se != null) { Modified: mspsim/se/sics/mspsim/util/StatCommands.java =================================================================== --- mspsim/se/sics/mspsim/util/StatCommands.java 2008-04-17 08:40:24 UTC (rev 245) +++ mspsim/se/sics/mspsim/util/StatCommands.java 2008-04-18 22:39:21 UTC (rev 246) @@ -96,7 +96,7 @@ "<frequency> <chip> [chips...]") { private PrintStream out; - private MultiDataSource[] sources; + private Object[] sources; private double frequency; private boolean isRunning = true; @@ -106,12 +106,22 @@ context.err.println("illegal frequency: " + context.getArgument(0)); return 1; } - sources = new MultiDataSource[context.getArgumentCount() - 1]; + sources = new Object[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; + String sName = context.getArgument(i + 1); + if (sName.indexOf('.') >= 0) { + String[] parts = sName.split("\\."); + sources[i] = statistics.getDataSource(parts[0], parts[1]); + if (sources[i] == null) { + context.err.println("could not find chip / mode combination " + context.getArgument(i + 1)); + return 1; + } + } else { + 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; @@ -123,11 +133,16 @@ if (isRunning) { cpu.scheduleTimeEventMillis(this, 1000.0 / frequency); for (int j = 0, n = sources.length; j < n; j++) { - MultiDataSource ds = sources[j]; + Object s = 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)); + if (s instanceof MultiDataSource) { + MultiDataSource ds = (MultiDataSource) s; + for (int k = 0, m = ds.getModeMax(); k <= m; k++) { + if (k > 0) out.print(' '); + out.print(ds.getValue(k)); + } + } else { + out.print(((DataSource)s).getValue()); } } out.println(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-05-10 21:24:05
|
Revision: 274 http://mspsim.svn.sourceforge.net/mspsim/?rev=274&view=rev Author: joxe Date: 2008-05-10 14:23:16 -0700 (Sat, 10 May 2008) Log Message: ----------- some cleanup Modified Paths: -------------- mspsim/se/sics/mspsim/core/DisAsm.java mspsim/se/sics/mspsim/core/MSP430Constants.java mspsim/se/sics/mspsim/core/MSP430Core.java mspsim/se/sics/mspsim/core/Timer.java mspsim/se/sics/mspsim/platform/GenericNode.java mspsim/se/sics/mspsim/util/NetworkConnection.java Modified: mspsim/se/sics/mspsim/core/DisAsm.java =================================================================== --- mspsim/se/sics/mspsim/core/DisAsm.java 2008-05-10 21:12:16 UTC (rev 273) +++ mspsim/se/sics/mspsim/core/DisAsm.java 2008-05-10 21:23:16 UTC (rev 274) @@ -384,10 +384,11 @@ opstr = "AND" + (word ? ".W" : ".B"); break; default: - System.out.println(output + " DoubleOperand not implemented: " + - op + " instruction: " + - Utils.binary16(instruction) + " = " + - Utils.hex16(instruction)); + if (startPC > 0x200) + System.out.println(output + " DoubleOperand not implemented: " + + op + " instruction: " + + Utils.binary16(instruction) + " = " + + Utils.hex16(instruction)); } Modified: mspsim/se/sics/mspsim/core/MSP430Constants.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-05-10 21:12:16 UTC (rev 273) +++ mspsim/se/sics/mspsim/core/MSP430Constants.java 2008-05-10 21:23:16 UTC (rev 274) @@ -43,7 +43,7 @@ public interface MSP430Constants { - public static final String VERSION = "0.90"; + public static final String VERSION = "0.91"; public static final int RESET_PUC = 0; public static final int RESET_POR = 1; Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-05-10 21:12:16 UTC (rev 273) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-05-10 21:23:16 UTC (rev 274) @@ -534,7 +534,6 @@ if (interrupt > interruptMax) { interruptMax = interrupt; if (interruptMax == 15) { - System.out.println("Triggering reset IRQ!!!!!"); // This can not be masked at all! interruptsEnabled = true; } @@ -662,7 +661,7 @@ interruptMax = -1; if (servicedInterrupt == 15) { - System.out.println("**** Servicing RESET! => " + Utils.hex16(pc)); +// System.out.println("**** Servicing RESET! => " + Utils.hex16(pc)); internalReset(); } Modified: mspsim/se/sics/mspsim/core/Timer.java =================================================================== --- mspsim/se/sics/mspsim/core/Timer.java 2008-05-10 21:12:16 UTC (rev 273) +++ mspsim/se/sics/mspsim/core/Timer.java 2008-05-10 21:23:16 UTC (rev 274) @@ -319,9 +319,6 @@ case TCCR6: i = (index - TCCR0) / 2; val = tccr[i]; - if (i == 2) { - System.out.println("Read CCR2: " + val); - } break; default: System.out.println("Not supported read, returning zero!!!"); @@ -441,7 +438,7 @@ triggerInterrupts(); - if (DEBUG || index == 2) { + if (DEBUG) { System.out.println(getName() + " Write: CCTL" + index + ": => " + Utils.hex16(data) + " CM: " + capNames[capMode[index]] + @@ -614,10 +611,6 @@ // Write the expected capture time to the register (counter could // differ slightly) tccr[i] = expCompare[i]; - if (i == 2) { - updateCounter(cycles); - System.out.println("CCR2 set to: " + tccr[i] + " should be " + counter); - } // Update capture times... for next capture expCompare[i] = (expCompare[i] + expCapInterval[i]) & 0xffff; expCaptureTime[i] += expCapInterval[i] * cyclesMultiplicator; Modified: mspsim/se/sics/mspsim/platform/GenericNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/GenericNode.java 2008-05-10 21:12:16 UTC (rev 273) +++ mspsim/se/sics/mspsim/platform/GenericNode.java 2008-05-10 21:23:16 UTC (rev 274) @@ -112,6 +112,12 @@ cpu.reset(); setupNode(); + if (args.length > 1) { + MapTable map = new MapTable(args[1]); + cpu.getDisAsm().setMap(map); + registry.registerComponent("mapTable", map); + } + if (!config.getPropertyAsBoolean("nogui", false)) { // Setup control and other UI components ControlUI control = new ControlUI(registry); @@ -119,11 +125,6 @@ // sourceViewer.addSearchPath(new File("../../contiki-2.x/examples/energest-demo/")); control.setSourceViewer(sourceViewer); } - if (args.length > 1) { - MapTable map = new MapTable(args[1]); - cpu.getDisAsm().setMap(map); - registry.registerComponent("mapTable", map); - } registry.start(); } Modified: mspsim/se/sics/mspsim/util/NetworkConnection.java =================================================================== --- mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-05-10 21:12:16 UTC (rev 273) +++ mspsim/se/sics/mspsim/util/NetworkConnection.java 2008-05-10 21:23:16 UTC (rev 274) @@ -162,12 +162,8 @@ Socket socket = new Socket("127.0.0.1", port); connections.add(new ConnectionThread(socket)); } catch (UnknownHostException e) { - // TODO Auto-generated catch block - e.printStackTrace(); return false; } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); return false; } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |