cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
11,253 Views
Registered: ‎07-28-2010

Relative paths for vivado simulation and synthesis

Jump to solution
I need file access in my verilog code. ./ works at top level of project for modelsim, but is down three levels into the Vivado sim hierarchy. I have no idea where synth is looking. Pwd in the tcl console shows some obscure user location.
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
18,318 Views
Registered: ‎07-28-2010

Not quite the right issue. I'm doing readmemh to build a ROM and can't find the hex files. Setting the include directory had no effect. I wound up with 3 ifdef's as shown. Not elegant, but functional.

 

`ifdef MODEL_TECH // each compiler wants the hex files in a different place
bit [15:0] Path = "./";
`elsif XILINX_SIMULATOR
bit [71:0] Path = "../../../";
`else
bit [47:0] Path = "../../";
`endif
assign q = BitReg;
initial begin
$readmemh({Path, "SRC/BitMaps/File1.hex"}, Bitmaps, 32'h00000, 32'h00FFF);

View solution in original post

0 Kudos
4 Replies
Highlighted
Moderator
Moderator
11,250 Views
Registered: ‎07-21-2014

Hi,

 

You can find below options in simulation settings. Refer below snapshot:

 

Capture.PNG

 

Thanks,
Anusheel
-----------------------------------------------------------------------------------------------
Search for documents/answer records related to your device and tool before posting query on forums.
Search related forums and make sure your query is not repeated.

 

Please mark the post as an answer "Accept as solution" in case it helps to resolve your query.
Helpful answer -> Give Kudos
-----------------------------------------------------------------------------------------------

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
11,233 Views
Registered: ‎09-20-2012

Hi,

 

Check the below article http://www.xilinx.com/support/answers/54006.html

 

Thanks,

Deepika.

Thanks,
Deepika.
--------------------------------------------------------------------------------------------
Google your question before posting. If someone's post answers your question, mark the post as answer with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left)
0 Kudos
Highlighted
Adventurer
Adventurer
18,319 Views
Registered: ‎07-28-2010

Not quite the right issue. I'm doing readmemh to build a ROM and can't find the hex files. Setting the include directory had no effect. I wound up with 3 ifdef's as shown. Not elegant, but functional.

 

`ifdef MODEL_TECH // each compiler wants the hex files in a different place
bit [15:0] Path = "./";
`elsif XILINX_SIMULATOR
bit [71:0] Path = "../../../";
`else
bit [47:0] Path = "../../";
`endif
assign q = BitReg;
initial begin
$readmemh({Path, "SRC/BitMaps/File1.hex"}, Bitmaps, 32'h00000, 32'h00FFF);

View solution in original post

0 Kudos
Highlighted
11,174 Views
Registered: ‎01-16-2015

We  have struggled with different tool path issues many times in past projects and tool flows. Our latest solution for readmemh file path names uses two steps:

 

1) From our script or GUI tool, we set a "PROJECT_ROOT" define. For example, in Vivado Synthesis Settings:

    PROJECT_ROOT=/myPath/projectDirectoryTop

or from command line for our simulator

    +define+PROJECT_ROOT=/myPath/projectDirectoryTop

 

2) In the rtl source, we append a relative path from the project root

        parameter INIT_FILE = {{`PROJECT_ROOT},"/rtl/module/mem512x8.mif"}

(this exact syntax worked with our simulator and all our versions of XST and Vivado.

If you don't need to use all those different tool versions, there are simpler variations on the syntax).

 

So the net result of this is:

a) the project root is evaluated by our script whenever we start a simulation or synthesis run (effectively relative path)

b) simulation and synthesis tools see a full absolute path to memory files (no chance to make a mistake)