The simulator of DIPLODOCUS intends to simulate a DIPLODOCUS mapping, taking into account functional tasks, the system architectures (CPU, buses, etc.) and the allocations of tasks and their communucations to the system architecture
The first step is to create a DIPLODOCUS mapping. Once the mapping
model has been checked against syntax errors , it
is possible to generate a C++ code
that represents the mapping
model. If you are using a model in TTool, then the code is generated by
default in TTool/simulators/c++2 for models. If your model has been made
in a project, then the code is generated into the “c++_code”
subdirectory of your project.
The second step is to compile the code. You can directly do it from TTool with the code generation window, second tab. Another option is to open a terminal, and to enter the following command:
$ make
The third tab of the simulation code generation window provides several options to start the simulator, e.g. either running simulation until completion or running the server in interactive mode. For the latter, the simulator is started in server mode, and TTool connects via sockets to the server in order to remotely drive the simulation.
Once the simulator has been compiled, do as follows to list possible options:
$ ./run.x -help
Basically, options are used to express the working mode
(-server
for interactive mode, -explo
to
generate a reachability graphs, …), to set the output (e.g.,
-gpath
or finally to set commands to be executed, either
from the command line (-cmd
) or from a file
(-file
). For instance:
$ ./run.x -cmd '1 6 100 ; 3 Task1 ; 1 0 ; 3 Task1'
means 'run-to-time 100 ; get-variable-of-task Task1 ; run-to-next-breakpoint ; get-variable-of-task Task1'
(Using the corresponding code instead of the command name when running in command line mode)
The parameters types are defined as follow:
Type = 0: "";
Type = 1: <Int>;
Type = 2: <String>;
Type = 3: [Int];
Type = 4: [String];
Type = 6: [int between 0 and 100 (percentage);
Not defined: <unknow param>
Command name | Alias | Code | Description | Parameter 1 | Parameter 2 | Parameter 3 | Parameter 4 | Parameter 5 |
---|---|---|---|---|---|---|---|---|
active-breakpoints | ab | 20 | Active / unactive breakpoints | [Type: 1] 0/1 (unactive / active) | - | - | - | - |
add-breakpoint | abp | 11 | Set a breakpoint in task which id is the first parameter on the command provided as the second parameter | [Type: 1] task ID | [Type: 0] comamnd ID | - | - | - |
calculate-latencies | cl | 23 | Calculate latencies between checkpoints | [Type: 1] Checkpoint 1 id | [Type: 1] Checkpoint2 id | - | - | - |
choose-branch | cb | 12 | Chooses the branch of the given command of a task | [Type: 1] task ID | [Type: 0] command ID | [Type: 0] branch ID | - | - |
get-breakpoint-list | gbl | 18 | Returns the list of breakpoints currently set | - | - | - | - | - |
get-command-of-task | gcot | 14 | Returns the current command of the task provided as argument | [Type: 0] Task id (or “all”) | - | - | - | - |
get-benchmark | gb | 10 | Returns information on hardware nodes of the architecture | [Type: 1] 0: show benchmark, 1:save in file | [Type: 0] Name of file | - | - | - |
get-executed-operators | geo | 21 | Returns the list of executed operators | - | - | - | - | - |
get-hashcode | gh | 19 | Returns the hashcode of the tmap under simulation | - | - | - | - | - |
get-info-on-hw | gioh | 4 | Returns information on hardware nodes of the architecture | [Type: 1] 0: CPU, 1:Bus, 2: Mem, 3: Bridge, 4: Channel, 5: Task | [Type: 1] id | - | - | - |
get-numer-of-branches | gnob | 17 | Returns the number of branches the current command has | - | - | - | - | - |
get-simulation-time | time | 13 | Returns the current absolute time unit of the simulation | - | - | - | - | - |
get-variable-of-task | gvof | 3 | Returns the value of a variable in a task | [Type: 0] Task id | [Type: 0] Variable id | - | - | - |
kill | kill | 0 | Terminates the remote simulator | - | - | - | - | - |
list-transactions | lt | 22 | Get the most recent transactions | [Type: 2] Max. nb of transactions | - | - | - | - |
list-all-transactions-of-a-task | lat | 25 | Get all transactions of Task | [Type: 2] Task Name | - | - | - | - |
remove-all-trans | rmat | 26 | Remove all the transactions in the past | [Type: 1] Yes : 1, No : 0 | - | - | - | - |
rm-breakpoint | rmb | 16 | Remove a breakpoint in task which id is the first parameter on the command provided as the second parameter | [Type: 1] task ID | [Type: 0] comamnd ID | - | - | - |
reset | reset | 2 | Resets the remote simulator | - | - | - | - | - |
raw-command | rc | Sends a raw command to the remote simulator | [Type: 4] param #0 | [Type: 4] param #1 | [Type: 4] param #2 | [Type: 4] param #3 | [Type: 4] param #4 | |
restore-simulation-state-from-file | rssff | 9 | Restores the simulation state from a file | [Type: 2] File name | - | - | - | - |
run-exploration | re | 1 7 | Runs the simulation in exploration mode | [Type: 6] Minimum number of explored commands | [Type: 6] Minimum number of explored branches | [Type: 2] File name of the resulting graph, with NO extension | - | - |
run-to-next-breakpoint | rtnb | 1 0 | Runs the simulation until a breakpoint is met | - | - | - | - | - |
run-to-next-breakpoint-max-trans | rtnbmt | 1 19 | Runs the simulation until a breakpoint is met or max number of transactions are executed | [Type: 1] max nb of transactions | - | - | - | - |
run-to-next-transfer-on-bus | rtntob | 1 8 | Runs to the next transfer on bus which id is provided as argument | [Type: 1] bus id | - | - | - | - |
run-to-time | rtt | 1 5 | Runs the simulation until time x is reached | [Type: 1] x: time value | - | - | - | - |
run-until-channel-access | ruca | 1 12 | Run simulation until a operation is performed on the channel which ID is provided as parameter | [Type: 1] Channel id | - | - | - | - |
run-until-write-on-channel-access | ruwca | 1 17 | Run simulation until a write operation is performed on the channel which channel name is provided as parameter | [Type: 2] Channel name | - | - | - | - |
run-until-read-on-channel-access | rurca | 1 18 | Run simulation until a read operation is performed on the channel which chanel name is provided as parameter | [Type: 2] Channel name | - | - | - | - |
run-until-cpu-executes | ruce | 1 9 | Run simulation until CPU which ID is provided as parameter executes | [Type: 1] CPU id | - | - | - | - |
run-until-memory-access | ruma | 1 11 | Run simulation until the memory which ID is provided as parameter is accessed | [Type: 1] Memory id | - | - | - | - |
run-until-task-executes | rute | 1 10 | Run simulation until the task which ID is provided as parameter executes | [Type: 1] Task id | - | - | - | - |
run-x-commands | rxcomm | 1 4 | Runs the simulation for x commands | [Type: 1] nb of commands | - | - | - | - |
run-x-time-units | rxtu | 1 6 | Runs the simulation for x units of time | [Type: 1] nb of time units | - | - | - | - |
run-x-transactions | rxtr | 1 2 | Runs the simulation for x transactions | [Type: 1] nb of transactions | - | - | - | - |
save-simulation-state-in-file | sssif | 8 | Saves the current simulation state into a file | [Type: 2] File name | - | - | - | - |
save-trace-in-file | stif | 7 | Saves the current trace of the simulation in a VCD, HTML, TXT or XML file | [Type: 1] File format: 0-> VCD, 1->HTML, 2->TXT, 3->XML | [Type: 2] File name | - | - | - |
show-timeline-trace | stlt | 7 4 | Show the current timeline diagram trace in HTML format | [Type: 2] Task List | [Type: 1] Scale idle time: 0 -> no, 1 -> yes | [Type: 2] Start Time | [Type: 2] End Time | - |
set-variable | sv | 5 | Set the value of a variable | [Type: 1] task ID | [Type: 1] variable ID | [Type: 1] variable value | - | - |
stop | stop | 15 | Stops the currently running simulation | - | - | - | - | - |
write-in-channel | wic | 6 | Writes y samples / events to channel / event x | [Type: 2] Channel ID or Channel name | [Type: 2] Nb of samples | - | - | - |
add-virtual-signals | avs | 1 16 | Send virtual events to channel | [Type: 2] Channel name | [Type: 2] Nb of samples | [Type: 2] value of samples | - | - |
save-status-in-file | ssif | 27 | Saves the current status into a file | [Type: 2] File name | - | - | - | - |
save-time-in-file | stf | 28 | Saves the current time into a file | [Type: 2] File name | - | - | - | - |
read-from-channel | rfc | 29 | Reads y samples from channel x | [Type: 2] Channel ID or Channel name | [Type: 2] Nb of samples | - | - | - |
remove-virtual-signals | rvs | 30 | Remove virtual events from channel | [Type: 2] Event name | [Type: 2] Nb of samples | - | - | - |
The VCD trace gives: - The execution of a given core of a CPU (value “1”) or the fact that the core is idle (value “0”) - Transaction on busses: value “1” for a transaction, value “0” for no transaction - State of tasks. Value “11” means RUNNING, value “10” means RUNNABLE, value “01” means SUSPENDED, and value “00” means TERMINATED.