get path to current instance as string for $display

This is a discussion on get path to current instance as string for $display within the verilog forums in Programming Languages category; How can $display a path to the instance containing the $display? Is there some function to get this as a string? -- /* jhallen@world.std.com AB1GO */ /* Joseph H. Allen */ int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z-- q=3&(r=time(0) +r*57)/7,q=q?q-1?q-2?1-p%79?-1:0 %79-77?1:0 <1659?79:0 >158?-79:0,q?!a[p+q*2 ]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817 printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}...

Go Back   Application Development Forum > Programming Languages > verilog

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-20-2008, 12:32 PM
Joseph H Allen
Guest
 
Default get path to current instance as string for $display


How can $display a path to the instance containing the $display? Is there
some function to get this as a string?

--
/* jhallen@world.std.com AB1GO */ /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0%79-77?1:0<1659?79:0>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
Reply With Quote
  #2  
Old 08-20-2008, 12:48 PM
Jonathan Bromley
Guest
 
Default Re: get path to current instance as string for $display

On Wed, 20 Aug 2008 16:32:13 +0000 (UTC), (Joseph H Allen) wrote:

>How can $display a path to the instance containing the $display? Is there
>some function to get this as a string?


$display("%m");

You can also get it as a string (easier in SystemVerilog,
of course):

reg [1:8*lots] inst_name_string;
// string inst_name_string; // in SystemVerilog
...
$sformat(s, "%m");

--
Jonathan Bromley, Consultant

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

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
Reply With Quote
  #3  
Old 08-20-2008, 05:46 PM
Joseph H Allen
Guest
 
Default Re: get path to current instance as string for $display

Thanks! This is exactly what I was looking for.

In article <ujioa4hcdpgjoba36j28ch92ka95qerq37@4ax.com>,
Jonathan Bromley <jonathan.bromley@MYCOMPANY.com> wrote:
>On Wed, 20 Aug 2008 16:32:13 +0000 (UTC), (Joseph H Allen) wrote:
>
>>How can $display a path to the instance containing the $display? Is there
>>some function to get this as a string?

>
> $display("%m");
>
>You can also get it as a string (easier in SystemVerilog,
>of course):
>
> reg [1:8*lots] inst_name_string;
> // string inst_name_string; // in SystemVerilog
> ...
> $sformat(s, "%m");
>
>--
>Jonathan Bromley, Consultant
>
>DOULOS - Developing Design Know-how
>VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
>
>Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
>jonathan.bromley@MYCOMPANY.com
>http://www.MYCOMPANY.com
>
>The contents of this message may contain personal views which
>are not the views of Doulos Ltd., unless specifically stated.



--
/* jhallen@world.std.com AB1GO */ /* Joseph H. Allen */
int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--q=3&(r=time(0)
+r*57)/7,q=q?q-1?q-2?1-p%79?-1:0%79-77?1:0<1659?79:0>158?-79:0,q?!a[p+q*2
]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:28 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.