User guide
18-14
DirectC Interface
memory_reorg(mem1,mem2);
In this example all the values in memory mem2 are passed to C/C++
function memory_reorg and when it finishes executing, it passed
new values to memory mem1.
incr(r7);
In this example the value of bit r7 is passed to C/C++ function incr
and when it finishes executing, it passes new a new value to bit r7.
Storing Vector Values in Machine Memory
Users of direct access need to know how vector values are stored in
memory. This information is also helpful for users of abstract access.
Verilog four-state simulation values (1, 0, x, and z) are represented
in machine memory with data and control bits. The control bit
differentiates between the 1 and x and the 0 and z values, as shown
in the following table:
When a routine returns Verilog data to a C/C++ function, how that
data is stored depends on whether it is from a two or four-state value
and whether it is from a scalar, a vector, or from an element in a
Verilog memory.
Simulation Value Data Bit Control Bit
110
x11
000
z01