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.

ModelSim script create variable, how to?

Status
Not open for further replies.

legendbb

Member level 1
Joined
Nov 16, 2013
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,516
Just wondering if it is possible to create variable and dereference it by using $var.

Need to define a variable holding absolute path. Desired to be able to use it as $var/../

Thanks,
:roll:
 

yes - modelsim scripts are just tcl

set var /some_path/

vcom $var/my_vhdl_file.vhd
 

As TrickyDicky says. Modelsim transcript just runs tcl commands.

The thing about tcl is "Everything is a string"

There are some key substitution characters which are $ and \.

When using quotations "this\n is \\ a test of var $var" The substitution takes places
Whereas when using curly brackets {} what is contained within is passed entirely as is

type in the following into the modelsim transcript

Code TCL - [expand]
1
2
set var_a "tes\ts"
set var_b {tes\ts}

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top