PLI 1.0 - access to value of a variable in a vector

O

Ozzyboom

Guest
Hi All,

I am hitting the wall with PLI 1.0 to obtain a value of a variable in a vector, and i have to do this for digital engines of VCS, XL and NC, but I think VCS and NC would be priority.

This is my problem:

integer[0:1] var;

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 vector variables needs to treated differently.

Does anyone know the solution for this problem?

Any help would be appreciated.

Thanks
 
"Ozzyboom" <antonng02@nospam.yahoo.com> wrote in message news:<28bdbc48008cdd8f10e90787111dd8fa@localhost.talkaboutprogramming.com>...
This is my problem:

integer[0:1] var;

initial begin
var[0] = 100;
var[1] = 101;
end
AFAIK integer type is a 32-bit array, so array of integer is twodimentional
array with already declared first range. Thus, var declaration should look
rather like this:

integer var [0:1];

Hope this will help. Regards.
 
gdrozdzowski@yahoo.com.br (G) wrote in message news:<2ff93cf8.0401230729.5f51dafd@posting.google.com>...
AFAIK integer type is a 32-bit array, so array of integer is twodimentional
array with already declared first range. Thus, var declaration should look
rather like this:

integer var [0:1];
Yes, an array of integers should have the array range after the variable
name. Putting a vector range after "integer" and before the variable
name is actually illegal in Verilog. But since Verilog-XL allowed it
(and apparently ignored the range), other tools may have allowed it
also.

I don't believe that PLI 1.0 provides proper access to memories/arrays.
Some people use tf_nodeinfo to access the contents, but this is a
kludge, and does not work properly when writing to it. To access
memories/arrays properly, I believe you must use VPI.
 

Welcome to EDABoard.com

Sponsor

Back
Top