Quantcast
Channel: Cadence Functional Verification Forum
Viewing all articles
Browse latest Browse all 1069

Accessing Packed Arrays using Tcl Interface

$
0
0

I am exploring options to access and modify the contents of a packed array in the simulation hierarchy, with the aim of replicating some VPI functionality using the Tcl scripting interface.

I have a small test-case to clarify the issue that I am facing:

The design has a packed array defined as below:

logic [5:0][5:0] packed_array_test;

With vpi_put_value, packed_array_test can be accessed as a single-dimensional array of [35:0], and it is possible to deposit, say, any 32-bit value to packed_array_test[31:0]

Is it possible to get a similar functionality with the Tcl interface?

I have currently tried the following:

xcelium> value %b TB.DUT0.packed_array_test
36'b000000000001000000000000000001000000
xcelium> force TB.DUT0.packed_array_test = 36'h12345FFFF
xcelium> value %b TB.DUT0.packed_array_test
36'b000100100011010001011111111111111111
xcelium> force TB.DUT0.packed_array_test[31:0] = 32'hFFFF1234
xmsim: *E,PINRNG: Index value out of range: [31:0].

It appears that the force command will either work on the full packed array, or, if accessing a particular set of bits, with all the dimensions explicitly specified.

Do the Tcl force / value commands have any options that would allow for packed array access functionality similar to vpi_put_value / vpi_get_value?


Viewing all articles
Browse latest Browse all 1069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>