Whats the use of Code inside an Entity Declaration

Discussion in 'VHDL' started by Tricky, Dec 3, 2007.

  1. Tricky

    Tricky Guest

    I only realised today that I can put sequential statements inside an
    entity, rather than an architecture.

    So, other than asserts or similar to check the viability of given
    generics, what useful code can but put in there?

    From making a test entity, I also noticed that an assert I had that
    checked a generic, was not processed until the first delta cycle in
    modelsim. I had some outputs from another process written to the
    console before the assert inside the entity failed.
    Tricky, Dec 3, 2007
    #1
    1. Advertising

  2. Tricky

    Andy Guest

    On Dec 3, 11:45 am, Tricky <> wrote:
    > I only realised today that I can put sequential statements inside an
    > entity, rather than an architecture.
    >
    > So, other than asserts or similar to check the viability of given
    > generics, what useful code can but put in there?
    >
    > From making a test entity, I also noticed that an assert I had that
    > checked a generic, was not processed until the first delta cycle in
    > modelsim. I had some outputs from another process written to the
    > console before the assert inside the entity failed.


    I think you can put any code that does not update a signal or shared
    variable in the entity statement part.

    Concurrent statements, including concurrent assertion statements, are
    implied processes, and processes execute in indeterminate order within
    the same delta cycle.

    If you really want something to fail prior to simulation starting, it
    needs to cause an error in elaboration. Things like illegal object
    declarations (subtype outside of root type's range, etc.) constant
    initialization, port-signal bounds mismatches, etc. should do the
    trick. But then the error message may not be too useful.

    You might be able to declare a constant initialized with a function
    call, taking the generic(s) as argument(s), and inside that function
    have one or more assertion statements.

    Andy
    Andy, Dec 4, 2007
    #2
    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. Samuel van Laere

    Entity Name or Entity Number?

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

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,195
    ThatsIT.net.au
    Sep 7, 2009
  5. Sur
    Replies:
    4
    Views:
    185
Loading...

Share This Page