get path to current instance as string for $display

J

Joseph H Allen

Guest
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:p%79-77?1:0:p<1659?79:0:p>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]]);}
 
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:p%79-77?1:0:p<1659?79:0:p>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]]);}
 
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.
 

Welcome to EDABoard.com

Sponsor

Back
Top