PLI 1.0 to access variable array

A

Anton Ng

Guest
Hi All,

I am hitting the wall with PLI 1.0 to obtain a value of a variable in
an array,

This is my problem:

integer var[0:1];

initial begin
var[0] = 100;
var[1] = 101;
end

What I am trying to do with PLI, is to get the value of var[0]. Is there
an access function for this?

I can do this for a scalar variable, by using acc_handle_by_name and
then using acc_fetch_value. However it seems like array variables needs
to treated differently.

Does anyone know the solution for this problem?

Any help would be appreciated.

Thanks

Anton
 
Anton Ng <Anton.Ng@motorola.com> wrote in message news:<40159FCD.3D58C891@motorola.com>...
Hi All,

I am hitting the wall with PLI 1.0 to obtain a value of a variable in
an array,

This is my problem:

integer var[0:1];

initial begin
var[0] = 100;
var[1] = 101;
end

What I am trying to do with PLI, is to get the value of var[0]. Is there
an access function for this?

I can do this for a scalar variable, by using acc_handle_by_name and
then using acc_fetch_value. However it seems like array variables needs
to treated differently.

Does anyone know the solution for this problem?

Any help would be appreciated.

Thanks

Anton
As Steven Sharp indicated in a different reply few days back,
use tf_nodeinfo(). There is an example in Chapter 5 of the
book mentioned in the signature below on how to use tf_nodeinfo()
to do this - check it out if you like.

VCS has (or at least had in VCS 5.0 - few years back) a pair
of non-standard access functions for array/vector access. I am
not sure if they still support those.

Regards,
- Swapnajit

--
=-=-= 100% pure Verilog PLI - go, get it ! =-=-=
Principles of Verilog PLI -By- Swapnajit Mittra
Kluwer Academic Publishers. ISBN: 0-7923-8477-6
http://www.angelfire.com/ca/verilog/
 
Hi,

unfortunately I dont have the book. =(. so can't look up the example, unless you are willing
to provide it.

I figured out that for VCS, i need to get the handle by name "var" and then use acc_getmem_int
access function to access the index that u want.

For NC howeever, it is different, first - need to get the handle by the name of ... say
"var[0]" (index supplied), then use acc_fetch_value to get the value.

For XL - this is what confuses me, I can't get the handle at all by using acc_handle_by_name
with either "var" or "var[0]" supplied. I don't understand why it doesn't work. NC and XL are
both from Cadence, why implementation are different?

Does anyone has opinion/suggestion?

Rgds
Anton



Swapnajit Mittra wrote:

Anton Ng <Anton.Ng@motorola.com> wrote in message news:<40159FCD.3D58C891@motorola.com>...
Hi All,

I am hitting the wall with PLI 1.0 to obtain a value of a variable in
an array,

This is my problem:

integer var[0:1];

initial begin
var[0] = 100;
var[1] = 101;
end

What I am trying to do with PLI, is to get the value of var[0]. Is there
an access function for this?

I can do this for a scalar variable, by using acc_handle_by_name and
then using acc_fetch_value. However it seems like array variables needs
to treated differently.

Does anyone know the solution for this problem?

Any help would be appreciated.

Thanks

Anton

As Steven Sharp indicated in a different reply few days back,
use tf_nodeinfo(). There is an example in Chapter 5 of the
book mentioned in the signature below on how to use tf_nodeinfo()
to do this - check it out if you like.

VCS has (or at least had in VCS 5.0 - few years back) a pair
of non-standard access functions for array/vector access. I am
not sure if they still support those.

Regards,
- Swapnajit

--
=-=-= 100% pure Verilog PLI - go, get it ! =-=-=
Principles of Verilog PLI -By- Swapnajit Mittra
Kluwer Academic Publishers. ISBN: 0-7923-8477-6
http://www.angelfire.com/ca/verilog/
 

Welcome to EDABoard.com

Sponsor

Back
Top