Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tools:prsim [2019/04/18 14:59]
rajit [General]
tools:prsim [2022/06/22 06:58] (current)
rajit [Running Simulation]
Line 27: Line 27:
 </code> </code>
  
-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:+In this example, I've assumed that the circuit reset signals are the global variables ''Reset'' and ''_Reset'', and that both ''Vdd'' and ''GND'' are defined as globals for the power supplies. 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:
  
 <code> <code>
Line 51: Line 51:
 read in a script file and execute the commands within read in a script file and execute the commands within
  
-<code>save <file></code> 
-save a simulation checkpoint to the specified file 
- 
-<code>restore <file></code> 
-restore simulation from a checkpoint 
  
 ==== Timing ==== ==== Timing ====
Line 77: Line 72:
 ==== Running Simulation ==== ==== Running Simulation ====
  
-<code>mode reset|run|unstab|nounstab</code>+<code>mode reset|run</code>
 set current running mode. set current running mode.
 ^ Mode ^ Effect ^ ^ Mode ^ Effect ^
-| ''reset''/''run'' | ''reset'' turns off weak interference warnings (node still becomes X) and ''run'' turns them on +| ''reset'' | ''reset'' turns off weak interference warnings (node still becomes X). During chip initialization, there can be weak interference since the simulator assumes all nodes are initially X. Setting the mode to ''reset'' during the reset phase prevents these warnings from being printed to the screen. 
-| ''unstab''/''nounstab''''unstab'' marks all nodes as possibly unstable, turning of the instability warnings (node still becomes X), ''nounstab'' turns them on |+| ''run''Warnings of weak interference are enabled. This should be the standard mode after the reset phase has completed. | 
  
 <code>initialize</code> <code>initialize</code>
Line 115: Line 111:
 <code>assert <variable> <value></code> <code>assert <variable> <value></code>
 assert that the node, bus, or vector <variable> is <value> assert that the node, bus, or vector <variable> is <value>
- 
-<code>seu <node> 0|1|X <start-delay> <dur></code> 
-Delayed SEU event on node lasting for <dur> units 
  
 <code>uget <n></code> <code>uget <n></code>
 get value of node <n> but report its canonical name get value of node <n> but report its canonical name
 +
 +<code>set_principal <n></code>
 +select <n> as the canonical name for a node
  
 <code>watch <n></code> <code>watch <n></code>
Line 130: Line 126:
 <code>watchall</code> <code>watchall</code>
 watch all nodes watch all nodes
 +
 +==== Debug ====
 +
 +<code>status 0|1|X [[^]str]</code>
 +list all nodes with specified value, optional prefix/string match
 +
 +<code>pending</code>
 +print the prsim pending event queue
 +
 +<code>alias <node></code>
 +list all of the name aliases for <node>
 +
 +<code>fanin <node></code>
 +print the production rules that drive <node>
 +
 +<code>fanin-get <node></code>
 +print the production rules that drive <node> with the values of each expression and node in the guards evaluated.
 +
 +<code>fanout <node></code>
 +print the set of nodes for which <node> appears in the guard of a driving production rule
 +
 +<code>chk-save <file></code>
 +save a simulation checkpoint to <file>
 +
 +<code>chk-restore <file></code>
 +restore simulation state from a checkpoint
 +
 +==== Tracing ====
 +
 +<code>dumptc <file></code>
 +dump transition counts for nodes to <file>
 +
 +<code>pairtc</code>
 +turns on <input/output> pair transition counts
 +
 +<code>trace <file> <time></code>
 +Create atrace file for <time> duration
 +
 +<code>timescale <t></code>
 +set time scale to <t> picoseconds for tracing
 +
 +==== ACT Attributes for simulation ====
 +
 +Attributes can be added to production rules specified in ACT as follows:
 +<code>
 +    prs {
 +      [after=20] a & b #> c-
 +    }
 +</code>
 +
 +Attributes currently recognized by ''prsim'' are:
 +
 +^ Attribute ^ Meaning ^
 +| after | used to set the delay in simulation time units for the production rule firing in non-random timing mode |
 +| weak | if there is a ''weak'' attribute, it means the production rule has a weak drive and can be overridden by a stronger production rule during simulation |
 +| unstab | if there is an ''unstab'' attribute, it means that the production rule may be unstable. ''prsim'' will suppress instability reporting on such rules |
 +
 +===== Large Files =====
 +
 +The output of ''aflat'' can be very large, and designs with millions of gates can easily generate multi-gigabyte output files. To reduce the file size, the ''prspack'' command compresses the output of ''aflat'' by taking all the signal names in the production rule file ASCII output and converting them into an integer, saving all the names in the file on disk in a separate //names file//. To use this, say:<code>
 +   aflat circuit.act | prspack table > circuit.packprs
 +</code>
 +This creates a packed production rule file, as well as a number of files called ''table_idx.dat'', ''table_str.dat'', ''table_alias.dat'', and ''table_rev.dat''. These files are used to store alias information, strings, and hash tables to make it easy to access the names in the packed production rule output. These files can be used by ''prsim'' as follows:<code>
 +   prsim -n table circuit.packprs
 +</code>
 +The ''-n'' command line argument specifies where ''prsim'' can find all the signal names from the production rule file.
 +
 +