📄 vlog_ref_body.html
字号:
<td width="76%">(1_output, 1_input, 1_control)</td>
</tr>
<tr>
<td width="12%"><font color="#FF0000"><code>cmos</code></font></td>
<td width="12%"><font color="#FF0000"><code>rcmos</code></font></td>
<td width="76%">(1_output, 1_input, n_control, p_control)</td>
</tr>
<tr>
<td width="12%"><font color="#FF0000"><code>tran</code></font></td>
<td width="12%"><font color="#FF0000"><code>rtran</code></font></td>
<td width="76%">(2_bidirectional-inouts)</td>
</tr>
<tr>
<td width="12%"><font color="#FF0000"><code>tranif0<br>
rtranif0</code></font></td>
<td width="12%"><font color="#FF0000"><code>rtranif0<br>
rtranif1</code></font></td>
<td width="76%">(2_bidirectional-inouts, 1_control)</td>
</tr>
</table>
</center></div>
<p> </p>
<div align="center"><center>
<table border="1" cellspacing="1" cellpadding="4" width="710" BGcolor="#FFFFFF">
<tr>
<td><p align="center"><a name="Primitive Delay Syntax"><b>Primitive Delay Syntax</b></a></td>
</tr>
<tr>
<td><font color="#FF0000"><code>#</code></font><a href="#prim_delay">delay</a> or <font color="#FF0000"><code>#(</code></font><a href="#prim_delay">delay</a><font color="#FF0000"><code>)</code></font><br>
Single delay for all output transitions</td>
</tr>
<tr>
<td><font color="#FF0000"><code>#(</code></font><a href="#prim_delay">delay</a><font color="#FF0000"><code>,</code></font> <a href="#prim_delay">delay</a><font color="#FF0000"><code>)</code></font><br>
Separate delays for (rising, falling) transitions</td>
</tr>
<tr>
<td><font color="#FF0000"><code>#(</code></font><a href="#prim_delay">delay</a><font color="#FF0000"><code>,</code></font> <a href="#prim_delay">delay</a><font color="#FF0000"><code>,</code></font>
<a href="#prim_delay">delay</a><font color="#FF0000"><code>)</code></font><br>
Separate delays for (rising, falling, turn-off) transitions</td>
</tr>
<tr>
<td><font color="#FF0000"><code>#(</code></font><a href="#prim_delay">min_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">typ_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">max_delay</a><font color="#FF0000"><code>)</code></font><br>
Minimum to maximum range of delays for all transitions</td>
</tr>
<tr>
<td><font color="#FF0000"><code>#(</code></font><a href="#prim_delay">min_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">typ_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">max_delay</a><font color="#FF0000"><code>,</code></font> <a href="#prim_delay">min_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">typ_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">max_delay</a><font color="#FF0000"><code>)</code></font><br>
Min. to max. range of delays for (rising, falling) transitions</td>
</tr>
<tr>
<td><font color="#FF0000"><code>#(</code></font><a href="#prim_delay">min_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">typ_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">max_delay</a><font color="#FF0000"><code>,</code></font> <a href="#prim_delay">min_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">typ_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">max_delay</a><font color="#FF0000"><code>,</code></font> <a href="#prim_delay">min_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">typ_delay</a><font color="#FF0000"><code>:</code></font><a href="#prim_delay">max_delay</a><font color="#FF0000"><code>)</code></font><br>
Min. to max. range of delays for (rising, falling, turn-off) transitions</td>
</tr>
</table>
</center></div>
<p> </p>
<p><a name="prim_delay"><font color="#0000FF"><i>delay</i></font></a> (optional)
represents the propagation delay through a primitive. The default delay is zero. Integers
or real numbers may be used.</p>
<p><a name="prim_strength"><font color="#0000FF"><i>strength</i></font></a> (optional) is
specified as <font color="#FF0000"><code>(</code></font><font color="#00AA00"><i>strength1</i></font><font color="#FF0000"><code>,</code></font> <font color="#00AA00"><i>strength0</i></font><font color="#FF0000"><code>)</code></font> or <font color="#FF0000"><code>(</code></font><font color="#00AA00"><i>strength0</i></font><font color="#FF0000"><code>,</code></font> <font color="#00AA00"><i>strength1</i></font><font color="#FF0000"><code>)</code></font> Refer
to <a href="#4.6 Logic Strengths">Logic Strengths</a> for strength keywords.<br>
<ul type="disc">
<li>Only gate primitives may have drive strength specified. Switch primitives pass the input
strength to the output. Resistive switches reduce the strength as it passes through.</li>
</ul>
<p><a name="prim_instance_name"><font color="#0000FF"><i>instance_name</i></font></a>
(optional) may used to reference specific primitives in debugging tools, schematics, etc.</p>
<p><a name="prim_instance_array_range"><font color="#0000FF"><i>instance_array_range</i></font></a>
(optional) instantiates multiple primitives, each instance connected to separate bits of a
vector.<br>
<ul type="disc">
<li>The range is specified as <font color="#FF0000"><code>[</code></font><font color="#00AA00"><i>lhi</i></font><font color="#FF0000"><code>:</code></font><font color="#00AA00"><i>rhi</i></font><font color="#FF0000"><code>]</code></font>
(left-hand-index to right-hand-index).</li>
<li>The primitive instances are connected with the right-most instance index connected to
the right-most bit of each vector, and progressing towards the left.</li>
<li>Vector signals must be the same size as the array.</li>
<li>Scalar signals are connected to all instances in the array.</li>
</ul>
<p> </p>
<div align="center"><center>
<table border="1" cellspacing="1" cellpadding="4" width="500" BGcolor="#E0E0E0">
<tr>
<td width="50%"><p align="center"><b>Primitive Instance Examples</b></td>
<td width="50%"><p align="center"><b>Notes</b></td>
</tr>
<tr>
<td width="50%"><font color="#00AA00"><code>and i1 (out,in1,in2);</code></font></td>
<td width="50%">zero delay gate primitive</td>
</tr>
<tr>
<td width="50%"><font color="#00AA00"><code>and #5 (o,i1,i2,i3,i4);</code></font></td>
<td width="50%">same delay for all transitions</td>
</tr>
<tr>
<td width="50%"><font color="#00AA00"><code>not #(2,3) u7(out,in);</code></font></td>
<td width="50%">separate rise & fall delays</td>
</tr>
<tr>
<td width="50%"><font color="#00AA00"><code>buf (pull0,strong1)(y,a);</code></font></td>
<td width="50%">output drive strengths model ECL</td>
</tr>
<tr>
<td width="50%"><font color="#00AA00"><code>wire [31:0] y, a;<br>
buf #2.7 i[31:0] (y,a);</code></font></td>
<td width="50%">array of 32 buffers</td>
</tr>
</table>
</center></div>
<p> </p>
<hr>
<h3><a name="10.0 Procedural Blocks"><font color="#0000FF">10.0 Procedural Blocks</font></a></h3>
<div align="center"><center>
<table border="1" cellspacing="1" cellpadding="4" width="400" BGcolor="#FFFFFF">
<tr>
<td><p align="center"><b>Syntax</b></td>
</tr>
<tr>
<td><pre>
<a href="#type_of_block">type_of_block</a> <font color="#FF0000"><code>@(</code></font><a href="#sensitivity_list">sensitivity_list</a><font color="#FF0000"><code>)</code></font>
<a href="#statement_group">statement_group</a><font color="#FF0000"><code>:</code></font> <a href="#group_name">group_name</a>
<a href="#local_variable_declarations">local_variable_declarations</a>
<a href="#timing_control">timing_control</a> <a href="#procedural_statement">procedural_statements</a>
<a href="#end_of_statement_group">end_of_statement_group</a>
</pre>
</td>
</tr>
</table>
</center></div>
<p> </p>
<p><font color="#0000FF"><em><a name="type_of_block">type_of_block</a></em></font> is
either <font color="#FF0000"><code>initial</code></font> or <font color="#FF0000"><code>always</code></font><br>
<ul type="disc">
<li><font color="#FF0000"><code>initial</code></font> procedural blocks process statements
one time.</li>
<li><font color="#FF0000"><code>always</code></font> procedural blocks process statements
repeatedly.</li>
</ul>
<p><font color="#0000FF"><em><a name="sensitivity_list">sensitivity_list</a></em></font>
(optional) is an event timing control that controls when all statements in the procedural
block will start to be evaluated. The sensitivity list is used to model combinational and
sequential logic behavior.</p>
<p><font color="#0000FF"><i><a name="statement_group">statement_group</a>--<a name="end_of_statement_group">end_of_statement_group</a></i></font> is used to group two
or more procedural statements together and control the execution order.<br>
<ul type="disc">
<li><font color="#FF0000"><code>begin</code></font>--<font color="#FF0000"><code>end</code></font>
groups two or more statements together sequentially, so that statements are evaluated in
the order they are listed. Each timing control is relative to the previous statement.</li>
<li><font color="#FF0000"><code>fork</code></font>--<font color="#FF0000"><code>join</code></font>
groups two or more statements together in parallel, so that all statements are evaluated
concurrently. Each timing control is absolute to when the group started.</li>
</ul>
<p><a name="group_name"><font color="#0000FF"><i>group_name</i></font></a> (optional)
creates a local scope in a statement group. Named groups may have local variables, and may
be disabled with the <font color="#FF0000"><code>disable</code></font> keyword.</p>
<p><a name="local_variable_declarations"><font color="#0000FF"><i>local_variable_declarations</i></font></a>
(optional) must be a register data type (may only be declared in named statement groups).</p>
<p><a name="timing_control"><font color="#0000FF"><i>timing_control</i></font></a> is used
to control when statements in a procedural block are executed. Refer to Procedural Timing</p>
<p><a name="procedural_statement"><font color="#0000FF"><i>procedural_statement</i></font></a>
is a <a href="#10.2 Procedural Assignments">procedural assignment</a> to a register
variable or a <a href="#10.3 Programming Statements">programming statement</a>.</p>
<div align="center"><center>
<table border="1" cellspacing="1" cellpadding="4" width="600" BGcolor="#E0E0E0">
<tr>
<td width="40%"><p align="center"><b>Procedural Block Examples</b></td>
<td width="60%"><p align="center"><b>Notes</b></td>
</tr>
<tr>
<td width="40%"><font color="#00AA00"><code><pre>
initial
fork
bus = 16'h0000;
#10 bus = 16'hC5A5;
#20 bus = 16'hFFAA;
join
</code></font></pre>
</td>
<td width="60%">initial procedure executes statements one time; The fork--join group
places statements in parallel.</td>
</tr>
<tr>
<td width="40%"><font color="#00AA00"><code><pre>
always @(a or b or ci)
begin
sum = a + b + ci;
end
</code></font></pre>
</td>
<td width="60%">always procedure executes statements repeatedly.</td>
</tr>
<tr>
<td width="50%"><font color="#00AA00"><code><pre>
always @(posedge clk)
q <= data; </pre></code></font></pre>
</td>
<td width="50%">a statement group is not required when there is only one statement</td>
</tr>
</table>
</center></div>
<p> </p>
<hr>
<h4><a name="10.1 Timing Controls"><font color="#0000FF">10.1 Timing Controls</font></a></h4>
<dl>
<dt><font color="#FF0000"><code>#</code></font><font color="#00AA00"><i>delay</i></font><br>
</dt>
<dd>Delays execution for a specific amount of time. The delay may be a literal number, a
variable, or an expression.<br>
</dd>
<dt><font color="#FF0000"><code>@(</code></font><i><font color="#00AA00">edge</font> <font color="#00AA00">signal</font></i> <font color="#FF0000"><code>or</code></font> <i><font color="#00AA00">edge</font> <font color="#00AA00">signal</font></i> <font color="#FF0000"><code>or</code></font>
... <font color="#FF0000"><code>)</code></font><br>
</dt>
<dd>Delays execution until there is a logic transition on a signal.<br>
<ul type="disc">
<li><font color="#0000FF"><i>edge</i></font> (optional) maybe either <font color="#FF0000"><code>posedge</code></font>
or <font color="#FF0000"><code>negedge</code></font>. If no edge is specified, then any
logic transition is used.</li>
<li><font color="#FF0000"><code>or</code></font> is used to specify events on any of several
signals.</li>
<li><font color="#0000FF"><i>signal</i></font> may be scalar or vector, and any data type.</li>
</ul>
</dd>
<dt><font color="#FF0000"><code>wait (</code></font><font color="#00AA00"><i>expression</i></font><font color="#FF0000"><code>)</code></font><br>
</dt>
<dd>Delays execution until the expression evaluates as true. </dd>
</dl>
<hr>
<h4><a name="10.2 Procedural Assignments"><font color="#0000FF">10.2 Procedural
Assignments</font></a></h4>
<dl>
<dt><font color="#00AA00"><i>register_data_type</i></font> <font color="#FF0000"><code>=</code></font>
<font color="#00AA00"><i>expression</i></font><font color="#FF0000">;</font><br>
</dt>
<dd>Blocking procedural assignment. Expression is evaluated and assigned when the statement
is encountered. In a <font color="#FF0000"><code>begin--end</code></font> sequential
statement group, execution of the next statement is blocked until the assignment is
complete. In the sequence <font color="#00AA00"><code>begin m=n; n=m; end</code></font>,
the 1st assignment changes m before the 2nd assignment evaluates m.<br>
</dd>
<dt><font color="#00AA00"><i>register_data_type</i></font> <font color="#FF0000"><code><=</code></font>
<font color="#00AA00"><i>expression</i></font><font color="#FF0000">;</font><br>
</dt>
<dd>Non-blocking procedural assignment. E
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -