This is an old revision of the document!
Standard simulation environments
Simulating CHP programs often requires creating an environment to inject data into the circuit being tested, and an environment that reads the outputs of the circuit to check their values. actsim
comes with a simulation library that has some common functionality that can be used for this purpose.
import sim; defproc buffer(chan?(int) I; chan!(int) O) { int x; chp { *[ I?x; O!(x+2) ] } } defproc test() { buffer b; sim::source_sequence<32, 4, {1,5,8,53}, false, 0, false> t1(b.I); sim::sink<32, 0, true> t2(b.O); }