Entity Output

Discussion in 'VHDL' started by Simon, Sep 22, 2006.

  1. Simon

    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, Sep 22, 2006
    #1
    1. Advertising

  2. Simon

    KJ Guest

    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
     
    KJ, Sep 22, 2006
    #2
    1. Advertising

  3. 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, Sep 22, 2006
    #3
  4. 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
     
    Mike Treseler, Oct 2, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael TEpperis
    Replies:
    2
    Views:
    599
    Michael TEpperis
    Aug 6, 2004
  2. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,638
    Jukka K. Korpela
    Feb 24, 2007
  3. markla
    Replies:
    1
    Views:
    549
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    2,729
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,201
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page