Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Entity Output

 
Thread Tools Search this Thread
Old 09-22-2006, 04:10 PM   #1
Default Entity Output


Hi,
Is there a reason why someone told me that I should not assign a
result directly to the entity output when it's in a process?

--------------------------------------------

entity blah is
port (
my_entity_output : out std_logic;
....
);

process (...)
begin
if (check rising edge...)
my_entity_output <= something;
end if
end if;
--------------------------------------------
and it shoudl be this :

entity blah is
port (
my_entity_output : out std_logic;
....
);
.....
signal o_s : std_logic;
my_entity_output <= o_s;
process (...)
begin
if (check rising edge...)
o_s <= something;
end if
end if;

Thanks

Simon



Simon
  Reply With Quote
Old 09-22-2006, 04:28 PM   #2
KJ
 
Posts: n/a
Default Re: Entity Output


Simon wrote:
> Hi,
> Is there a reason why someone told me that I should not assign a
> result directly to the entity output when it's in a process?


Two reasons come to mind:

1. The person who told you isn't the sharpest person and should not
dispense such advice.

2. If you want to use that 'output' inside the architecture for some
reason than what you should do is declare an internal signal and assign
to that for whatever internal reasons you have. You would then need to
have a final concurrent assignment that copies the internal signal over
to the true output of the entity. This technique would have absolutely
nothing to do with whether you're "inside a process" or not....so I'd
lean towards #1 as being the explanation.

Thinking that #2 might apply in some situations one might be inclined
to always first assign to an internal version of the signal and then
copy over to the output and always do that as your standard operating
procedure. Some choose to do this, but again it has nothing to do with
being in or out of a process.

My feeling though is that for those many times where the output is
simply an output you're adding two unneeded lines of code (one for the
extra signal definition and one for the concurrent assignment). If you
get paid by lines of code this is a good thing but it adds to the
clutter and makes for more code (translated...more chance for bugs)
with no actual benefit (for the case where the output is just that...an
output).

KJ

  Reply With Quote
Old 09-22-2006, 09:42 PM   #3
Paul Uiterlinden
 
Posts: n/a
Default Re: Entity Output

Simon wrote:

> Hi,
> Is there a reason why someone told me that I should not assign a
> result directly to the entity output when it's in a process?


Perhaps this: a port signal of mode OUT cannot be read (in the
architecture and the processes in that architecture). An intermediate
signal solves that problem. As does mode BUFFER, but that is another
story.

--
Paul.

  Reply With Quote
Old 10-02-2006, 08:22 PM   #4
Mike Treseler
 
Posts: n/a
Default Re: Entity Output

Paul Uiterlinden wrote:

> Perhaps this: a port signal of mode OUT cannot be read (in the
> architecture and the processes in that architecture). An intermediate
> signal solves that problem. As does mode BUFFER,


as does a process variable

-- Mike Treseler
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump