UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 58494

Block Memory Generator 8.0 - Is it possible to view the contents of the memory in the Simulator Wave Viewer?

Description

I have simulated the Block Memory Generator 8.0 example design and I wish to view the contents of the block RAM, however it always appears to be undefined, "0xUU".

Is it possible to view the contents?

Solution

In the simulation model generated by the Block Memory Generator core, "blk_mem_gen_v8_0.vhd", the signal "memory_i" is declared as a 2-dimensional array to the memory content when DEBUG = 1.

See the following lines:

if (DEBUG = 1) then

   memory_i <= memory;
   doublebit_error_i <= doublebit_error;
   current_contents_i <= current_contents_var;

Manually changing the DEBUG constant to '1' and running the simulation will allow you to view the block RAM contents.

For ModelSim, there is a Memory List Window, or you can use the "mem_display" command to print the memory contents of the specified instance to the Transcript window.

For example:

mem_display -startaddress 0 -endaddress 5 /blk_mem_gen_0_tb/blk_mem_gen_0_synth_inst/BMG_PORT/bmg0/U0/native_mem_module/mem_module

This command displays the memory contents of the instance /blk_mem_gen_0_tb/blk_mem_gen_0_synth_inst/BMG_PORT/bmg0/U0/native_mem_module/mem_module, addresses 0 to 5.

AR# 58494
Date Created 11/21/2013
Last Updated 10/13/2016
Status Active
Type General Article
IP
  • Block Memory Generator