Next: , Previous: View Commands, Up: Commands


3.7 modes Commands

This section lists commands that affect the execution of the simulation.

— Command: checkexcl
— Command: nocheckexcl

Enables mutual exclusion checking for checked exclusive node rings. Checking is enabled by default. Users of old prsim should replace uses of CHECK_CHANNELS with these commands.

— Command: eval-order [mode]

With no argument, reports the current evaluation ordering mode. With mode (either inorder or random), fanouts are evaluated either in a pre-determined order, or in random order. Random ordering is useful for emulating random arbitration among fanouts of the same node. Default mode is inorder.

Timing mode.

— Command: timing [mode] [args]

Modes: ‘uniformdelay applies the same delay to all rules. uniform is useful for getting quick transition counts. ‘random’ gives every event a different randomly assigned delay. random is most useful for detecting non-QDI logic violations. ‘after’ applies a different delay for each rule, as determined by the after PRS rule attribute. binary and bounded modes are most useful for testing that certain timing assumptions (path races) are necessary.

The after_min and after_max rule attributes only have any effect in random mode or on nodes marked always_random. In random-mode, after_min specifies a lower bound on delay, and after_max specifies an upper bound on delay. When no upper bound is specified, the delay distribution is an exponential variate; when an upper bound is specified, a delay is generated with uniform distribution between the bounds. If only a lower bound is specified, its value is added to the exponentially distribtued random delay.

Timing random also takes additional optional arguments for default min and max delays for unspecified rules; user-written values from the source will always take precedence. A max delay value of 0 is interpreted as being unbounded.

Timing binary randomly chooses a min or max delay value with a specified probability, like a skewed coin-flip. Specifying both min and max values is required X:Y. This mode completely disregards any user-specified delay attributes in the source, including delay after=0.

Timing bounded randomly chooses a min or max delay value with a specified probability, like a skewed coin-flip. Specifying both min and max values is required X:Y. Unlike binary mode, bounded delays are overridden by user-specified delay attributes after_min and after_max.

— Command: random

Deprecated, but retained for legacy compatibility. Synonymous with ‘timing random’.

— Command: norandom

Deprecated, but retained for legacy compatibility. Synonymous with ‘timing uniform’.

— Command: seed48 [int int int]

Corresponds to libc's seed48 function. With no argument, print the current values of the internal random number seed. With three (unsigned short) integers, sets the random number seed. Note: the seed is automatically saved and restored in checkpoints. The seed value is reset to 0 0 0 with the reset command, but not with the initialize command.

The simulator now supports weak rules which can drive un-pulled nodes but always yield to normal rules. Weak rules are marked with the [weak=1] production rule attribute. The use of weak-rules can be globally enabled or disabled.

— Command: weak-rules [on|off|show|hide]

Simulation mode switch which globally enables or disables (ignores) weak-rules. Weak-rules can only take effect when normal rules pulling a node are off. The hide and show options control whether or not weak rules are displayed in rule queries, such as fanin, fanout, and rules.

Diagnostic controls. The following commands control the simulation policy for run-time logic violations. Allowed arguments are: ignore, warn, notify, and break. ignore silently ignores violations. notify is the same as warn, which prints a diagnostic message without interrupting the simulation. break reports an error and stops the simulation. When no argument is given, just reports the current policy.

— Command: unstable [mode]

Set the simulator policy in the event of an instability. A rule is unstable when it is enqueued to fire, but a change in the input literal/expression stops the rule from firing. Stability is a requirement of quasi-delay insensitive circuits. Default mode is break.

— Command: weak-unstable [mode]

Set the simulator policy in the event of a weak-instability. A rule is weakly-unstable when it is enqueued to fire, but a change in the input literal (to X, unknown) may stop the rule from firing. Default mode is warn.

— Command: excl-unstable [mode]

Set the simulator policy in the event of an excl-instability, one that is caused by enforcement of force-exclusion rings. Default mode is warn.

— Command: interference [mode]

Set the simulator policy in the event of interference. A rule is interfering when it is fighting an opposing (up/down) firing rule. Interference will always put the conflicting node into an unknown state. Non-interference is a requirement of quasi-delay insensitive circuits. Default mode is break.

— Command: weak-interference [mode]

Set the simulator policy in the event of weak-interference. A rule is weakly interfering when may fight an opposing (up/down) firing rule. Weak-interference will put the conflicting node into an unknown state. Default mode is warn.

— Command: invariant-fail [mode]

Set the error-handling policy for certain invariant violations, when an invariant expression evaluates to false.

— Command: invariant-unknown [mode]

Set the error-handling policy for possible invariant violations, i.e. when an invariant expression evaluates to X.

— Command: assert-fail [mode]

Set the error-handling policy for when the assert command fails.

— Command: channel-expect-fail [mode]

Set the error-handling policy for when the a channel encounters a value different from was expected.

— Command: checkexcl-fail [mode]

Set the error-handling policy for when an exclusion check fails.

— Command: keeper-check-fail [mode]

Set the error-handling policy for when an exclusion check fails.

— Command: mode [md]

Without arguments, reports the current simulation policies on logic violations. With argument md, run is the default set of policies, reset is only different in that weak-unstable is ignored. reset is useful during the initalization phase, when some rules may transiently and weakly interfere, as they come out of unknown state. paranoid causes the simulation to break on weak-instabilities and weak-interferences, which is useful for debugging. fatal causes the simulation to exit immediate with non-zero exit status, which is useful for non-interactive batch testing. Caution: fatal also causes the following diagnostic conditions to exit fatally: invariant-fail, invariant-unknown, assert-fail, channel-expect-fail, excl-check-fail

policy default reset run paranoid fatal
interference break break break break fatal
weak-interference warn ignore warn break fatal
unstable break break break break fatal
weak-unstable warn warn warn break fatal
assert-fail fatal - - - fatal
excl-check-fail fatal - - - fatal
channel-expect-fail fatal - - - fatal
invariant-fail break - - - fatal
invariant-unknown warn - - - fatal

Two additional commands control the behavior of unstable rules. These are particularly useful for simulating circuits that expect to glitch, such as synchronous (clocked) circuits.

— Command: unstable-unknown

When set, this causes unstable rules to be result in an unknown value on the output node. The opposite effect is the unstable-dequeue command.

— Command: unstable-dequeue

When set, this causes unstable rules to be dequeued from the event queue. The opposite effect is the unstable-unknown command. This option also allows events that drive a node to 'X' in the queue to be overtaken and replaced with known values if the fanin pull of the node is resolved to a non-interfering direction before the 'X' event on the node is dequeued.

Instabilities that are caused by force-exclusion rings are treated with their own corresponding options.

— Command: excl-unstable-unknown

When set, this causes rules that are cancelled by force-exclusive rings to transition to an unknown value on the output node. The opposite effect is the excl-unstable-dequeue command.

— Command: excl-unstable-dequeue

When set, this causes unstable rules due to force-exclusion to be dequeued from the event queue. The opposite effect is the excl-unstable-unknown command.

Some additional commands are available for examining and controlling some internal lookup table caching. Most users won't need to worry about these.

— Command: frame-cache-half-life [int]

Sets the period (in event count) at which the internal cache of footprint frames (lookup-tables) should be aged.

— Command: frame-cache-halve

Manually age the cache, as if a half-life period elapsed. One typically never needs to do this unless the memory usage has gone out of hand. The output reports the total amount of weight lost in the cache, which is meaningless unless you know how the cache works.

— Command: frame-cache-dump

Print the contents of the global footprint-frame cache. Really only intended for memory diagnostics.