Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
intro_example:standard_sim [2025/05/14 18:28] – rajit | intro_example:standard_sim [2025/05/14 18:40] (current) – rajit | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
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. '' | 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. '' | ||
Line 31: | Line 31: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | In this example, we use the '' | ||
+ | can be used to generate a sequence of data outputs whose values are provided by an array passed as a template parameter. | ||
Running this produces the following result: | Running this produces the following result: | ||
Line 44: | Line 47: | ||
[ 140] < | [ 140] < | ||
[ 140] < | [ 140] < | ||
+ | </ | ||
+ | |||
+ | Instead of using a hard-coded set of values in the the test environment, | ||
+ | <code act> | ||
+ | sim:: | ||
+ | 0 /* file ID */, | ||
+ | false /* don't loop file contents */, | ||
+ | 0 /* source ID */, | ||
+ | false /* turn off verbose logs */> | ||
+ | t1(b.I); | ||
+ | </ | ||
+ | instead of a '' | ||
+ | |||
+ | <file txt _infile_.0> | ||
+ | 0x493 | ||
+ | 0x29 | ||
+ | 0x3 | ||
+ | 4 | ||
+ | </ | ||
+ | |||
+ | The result is: | ||
+ | < | ||
+ | $ actsim -p test etest.act | ||
+ | WARNING: source_file< | ||
+ | WARNING: buffer<>: | ||
+ | WARNING: sink< | ||
+ | actsim> cycle | ||
+ | [ 50] < | ||
+ | [ 70] < | ||
+ | [ 90] < | ||
+ | [ 110] < | ||
+ | [ 110] < | ||
</ | </ |