From 667f6ebf878dab895d9ee2c5c7aa6e875692da9c Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr> Date: Mon, 8 Jun 2009 13:45:38 +0000 Subject: [PATCH] command-line simulation: new commands --- src/remotesimulation/CommandParser.java | 21 +++++++++++++++ .../InteractiveSimulationActions.java | 16 ++++++++++- .../JFrameInteractiveSimulation.java | 9 +++++++ .../MainCommandsToolBar.java | 27 +++++++++++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) diff --git a/src/remotesimulation/CommandParser.java b/src/remotesimulation/CommandParser.java index 47b7d7fff9..f869ae9412 100755 --- a/src/remotesimulation/CommandParser.java +++ b/src/remotesimulation/CommandParser.java @@ -219,6 +219,17 @@ public class CommandParser { sc = new SimulationCommand("get-command-of-task", "gcot", "14", params, paramNames, "Returns the current command of the task provided as argument"); commandList.add(sc); + // get-benchmark + params = new int[2]; + paramNames = new String[2]; + params[0] = 1; + paramNames[0] = "0: show benchmark; 1:save in file"; + params[1] = 0; + paramNames[1] = "Name of file"; + sc = new SimulationCommand("get-benchmark", "gb", "10", params, paramNames, "Returns information on hardware nodes of the architecture"); + commandList.add(sc); + + // get-hash-code params = new int[0]; paramNames = new String[0]; @@ -410,6 +421,16 @@ public class CommandParser { paramNames = new String[0]; sc = new SimulationCommand("stop", "stop", "15", params, paramNames, "Stops the currently running simulation"); commandList.add(sc); + + // write-in-channel + params = new int[2]; + paramNames = new String[2]; + params[0] = 1; + paramNames[0] = "Channel ID"; + params[1] = 2; + paramNames[1] = "Nb of samples"; + sc = new SimulationCommand("write-in-channel", "wic", "6", params, paramNames, "Writes y samples / events to channel / event x"); + commandList.add(sc); } diff --git a/src/ui/interactivesimulation/InteractiveSimulationActions.java b/src/ui/interactivesimulation/InteractiveSimulationActions.java index 118000cb68..1cabd20288 100755 --- a/src/ui/interactivesimulation/InteractiveSimulationActions.java +++ b/src/ui/interactivesimulation/InteractiveSimulationActions.java @@ -65,6 +65,13 @@ public class InteractiveSimulationActions extends AbstractAction { public static final int ACT_RUN_X_TRANSACTIONS = 8; public static final int ACT_RUN_X_COMMANDS = 9; + public static final int ACT_RUN_EXPLORATION = 20; + public static final int ACT_RUN_TO_NEXT_BUS_TRANSFER = 21; + public static final int ACT_RUN_UNTIL_CPU_EXECUTES = 22; + public static final int ACT_RUN_UNTIL_TASK_EXECUTES = 23; + public static final int ACT_RUN_UNTIL_MEMORY_ACCESS = 24; + public static final int ACT_RUN_UNTIL_CHANNEL_ACCESS = 25; + public static final int ACT_SAVE_VCD = 10; public static final int ACT_SAVE_HTML = 11; public static final int ACT_SAVE_TXT = 12; @@ -82,7 +89,7 @@ public class InteractiveSimulationActions extends AbstractAction { public static final int ACT_UPDATE_BUS = 18; public static final int ACT_UPDATE_TASKS = 19; - public static final int NB_ACTION = 20; + public static final int NB_ACTION = 26; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -130,6 +137,13 @@ public class InteractiveSimulationActions extends AbstractAction { actions[ACT_RUN_X_TRANSACTIONS] = new TAction("run-x-transactions", "Run x transactions", IconManager.imgic1306, IconManager.imgic1306, "Run x transactions", "Run simulation for x transactions. Works only if the simulator is \"ready\"", 'R'); actions[ACT_RUN_X_COMMANDS] = new TAction("run-x-commands", "Run x commands", IconManager.imgic1308, IconManager.imgic1308, "Run x commands", "Run simulation for x commands. Works only if the simulator is \"ready\"", 'R'); + actions[ACT_RUN_X_EXPLORATION] = new TAction("run-exploration", "Run exploration", IconManager.imgic1308, IconManager.imgic1308, "Run exploration", "Explore branches of the simulation", 'R'); + actions[ACT_RUN_TO_NEXT_BUS_TRANSFER] = new TAction("run-until-bus-transfer", "Run until bus transfer", IconManager.imgic1308, IconManager.imgic1308, "Run until transfer on bus", "Run until a transfer on the indicated bus is performed. Works only if the simulator is \"ready\"", 'R'); + actions[ACT_RUN_UNTIL_CPU_EXECUTES] = new TAction("run-to-cpu", "Run until CPU executes", IconManager.imgic1308, IconManager.imgic1308, "Run until CPU executes", "Run until a CPU, given as parameter, executes. Works only if the simulator is \"ready\"", 'R'); + actions[ACT_RUN_UNTIL_TASK_EXECUTES] = new TAction("run-to-task", "Run until a task executes", IconManager.imgic1308, IconManager.imgic1308, "Run until a task executes", "Run until a task executes. Works only if the simulator is \"ready\"", 'R'); + actions[ACT_RUN_UNTIL_MEMORY_ACCESS] = new TAction("run-to-memory-accessd", "Run until a memory access is performed", IconManager.imgic1308, IconManager.imgic1308, "Run until a memory access is performed", "Run simulation until a memory access is performed on selected memory. Works only if the simulator is \"ready\"", 'R'); + actions[ACT_RUN_UNTIL_CHANNEL_ACCESS] = new TAction("run--to-channel-access", "Run until a channel is accessed", IconManager.imgic1308, IconManager.imgic1308, "Run until a channel is accessed", "Run until a channel is accessed. Works only if the simulator is \"ready\"", 'R'); + actions[ACT_SAVE_VCD] = new TAction("save-vcd", "Save trace in VCD format", IconManager.imgic1310, IconManager.imgic1310, "Save trace in VCD format", "Save trace in VCD format", 'R'); actions[ACT_SAVE_HTML] = new TAction("save-html", "Save trace in HTML format", IconManager.imgic1312, IconManager.imgic1312, "Save trace in HTML format", "Save trace in HTML format", 'R'); actions[ACT_SAVE_TXT] = new TAction("save-txt", "Save trace in TXT format", IconManager.imgic1314, IconManager.imgic1314, "Save trace in TXT format", "Save trace in TXT format", 'R'); diff --git a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java index 61949dae23..e1b2127fc7 100755 --- a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java +++ b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java @@ -1243,6 +1243,13 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene actions[InteractiveSimulationActions.ACT_RESTORE_STATE].setEnabled(b); actions[InteractiveSimulationActions.ACT_SAVE_TXT].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_NEXT_BUS_TRANSFER].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CPU_EXECUTES].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_TASK_EXECUTES].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_MEMORY_ACCESS].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CHANNEL_ACCESS].setEnabled(b); + } public static String decodeString(String s) { @@ -1576,6 +1583,8 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene sendCommandWithPositiveInt("run-x-transactions"); } else if (command.equals(actions[InteractiveSimulationActions.ACT_RUN_X_COMMANDS].getActionCommand())) { sendCommandWithPositiveInt("run-x-commands"); + } else if (command.equals(actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION].getActionCommand())) { + sendCommand("run-exploration"); } else if (command.equals(actions[InteractiveSimulationActions.ACT_SAVE_VCD].getActionCommand())) { sendSaveTraceCommand("0"); } else if (command.equals(actions[InteractiveSimulationActions.ACT_SAVE_HTML].getActionCommand())) { diff --git a/src/ui/interactivesimulation/MainCommandsToolBar.java b/src/ui/interactivesimulation/MainCommandsToolBar.java index 9929e71f8c..ca4cefac1d 100755 --- a/src/ui/interactivesimulation/MainCommandsToolBar.java +++ b/src/ui/interactivesimulation/MainCommandsToolBar.java @@ -65,6 +65,12 @@ public class MainCommandsToolBar extends InteractiveSimulationBar { jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_TIME].setEnabled(b); jfis.actions[InteractiveSimulationActions.ACT_RUN_X_TRANSACTIONS].setEnabled(b); jfis.actions[InteractiveSimulationActions.ACT_RUN_X_COMMANDS].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_NEXT_BUS_TRANSFER].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CPU_EXECUTES].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_TASK_EXECUTES].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_MEMORY_ACCESS].setEnabled(b); + jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CHANNEL_ACCESS].setEnabled(b); jfis.actions[InteractiveSimulationActions.ACT_STOP_SIMU].setEnabled(b); jfis.actions[InteractiveSimulationActions.ACT_RESET_SIMU].setEnabled(b); } @@ -99,6 +105,27 @@ public class MainCommandsToolBar extends InteractiveSimulationBar { button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_X_COMMANDS]); button.addMouseListener(jfis.mouseHandler); + this.addSeparator(); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION]); + button.addMouseListener(jfis.mouseHandler); + + this.addSeparator(); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_NEXT_BUS_TRANSFER]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CPU_EXECUTES]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_TASK_EXECUTES]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_MEMORY_ACCESS]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CHANNEL_ACCESS]); + button.addMouseListener(jfis.mouseHandler); } -- GitLab