Entity Output

S

Simon

Guest
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 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
 
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.
 
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
 

Welcome to EDABoard.com

Sponsor

Back
Top