User guide

E-10
PLI Access Routines
// print values through acc_getmem_int
#1 len = bfinish - bstart + 1;
$display();
$display("Begin Memory Values");
for (i=start;i<=finish;i=i+1)
begin
$get_mem(mymem,i,bstart,len);
end
$display("End Memory Values");
$display();
// display values
#1 $display();
$display("Begin Memory Display");
for (i=start;i<=finish;i=i+1)
begin
$display("mymem word %d is %b",i,mymem[i]);
end
$display("End Memory Display");
$display();
end
endmodule
In this Verilog code, in the initial block, the following events occur:
1. The $clear_mem system task clears the memory.
2. Then the $set_mem system task deposits values in specified
words, and in specified bits in the memory named mymem.
3. In a for loop, the $get_mem system task reads values from the
memory and displays those values.