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.

[SOLVED] ModelSim 10.0 - Is it possible to have a TCL script run automatically at Startup ?

Status
Not open for further replies.

Gerry_robotics

Member level 1
Joined
Feb 1, 2008
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Canada
Activity points
1,708
Hi Folks,

I'm wondering if it is possible to somehow edit the default settings or edit a system file in Modelsim,
in order to have a list of TCL commands be executed automatically at Startup when Modelsim loads.

Perhaps have a few TCL "do commands" saved in script.txt file that could run automatically at startup?



Is this possible?

Your help will be appreciated.

Regards,
-Gerry
 

we can change the default initial settings by editing the modelsim.ini file ....

Its not able to edit ,so we need to copy the file and delete the real one, then the copied file is able to edit

Ok,
so for instance I normally type in a few TCL commands like the following once ModelSIm loads up.

My Code:
Code:
view wave
apply_button_adder wave controls right green black Run_50_uS {run 50}
apply_button_adder wave controls right red white Run_100_uS {run 100}
apply_button_adder wave controls right blue white Run_500_uS {run 500}
apply_button_adder wave controls right yellow black Run_1000_uS {run 1000}
apply_button_adder wave controls right black yellow Run_10,000_uS {run 10000}

Then What I started doing was to save this code in a text file called "buttons.txt" that I saved in my projects "work" directory.

Then at the command prompt of ModelSim I would type the TCL command "do buttons.txt"

This would execute all of the TCL commands at once.


Now what you are saying is that I can embed this into the ModelSim.ini file ?

In which section would I put this info in ? and what commands do I need to enter ?
Is it the same as being at the TCL command prompt ?

Sorry I'm pretty clueless here. :(



Thanks for your help.

Regards,
-Gerry
 

Any Ideas how I could make this work ?

-Gerry

Hi gerry

I came across your post when i was seaching for an answer for the same question. the answer is simply to source your script at the end of pref.tcl, that is loaded everytime modelsim starts up. its the dirty way but at least it works for me, and sets things like using notepad++ as editor, etc.

BR
megkel on modelsim 6.5
 
  • Like
Reactions: ivlsi

    ivlsi

    Points: 2
    Helpful Answer Positive Rating
Finally!!!

Fantastic!!!! :) Megkel.

Thanks so much. How did you figure this out?
Right on! thanks for letting me know. :)

Cheers!
-Gerry
 

Hi

In the earlier versions of modelsim we get a notification that preferences are loaded from this file. I gave it a try and it worked! Please let me know if you find a better or less dirty way! Perhaps you can pass commandline args or something like that?
BR
M
 

Could you please provide a line, which should be added to the pref.tcl file in order to include the aliases file? Thank you
 

Hi,

If you want to run tcl commands, set aliases, etc. when starting modelsim/questa you can always run `vsim -do location_of_tcl_script`
Guess you could put a `source location_of_tcl_script` in the pref.tcl as well.
 
  • Like
Reactions: ivlsi

    V

    Points: 2
    Helpful Answer Positive Rating

    ivlsi

    Points: 2
    Helpful Answer Positive Rating
Can you please provide the whole script (do file) for all the flow (compilation+simulation) with all the often used switches (like -vopt, +acc, etc)? Thank you
 

Modelsim will check for a modelsim.tcl file which is in the same directory you invoke Modelsim or your home directory, or whatever the MODELSIM_TCL environment variable is set to.

I see this email is originally from a couple years ago and I found this information more recently in a modelsim GUI reference guide (10.3c), but was likely around in prior versions.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top