Assume that the file "current.rbs" contains the following:
Name Domain Range ---------------------------------------- mult <.1,.1> .2 add <.1,.1> .3 inc .2 .4 ---------------------------------------- Directions - < in,out> ~ out Wiring - <.1,.4> ~ <.3> Inputs - .1To simulate, type the command below to assign to the input wire ".1" specified in the last line of the above program the following simulation data: the integer 2 at cycle 0, the real number 4.6 at cycle 1, and the symbol "x" at cycle 2:
re "2 ; 4.6 ; x"and the following simulation result will be shown, where the "~" symbol separates the inputs and the output:
Simulation start : 0 - <2,5> ~ <4> 1 - <4.6,22.16> ~ <9.2> 2 - < x,(inc (x * x))> ~ <(x + x)> Simulation end :This three-cycle trace shows the expected behaviour of the circuit. Note that symbolic inputs (such as "x" above) result in symbolic outputs (such as "(x+x)"), while numerical inputs (such as "4.6") result in numerical outputs (such as "9.2").
Simulation inputs can be supplied from a file rather than from the command line. If the file test.input contains the following,
2 ; 4.6 ; xthen the command
re -f test.inputwill produce the same simulation trace as above. To find out the command line options for the simulator, type
re -h