To use XPM Memory in Vivado you need to create design sources for the XPM memory. Follow the following steps to create XPM memory.
- Launch Vivado and create a Project.
- In the Sources window, right-click Design
Sources, and select Add Sources from the popup
menu.
- In the Add or Create Design Sources page, click Create
File.
- In the Create Source File dialog box, specify the HDL language of your choice from the File type drop-down menu, and type a name for the memory block being created in the File name field.
- Keep the File location to its default value <Local to Project>.
- Click OK, as shown in the following figure.
- In the Add or Create Design Sources page, click
Finish.
- The Define Module dialog box opens. Click Cancel to dismiss the dialog box.
- The Define Module dialog box asks to confirm that you indeed do not want to create the template for the HDL file.
- Click Yes.
This example copies a pre-existing XPRM template in the next steps into the HDL file.
- Now you can see the newly created Verilog file in the Sources window.
- In the Flow Navigator, under Project Manager, click Language
Templates.
- The Language Template dialog box opens. In the Search field type xpm and select
the template for the appropriate HDL code (VHDL/Verilog), shown in the following
figure.
- Cut and paste the template for the Single Port RAM memory and add the instantiation template to the HDL file. Complete the definition of the HDL file by adding the appropriate entity and/or module definition. Set the USE_MEM_INIT_MMI parameter in the instantiation to 1.
- Integrate your XPM memory block with the rest of the design. You can use the IP
Integrator tool to integrate the XPM memory as a RTL module.
- Set the appropriate depth of the memory instantiated in the Address
Editor.
- Generate output products, synthesize, implement, and create the bitstream for the design.
- If you have a
memfile, you can use that to populate the initialization strings of the XPM memory using the followingupdatememcommand as an example:updatemem -meminfo <mmi_file_name>.mmi -data <mem_file_name>.mem -bit <bit file name>.bit -proc <path to xpm memory instance> -out <output bit file name>.bit - You can also use the
-debugswitch to see theinit_stringsof the XPM memory. Below is an example of using the-debugswitch.updatemem -debug -meminfo <mmi_file_name>.mmi -data <mem_file_name>.mem -bit <bit file name>.bit -proc <path to xpm memory instance> -out <output bit file name>.bit > dmp.txt<