Forum Discussion
Altera_Forum
Honored Contributor
13 years agorelative path in a do file
hello
i am a beginner in modelsim i want to use relative path in do file but it doesn't work my os is windows xp my relative path is : vcom -work Work_Project ../../SRC/A_Interface.vhd error: Failed to open design unit file "../../SRC/A_Interface.vhd" in read mode. how can i do this? thanks alot.11 Replies
- Altera_Forum
Honored Contributor
The path is relative to Modelsim's current working path, not the script itself. Check what path it is currently running in.
- Altera_Forum
Honored Contributor
you can type commands into the modelsim command line, and they mostly match linux command. Use "pwd" to see where the current modelsim directory is.
- Altera_Forum
Honored Contributor
thanks for your answer
according to your answer, i tried to get absolute path of my script by using "file dirname" command but it give me relative path. i want to able my script to work on any machine. so i need to inform absolute path of script. please help me what i suppose to do. thanks alot. - Altera_Forum
Honored Contributor
to change the drive, you type:
cd c: to change directory cd /directoryA/directoryB the first slash essentially means "root" and on windows that means whatever drive you're currently on. - Altera_Forum
Honored Contributor
--- Quote Start --- to change the drive, you type: cd c: to change directory cd /directoryA/directoryB the first slash essentially means "root" and on windows that means whatever drive you're currently on. --- Quote End --- the question is "how can i obtain path of the .do file that is running?" i need a command to tell me what is the full path. - Altera_Forum
Honored Contributor
you cant (afaik) - you need to change directory to where the .do file is located.
- Altera_Forum
Honored Contributor
easiest thing to do is have a "cd /proper_directory" as the first line in the .do file.
- Altera_Forum
Honored Contributor
Here, try these two scripts:
# test1.do# # Example to show relative sourcing of scripts. # Path to this script set path ]] puts "Hello from test1" source $path/test2.do
The output from Modelsim is:# test2.do puts "Hello from test2"
The script was sourced from an arbitrary location. Cheers, DaveModelsim> source c:/temp/test1.do# Hello from test1# Hello from test2 - Altera_Forum
Honored Contributor
Dear all
i would like to know the script for creating the list file Presently i am adding the list signals manually by dragging and dropping from waveform Also when i drag and drop the signals to list file it will initially shows me the signals in default mode (whenever signal transition) I would like to have signals added to list file on each clock transition Please suggest me how to create the list.lst using the script or any good reference Thanks in advance - Altera_Forum
Honored Contributor
when checked the Modelsim reference manual,
i found the following commands for the question i posted config list -strobeperiod {100 ns} -strobestart {0 ns} -usestrobe 1 add list -notrigger clk -window mylist a b c d write list mylist.save; I will check if this can solve my issue ,Thanks