cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
8,220 Views
Registered: ‎12-29-2013

Vivado: $readmemh in IP cores can't find hex file in simulation, works in synthesis

Jump to solution

Hello,

 

I have an IP-XACT core (Verilog) that uses $redmemh to load a ROM image from a hex file. That hex file is not user configurable and just statically bundled with the IP-XACT core. I put the ROM file into the "xilinx_miscfiles_view_fileset" fileSet because this is what works in synthesis (putting the hex file in any other fileSet will result in the hex file not being found during synthesis):

 

 

ipx::add_file romdata.hex [ipx::add_file_group -type misc {} $ip]

 

However, in simulation it seems like the hex file is not found regardless in which fileSet I put it. The only way I managed to get simulation so far is to add an additional add_files call into the TCL script running the simulation:

 

 

add_files -fileset [current_fileset -simset] ip_myromtable/romdata.hex

 

But of course it is NOT a viable option to require the user of my IP to do this whenever they want to simulate a design that uses the IP.

 

I have created a minimal test case for the issue: http://svn.clifford.at/handicraft/2015/vivado_readmem_ip/

 

The TCL script vivado_make_ip.tcl creates the IP-XACT core. The script vivado_sim_ip.tcl runs simulation (produces a warning for the HEX file unless the additional add_files work-around is enabled), and vivado_synth_ip.tcl runs synthesis (works fine with the HEX file in the -type misc {} file group).

 

Unfortunately the documentation for creating IP cores is pretty sparse and the Vivado simulation documentation does not even mention $readmem[hb] afaics.

 

What is the recommended way of creating IP cores that load HEX files (that are bundled with the core) using $readmemh, so that it works with both Vivado implementation and simulation?

 

Thanks for your help!

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Contributor
Contributor
15,181 Views
Registered: ‎12-29-2013

After discussion with Xilinx support (SR#10325231): xsim needs the file to have the extension ".dat" or ".data" for this to work. Renaming the file fixed the issue.

View solution in original post

1 Reply
Highlighted
Contributor
Contributor
15,182 Views
Registered: ‎12-29-2013

After discussion with Xilinx support (SR#10325231): xsim needs the file to have the extension ".dat" or ".data" for this to work. Renaming the file fixed the issue.

View solution in original post