Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > instancename of current entity/architecture -- equivalent to C++ this???

Reply
Thread Tools

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

 
 
Eric Peers
Guest
Posts: n/a
 
      11-17-2004
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
 
Reply With Quote
 
 
 
 
Alan Fitch
Guest
Posts: n/a
 
      11-18-2004

"Eric Peers" <> wrote in message
news: om...
> 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.

 
Reply With Quote
 
 
 
 
Jonathan Bromley
Guest
Posts: n/a
 
      11-18-2004
(Eric Peers) wrote in message news:<. com>...
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using the current method name within current method Matthew Heidemann Ruby 14 03-22-2011 03:56 AM
printing out the current URL for current ASP page in Perl Jack Perl Misc 3 12-22-2008 02:35 PM
Ruby 1.9 - equivalent of Fiber.current ? Suraj Kurapati Ruby 2 03-02-2008 05:05 PM
Thread.current.parent and Thread.current.ancestors ara.t.howard@noaa.gov Ruby 3 02-16-2007 03:34 PM
How to change the current thread current culture at run time. Manu ASP .Net 1 07-20-2003 03:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57