Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
intro_example:inverter [2020/04/29 14:38] rajit |
intro_example:inverter [2020/12/02 01:00] 127.0.0.1 external edit |
||
---|---|---|---|
Line 51: | Line 51: | ||
</ | </ | ||
- | What can we do with this ACT file? The simplest thing is to simulate the inverter using a production-rule simulator. We have provided '' | + | Next, we can simulate the inverter using a production-rule simulator. We have provided '' |
+ | |||
+ | ===== Simulating with prsim ===== | ||
+ | |||
+ | The complete example is: | ||
+ | |||
+ | < | ||
+ | defproc inverter (bool? i; bool! o) | ||
+ | { | ||
+ | prs { | ||
+ | i => o- | ||
+ | } | ||
+ | } | ||
+ | |||
+ | inverter inv; | ||
+ | </ | ||
+ | |||
+ | |||
+ | If the file above is called '' | ||
+ | |||
+ | < | ||
+ | % aflat test_inv.act > test_inv.prs | ||
+ | </ | ||
+ | |||
+ | The output file is the following: | ||
+ | |||
+ | < | ||
+ | " | ||
+ | ~" | ||
+ | </ | ||
+ | |||
+ | Note that ACT uses '' | ||
+ | |||
+ | If the file is saved as '' | ||
+ | |||
+ | < | ||
+ | % prsim test_inv.prs | ||
+ | |||
+ | (Prsim) initialize | ||
+ | (Prsim) watch inv.i | ||
+ | (Prsim) watch inv.o | ||
+ | (Prsim) status X | ||
+ | (Prsim) set inv.i 0 | ||
+ | (Prsim) cycle | ||
+ | (Prsim) set inv.i 1 | ||
+ | (Prsim) cycle | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | One of the useful features of '' | ||
+ | |||
+ | < | ||
+ | (Prsim) random | ||
+ | </ | ||
+ | |||
+ | After this command, all delays are randomized. This is a useful test to see if your production rules are stable and non-interfering. If '' | ||