Is a signal in VHDL supposed to mean that we have a source in the
entity somewhere. Can there be any Verilog analogy to the signal in
VHDL
I fear the discussion has become a little confused
and bogged-down in details of style.
Verilog and VHDL, as simulation languages, have very
different notions of "signal" and "driver".
There is NO obvious analogy between VHDL and Verilog
simulation semantics, although you can (with care) get
both languages to do the same things for you.
However, whe writing RTL (synthesisable) code, you can
easily achieve equivalence between Verilog and VHDL.
Within a VHDL process you can make assignments to
two different kinds of thing: signals and variables.
Signals can be seen by other processes, but variables
are local to the process and cannot be seen outside
the process. Signals have delayed update, variables
update immediately. So here's how you mimic exactly
that in Verilog, WHEN YOU ARE CODING SYNTHESISABLE LOGIC:
VHDL signal:
~~~~~~~~~~~~
Use a Verilog variable that's declared at the top level
of a module. In an "always" block, make assignments
to that variable using nonblocking <= assignment.
VHDL variable:
~~~~~~~~~~~~~~
Use a Verilog variable that's declared locally within
a named begin...end block in an always block. Assign
to that variable using blocking = assignment.
Now, let's tell the story from a simulation point of view.
In VHDL, there are two different kinds of data object: signals
and variables. Variables work exactly like variables in software,
and are used to store values used in the computation performed
by a process. Variables are local to a process, and invisible
outside that process. Signals, on the other hand, carry values
from one process to another, and process execution can be
triggered by the change in value of a signal.
Every process that drives a given signal represents
a static, structural driver on that signal. The value driven
by the process's driver is determined by what the process
chooses to write to the signal. The updating of the value
on signals is performed at a time when no processes are
executing.
In Verilog, there are two different kinds of data object:
nets and variables. The most common form of net is 'wire'
and the most common form of variable is 'reg'.
Nets get their values from structural drivers, which
can be created in various ways:
- If you connect a net to the output of a module or primitive
instance, that output represents a structural driver
- A continuous assign statement to a net represents a
driver on that net
- Inside a module, an input port of the module represents
a structural driver on the corresponding internal net
and a few other, more exotic cases.
Variables, by contrast, get their values by procedural
assignment from code in an "initial" or "always" block.
Process execution can be triggered by value changes on
either nets or variables. To make this process triggering
less prone to race conditions, it's possible to update
variables using "nonblocking assignment" (<=) which,
a little like VHDL signal assignment, postpones updating
of the variable until *all* procedural code has reached
a delay statement or a sensitivity list.
Hope this helps point you in the right direction as you
search for a fuller understanding of the two languages.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.