Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Using TCL relative path in Modelsim

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
Hello,

I have a VHD testbench file in this location:

Code:
C:/some_directory/hdl/tb.vhd

I also have a stimulus text file in this location:

Code:
C:/some_directory/text/stimulus.txt

In my VHDL testbench I use the absolute path of "stimulus.txt" as follows:
Code:
file text_file : text open read_mode is "C:\some_directory\text\stimulus.txt" ;

Question:
What's the syntax to use an absolute path for the same file?
 

do you mean relative path?
Its the same as the relative path in any OS: . is current folder, .. is up one folder:

".\stimulus.txt" or just "stimulus.txt"
 

do you mean relative path?
Yes. Sorry for the typo.

".\stimulus.txt" or just "stimulus.txt"

I tried that and it didn't work

Failed to open VHDL file "./stimulus.txt" in rb mode.
# No such file or directory. (errno = ENOENT)

Maybe "stimulus.txt" must be added to the project first when using a relative path ?
 

No it doesnt need adding. It just means that the simulation folder is not the folder where stimulus.txt is.
Where are you invoking vsim?
 

You mean the location I get when I type "pwd" in the console?
 

You mean the location I get when I type "pwd" in the console?

No
The folder that vsim is run in. Files in your source code are relative to where the simulation is running.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top