9-5-6: ALS Models
The model entity is headed by a model declaration statement and followed by a body which references instances of other entities, lower in the hierarchy. The model name and a list of exports (which are referenced in a higher level model description) are included in this statement. The format of the model declaration statement is:
|Format:||model name(signal1, signal2, signal3, ... signalN)|
|Example:||model dff(d, ck, set, reset, q, q_bar)|
References to instances of primitive objects (gates and functions) and lower level models are used to describe the topology of the model to the simulator. The format of an instance reference statement is:
|Format:||instance : model ( signal1, signal2, signal3, ... signalN )|
|Example:||gate1: subgate(input, en, mix)|
It should be noted each instance reference in a model entity must have a unique instance name. The following is an example of the use of a model entity:
This example contains the description of a simple latch. When the enable signal is asserted high (en=H, en_bar=L) the input data passes through the transmission gate (gate1) and then through two inverters where it eventually reaches the output. When enable is asserted low (en=L, en_bar=H) the input connection is broken and the feedback transmission gate (gate2) is turned on.
The set statement is used to initialize signals in the model description to specific logic states before the simulation starts. This feature is useful for tying unused inputs to power(H) or ground(L).
|Previous||Table of Contents||Next|