PLI: access to parameters?

E

Eric Peterson

Guest
Hi,

Is it possible to access verilog parameters via PLI calls? And if so, is
there any trick to make sure I get the _current_ value for that parameter
(e.g. if someone has defparam'd it to override it's default.)

Thanks much,
Eric
 
Eric,
I haven't tried this, but the following idea may get you going:

If you use VPI (PLI 2.0), try using

vpi_get_value () after obtaining a handle to a vpiParameter (which I guess
you can get through vpi_handle(vpiParameter, mod_handle) ).

And if you call the function/task after beginning of simulation you will get
the updated value for the parameter anyway. (It may be tough to get the
local value, not sure..)

HTH,
Srinivasan

--
Srinivasan Venkataramanan
Senior Verification Engineer
Software & Silicon Systems India Pvt Ltd. - an Intel company
Bangalore, India

http://www.noveldv.com http://www.deeps.org

I don't speak for Intel
"Eric Peterson" <Eric.R.Peterson@verizon.net> wrote in message
news:pan.2003.10.15.04.21.41.570026@verizon.net...
Hi,

Is it possible to access verilog parameters via PLI calls? And if so,
is
there any trick to make sure I get the _current_ value for that
parameter
(e.g. if someone has defparam'd it to override it's default.)

Thanks much,
Eric
 
Just use vpi_get_value. It is defined for parameters according
to new 2001 P1364 LRM page 681. Because original XL implemented parameters
as registers, the post defparam over-ride value should be returned.
Also, because of new SDF annotation for specparams outside specify
section in Verilog 2001, post SDF annotation value of any specparam
should be returned by vpi_get_value. Easiest way to get value is
to use vpi_handle_by_name in right scope to get handle then use
vpi_get_value on the handle. Notice you need a particular instance
scope since after defparam (and pound param) annotation, values can
be instance specific.

I think you should be able to get the original parameter value
by scanning source to the parameter statement right hand side expression
and then doing a vpi_get_value on that expression type handle.
/Steve


On Wed, 15 Oct 2003 04:21:42 GMT, Eric Peterson <Eric.R.Peterson@verizon.net>
wrote:
Hi,

Is it possible to access verilog parameters via PLI calls? And if so, is
there any trick to make sure I get the _current_ value for that parameter
(e.g. if someone has defparam'd it to override it's default.)

Thanks much,
Eric

--
Steve Meyer Phone: (612) 371-2023
Pragmatic C Software Corp. email: sjmeyer@pragmatic-c.com
520 Marquette Ave. So., Suite 900
Minneapolis, MN 55402
 

Welcome to EDABoard.com

Sponsor

Back
Top