Yes, maybe somebody can clear what is the reason
that OUT ports cannot appear on
the right side.
It's a rule of the language, and a standard FAQ.
Let's try some reasons. Decide for yourself which,
if any, you find convincing. All have some truth
in them.
1) User discipline
~~~~~~~~~~~~~~~~~~
It's an OUT port. You're sending information out
of the design unit. It is probably a user error to
attempt to read it, because there is a risk that you
imagine you are reading a value that came in through
the port from the outside world - which, of course,
would need an input or inout port.
2) Port transparency
~~~~~~~~~~~~~~~~~~~~
Unlike Verilog, ports in VHDL are completely transparent.
After the model has been elaborated, the signal inside
the design unit and the connected signal outside are
one and the same signal; there is no implicit driver
across the port boundary. Consequently, reading an
OUT port makes no sense because there *might* be another
driver on the signal, outside your design unit. When
you try to read an OUT port, do you want the value
that you are driving, or do you want the value that
appears on the signal as a result of its multiple
drivers? It's too ambiguous. VHDL has a very simple
solution to the first question - use an internal
variable, and drive that variable onto the out port - and
a simple solution to the second question - use inout.
You decide; there is no ambiguity, everyone knows what
you are trying to do, and your design unit's behaviour
is (as we would hope) unaffected by its environment.
3) Delta delays
~~~~~~~~~~~~~~~
It is a common newbie VHDL error to write something like
this:
process (A)
begin
B <= A + 1;
Y <= B + 1; -- newbie expects to get Y = A+2
end process;
We can't stop people making that mistake on internal
signals, but making OUT ports unreadable is a way to
reduce the risk in at least some situations.
4) Job protection
~~~~~~~~~~~~~~~~~
If VHDL did not put obstacles of this kind in the beginner's
way, I might be out of a job soon.
Oh, and you might like to find out about buffer ports, and
the VHDL-2002 changes that affect how you can connect buffer
and out ports to one another.
--
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.