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

E

Eric Peers

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
 
A

Alan Fitch

Eric Peers said:
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:
(e-mail address removed)
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.
 
J

Jonathan Bromley

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top