instancename of current entity/architecture -- equivalent to C++ this???

Discussion in 'VHDL' started by Eric Peers, Nov 17, 2004.

  1. Eric Peers

    Eric Peers Guest

    I have two watchers that are identical, but watching different
    interfaces.

    I would like to obtain the instancename of the current
    entity/architecture so that I can print it out in an error message.

    I know there is a `instancename as an attribute. So I could create my
    watcher and pass as a signal port to it, it's instancename. But that's
    dumb.

    I could also create a signal inside of the watcher and find the
    'path_name to it and parse it. but that's dumb.

    what I want is the equivalent of the "this" pointer in C++:

    this'instancename -- I want the instance name of the current
    architecture that I am sitting in.

    Is there some special VHDL construct to reference the current
    architecture/entity?

    Thanks!
    - -eric
    Eric Peers, Nov 17, 2004
    #1
    1. Advertising

  2. Eric Peers

    Alan Fitch Guest

    "Eric Peers" <> wrote in message
    news:...
    > I have two watchers that are identical, but watching different
    > interfaces.
    >
    > I would like to obtain the instancename of the current
    > entity/architecture so that I can print it out in an error message.
    >
    > I know there is a `instancename as an attribute. So I could create

    my
    > watcher and pass as a signal port to it, it's instancename. But

    that's
    > dumb.
    >
    > I could also create a signal inside of the watcher and find the
    > 'path_name to it and parse it. but that's dumb.
    >
    > what I want is the equivalent of the "this" pointer in C++:
    >
    > this'instancename -- I want the instance name of the current
    > architecture that I am sitting in.
    >
    > Is there some special VHDL construct to reference the current
    > architecture/entity?
    >


    Can't you just use

    A'INSTANCE_NAME

    where A is the architecture name? Or are you referring specifically
    to the label of a component instance?

    Alan


    --
    Alan Fitch
    Consultant

    DOULOS - Developing Design Know-how
    VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project
    Services

    Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24
    1AW, UK
    Tel: +44 (0)1425 471223 mail:

    Fax: +44 (0)1425 471573 Web:
    http://www.doulos.com

    The contents of this message may contain personal views which are not
    the
    views of Doulos Ltd., unless specifically stated.
    Alan Fitch, Nov 18, 2004
    #2
    1. Advertising

  3. (Eric Peers) wrote in message news:<>...
    > I have two watchers that are identical, but watching different
    > interfaces.
    >
    > I would like to obtain the instancename of the current
    > entity/architecture so that I can print it out in an error message.
    >
    > I know there is a `instancename as an attribute. So I could create my
    > watcher and pass as a signal port to it, it's instancename. But that's
    > dumb.


    Yes, but 'instance_name (and its variants 'simple_name and 'path_name)
    don't have to be used like that. Suppose you have...

    entity E is ....
    end;
    architecture A of E is ....
    ...
    begin
    ...
    assert <all_is_well>
    report "Failure in " & E'instance_name;
    ...
    end;

    you will get what you want.

    Note, though, that "report" and "assert" messages include this
    information anyway (along with the value of simulation time,
    which is also very handy). So maybe you don't need to
    specify this at all.
    --
    Jonathan Bromley
    Jonathan Bromley, Nov 18, 2004
    #3
    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. MariuszK
    Replies:
    1
    Views:
    522
    =?ISO-8859-1?Q?Sch=FCle_Daniel?=
    Jul 14, 2006
  2. Samuel van Laere

    Entity Name or Entity Number?

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

    Entity, problem with entity key

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

Share This Page