Although the models are useful as-is, they are also considered as examples for how to model digital logic elements. The base models can be extended or simplified as needed.
To use these models, include (by-reference) $CSIM_MODEL_LIBS/digilogic/Library.sim in your top-level diagram.
Digi-Logic models are provided at several abstraction levels.
All the simple logic gates have two parameters: Inertial Delay and Propagation Delay. These are defaulted to 0.01 and 0.09, respectively. The defaults may be overridden globally under Edit/Variable in the GUI, and/or on a module or instance basis under the object's properties dialog.
Inertial Delay is the amount of time that an input must be stable before it can affect an eventual output. It basically dampens transients. It is analogous to the similar property of actual logic gates, and is the same as the Inertial-Delay quantity in VHDL. For example, suppose both inputs of an or gate have been zero (low), and a spike of infinitesimal duration raises and lowers one input. Without inertia, the spike would appear on the output after the propagation delay. However due to inertia, the spike will not appear on the output. (You can set this property to zero, if not wanted, but the transient-dampening effect benefits overall simulation speed.)
Propagation Delay is the time-delay for an output to appear after the inertial delay for an input change. In VHDL, this is called the Transfer-Delay.
It has one (optional) parameter: InitialValue. This is useful for setting signals to known initial states (eg. 0 or 1). By default, the parameter is set to -1, which means unknown or hi-Z, in which case it does *not* drive any signal initially, but waits until the first valid input arrives.
You could also use this model to join two of more signals, but the circuit analogy is not always clear in this mode. (Circuit analogy: Multiple output-drivers shorted together.) The changes of any input port will be sent to all output ports.
Title = Test of Master Slave FlipFlop delay 1e-20 ! Small initial delay assures all models are ready. Clk 0 ! Zero out the inputs initially. R 0 S 0 delay 0.2 ! Wait a small time. R 1 ! Apply reset and clock pulse. Clk 1 delay 0.2 R 0 ! Lower reset and clock. Clk 0 delay 0.6 S 1 ! Apply Set and clock pulse. Clk 1 delay 0.2 Clk 0 delay 0.2 S 0 delay 0.8 Clk 1 ! Toggle clock to see that values are held. delay 1 Clk 0 delay 1 R 1 Clk 1 delay 0.5 Clk 0 delay 2 S 1 ! Try toggling Set and Reset when clock is low, delay 1 ! to see what happens. S 0 delay 2 R 1 delay 1 R 0 Mark Red ! Mark the end of the main test. delay 1 Clk 1 delay 1 ! Let the clock run out ... Clk 0 S 0 R 0 R 0 delay 1