This is an old revision of the document!


prsim: Production rule simulation

Before using prsim to simulate a set of production rules, they must first be flattened using aflat. Assuming your production rules are in a file called circuit.act, you would run:

aflat circuit.act > circuit.prs
prsim circuit.prs

This will give you an interactive (Prsim) prompt. Type help to get a list of simulation commands.

Standard Test Script

When running prsim, it is good practice to use a test .act file that looks something like this:

import "circuit.act";
...
... // your test setup

bool Reset;

prs {
   Reset -> Vdd+
   Reset -> GND-
   Reset => _Reset-
}

In this example, I've assumed that the circuit reset signals are the global variables Reset and _Reset. You should use the appropriate signals for your circuit there. The nice thing about this setup is that you can have a prsim script file that looks something like this:

random
set Reset 1
cycle
status U
... // watch various things
set Reset 0
cycle