Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
intro_example:inverter [2025/05/01 13:28] – [Simulating with prsim] rajitintro_example:inverter [2025/05/01 13:32] (current) – [Simulating with prsim] rajit
Line 109: Line 109:
 After this command, all delays are randomized. This is a useful test to see if your production rules are stable and non-interfering. If ''prsim'' finds that a production rule is unstable, it sets its output to ''X'' (for undefined). These ''X''s can propagate through the circuit. After this command, all delays are randomized. This is a useful test to see if your production rules are stable and non-interfering. If ''prsim'' finds that a production rule is unstable, it sets its output to ''X'' (for undefined). These ''X''s can propagate through the circuit.
  
-===== Simulating with prsim =====+===== Simulating with actsim =====
  
-The complete example is:+ACTSIM is setup to simulate processes by default. We recommend having a top-level process that is used for testing purposes. In this setup, the complete example is:
  
 <code act> <code act>
Line 121: Line 121:
  
  
-inverter inv;+defproc test() 
 +
 +  inverter inv; 
 +}
 </code> </code>
  
- +If the file above is called ''test_inv.act'', we can start the simulation using:
-If the file above is called ''test_inv.act'', a production rule file can be created from the ACT file by:+
  
 <code> <code>
-aflat test_inv.act > test_inv.prs+actsim -p test  test_inv.act
 </code> </code>
  
-The output file is the following:+Note that we don't need to generate the flattened production rule file, which could be quite large. We can simulate this as follows:
  
 <code> <code>
-"inv.i"->"inv.out"+actsimwatch inv.i 
-~"inv.i"->"inv.out"+ +actsimwatch inv.o 
-</code+actsimstatus X 
- +inv { o } 
-Note that ACT uses ''.'' (like standard programming languages) as a separator between the name of the instance and internal nodes within it. (Note that magic, irsim use ''/'' as a separator; Xyce uses colon)+actsim> set inv.i 0 
- +                  0] <[env]> inv.i := 0 
-If the file is saved as ''test_inv.prs'', it can be simulated using the production rule simulator called ''[[tools:prsim|prsim]]''.  +actsim> cycle 
- +[                  10] <inv inv.o := 1 
-<code> +actsim> set inv.i 1 
-% prsim test_inv.prs     +[                  10] <[env]> inv.i := 
- +actsim> cycle 
-(Prsim) initialize  +[                  20] <inv>  inv.o := 0
-(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+
 </code> </code>
  
-''prsim'' will check if the production rules being run are stable (i.e. hazard/glitch-free) and non-interfering (i.e. that pull-up and pull-down networks are not on simultaneously). It doesn't check all possible delay configurations, but just reports errors if it observes unstable or interfering production rules while the simulation is running. Try ''help'' as a ''prsim'' command to see the range of commands supported by ''prsim.''+''actsim'' will check if the production rules being run are stable (i.e. hazard/glitch-free) and non-interfering (i.e. that pull-up and pull-down networks are not on simultaneously). It doesn't check all possible delay configurations, but just reports errors if it observes unstable or interfering production rules while the simulation is running. Try ''help'' as a ''actsim'' command to see the range of commands supported by ''actsim''.
  
-One of the useful features of ''prsim'' is that it can automatically randomize the delays of production rule firings. To do this, use+One of the useful features of ''actsim'' is that it can automatically randomize the delays of production rule firings. To do this, use
  
 <code> <code>
-(Prsim) random+actsim> random
 </code> </code>
  
-After this command, all delays are randomized. This is a useful test to see if your production rules are stable and non-interfering. If ''prsim'' finds that a production rule is unstable, it sets its output to ''X'' (for undefined). These ''X''s can propagate through the circuit.+After this command, all delays are randomized. This is a useful test to see if your production rules are stable and non-interfering. If ''actsim'' finds that a production rule is unstable, it sets its output to ''X'' (for undefined). These ''X''s can propagate through the circuit.