Actsim: an ACT simulator

To run actsim, you need to select the ACT file to simulate and the top-level process for your design:

% actsim file.act process

A simple example

The following ACT file is a CHP example that sends three integers on an output channel, and connects that process to one that simply receives an integer and displays it to the screen.

defproc my_source (chan!(int) X)
   chp {
      X!0; X!4; X!3 
defproc my_sink (chan?(int) X)
   int x;
   chp {
      *[ X?x; log ("received ", x) ]
defproc test()
    my_source s;
    my_sink t(s.X);

A simple simulation can be run as follows:

% actsim simple.act test
WARNING: my_sink<>: substituting chp model (requested prs, not found)
WARNING: my_source<>: substituting chp model (requested prs, not found)
actsim> cycle
[                  10] <t>  received 0
[                  20] <t>  received 4
[                  30] <t>  received 3
actsim> quit

actsim was started by specifying the simple.act file as the design input, and test as the top-level process for the simulation. When actsim started, two warnings were displayed that say that actsim was looking for prs models for the circuit, but found a chp model instead which it substituted. ACT can specify circuits at different levels of abstraction using sub-languages, and the simulator has to select one of them. This warning can be turned off using one of the standard ACT command-line options as follows:

% actsim -Wlang_subst:off simple.act test
actsim> cycle
[                  10] <t>  received 0
[                  20] <t>  received 4
[                  30] <t>  received 3
actsim> quit

The cycle command will run the simulation until there is nothing left to simulate. The log command is used to display output messages; when the circuit is implemented, all log commands in CHP are replaced by skip. The message displayed has three parts:

  • The first part is the current simulation time displayed in square brackets. By default, every event takes ten time units. (This can be modified by specifying delay parameters in a configuration file.)
  • The next part is the name of the instance, in angle brackets. Here the log message was generated by my_sink instance t.
  • The final part is the actual text from the log command




display a list of commands with short descriptions



source <file>

read in a script file and execute the commands within


random [<min> <max>]

Set the random timing mode and optionally specify the default random timing bounds for all nodes.

random_seed <seed>

set the seed for the random timing mode.


Set the deterministic timing mode.

random_choice on|off

turn on/off random exclhi/lo firings

Running Simulation

mode reset|run

set current running mode.

Mode Effect
reset reset turns off weak interference warnings (node still becomes X). During chip initialization, there can be weak interference since the simulator assumes all nodes are initially X. Setting the mode to reset during the reset phase prevents these warnings from being printed to the screen.
run Warnings of weak interference are enabled. This should be the standard mode after the reset phase has completed.
initialize <proc>

initialize the simulation with the specified process as the top-level.

step [<steps>]

simulate <steps> events (default is 1)

advance [<duration>]

simulate for <duration> units of simulation time (default is 1)


simulate until there is nothing more to simulate.

break <variable>
breakpt <variable>

set a breakpoint on <variable>.


toggles the break-on-warn flag which stops/doesn't stop simulation on instability or interference


like break-on-warn, but exits prsim

Setting/Getting Values

set <variable> <value>

set <variable> to specified <value>

get <variable> [#f]

get value of <variable>. This returns the value in addition to displaying it. If the optional argument is provided and set to #f, then the value is returned without displaying it to the screen.

watch <n1> <n2> ...

add watchpoints for <n1>, <n2>, etc.

unwatch <n1> <n2> ...

delete watchpoints for <n1>, <n2>, etc.

timescale <ps>

Set the conversion from integer time units to picoseconds for simulation tracing. By default the conversion is 10ps, but this default can be changed by updating the simulation configuration file.

vcd_start <flle>

Create a VCD file that contains all the variables that are currently watched. The timescale is used for the time reported in the VCD output.


Stop VCD file generation.


status 0|1|X

list all nodes with specified value


Stop the simulation when a warning is generated


Quit simulation on a warning


Don't stop/exit simulation when a warning is generated

(Work in progress; try running help on the command-line)

Configuration file