1
<HTML><HEAD><TITLE>Using Electric 10-4: Behavioral Models (ALS)</TITLE></HEAD>
2
<BODY BGCOLOR="#FFFFFF">
3
<!-- PAGE BREAK --><A NAME="chap10-04"></A>
5
<BR><CENTER><FONT SIZE=6><B>Chapter 10: SIMULATION</B></FONT></CENTER><BR>
6
<CENTER><TABLE WIDTH="90%" BORDER=0><TR>
7
<TD><CENTER><A HREF="chap10-03.html#chap10-03"><IMG SRC="../images/iconplug.png" ALT="plug" BORDER=0></A></CENTER></TD>
8
<TD><CENTER><H2>10-4: Behavioral Models (ALS)</H2></CENTER></TD>
9
<TD><CENTER><A HREF="chap10-05.html#chap10-05"><IMG SRC="../images/iconplug.png" ALT="plug" BORDER=0></A></CENTER></TD></TR></TABLE></CENTER>
12
When the VHDL for a circuit is compiled into a netlist, both connectivity and behavior are included.
13
This is because the netlist format is hierarchical,
14
and at the bottom of the hierarchy are behavioral primitives.
15
Electric knows the behavioral primitives for MOS transistors, AND, OR, NAND, NOR, Inverter, and XOR gates.
16
Other primitives can be defined by the user, and all of the existing primitives can be redefined.
18
To create (or redefine) a primitive's behavior, simply create the "netlist"
19
view of the cell with that primitive's name.
20
Use the <B>Edit Facet...</B> command of the <B>Facets</B> menu and select the "netlist-als-format" view.
21
For example, to define the behavior of an ALU facet, edit "alu{net-als}",
22
and to redefine the behavior of a two-input And gate, edit "and2{net-als}".
23
The compiler copies these textual facets into the netlist description whenever that node is referenced in the VHDL.
25
A library that contains only behavioral models can be built and kept separately from the current library.
26
To identify that library as the location of behavioral models,
27
use the <B>Select Behavioral Library...</B> subcommand of the <B>VHDL Compiler</B> command of the <B>Tools</B> menu.
29
The netlist format provides three different types of defining entities:
30
<I>model</I>, <I>gate</I>, and <I>function</I>.
31
The model entity describes interconnectivity between other entities.
32
It describes the hierarchy and the topology.
33
The gate and function entities are at the primitive level.
34
The gate uses a truth-table and the function makes reference to C-coded behavior
35
(which must be compiled into Electric, see the module "simalsuser.c").
36
Both primitive entities also allow the specification of operational parameters such as switching speed,
37
capacitive loading and propagation delay.
38
(The simulator determines the capacitive load, and thus the event switching delay,
39
of each node of the system by considering the capacitive load of each primitive connected to a node as well as taking into account feedback paths to the node.)
41
A sample netlist describing an RS latch model is shown below:
43
<CENTER><TABLE><TR><TD><CENTER><IMG SRC="../images/chap10-03.png" ALT="Figure 10.3"></CENTER></TD><TD>
44
The model declaration for the figure is as follows:
46
model main(set, reset, q, q_bar)
47
inst1: nor2(reset, q_bar, q)
48
inst2: nor2(q, set, q_bar)
50
The gate description of the nor2 is as follows:
52
gate nor2(in1, in2, out)
53
t: delta=4.5e-9 + linear=5.0e-10
54
i: in1=L in2=L o: out=H@2
59
</TD></TR></TABLE></CENTER>
61
When combined, these entities represent a complete description of the circuit.
62
Note that when a gate, function, or other model is referenced within a model description,
63
there is a one-to-one correspondence between the signal names listed at the calling site and the signal names contained in the header of the called entity.
66
<CENTER><TABLE BORDER=0><TR>
67
<TD><A HREF="chap10-03.html#chap10-03"><IMG SRC="../images/iconbackarrow.png" ALT="Prev" BORDER=0></A></TD>
68
<TD><A HREF="chap10-03.html#chap10-03">Previous</A></TD>
69
<TD> </TD>
70
<TD><A HREF="../index.html"><IMG SRC="../images/iconcontarrow.png" ALT="Contents" BORDER=0></A></TD>
71
<TD><A HREF="../index.html">Table of Contents</A></TD>
72
<TD> </TD>
73
<TD><A HREF="chap10-05.html#chap10-05">Next</A></TD>
74
<TD><A HREF="chap10-05.html#chap10-05"><IMG SRC="../images/iconforearrow.png" ALT="Next" BORDER=0></A></TD>
75
</TR></TABLE></CENTER>