3

How do you set the "Compile to Library" setting on an individual file without using the GUI. I would like to set it from a TCL script.

The "Place in Folder" setting can be set when using the project addfile command in a TCL script.

toolic
  • 57,801
  • 17
  • 75
  • 117
Mark
  • 31
  • 2
  • 2
    What command sequence are you using to build your library? – scary_jeff Jul 18 '16 at 14:24
  • I am using the TCL script to only create & configure the project. Once the project is created, I want to use the dropdown menus to compile (such as compile all or compile selected). I do not want to have to call vlog and vcom manually or in a script. – Mark Jul 19 '16 at 15:26

2 Answers2

3

You can use the -work option to vlog, vcom, etc. to set the target library for each set of files:

vlib mylib
vlog -work mylib ...
vcom -work mylib ...
teadotjay
  • 1,395
  • 12
  • 15
  • I would like to create & configure the project using TCL. Then interactively work with the GUI, as it already has dropdowns to compile. Using the drop downs to compile requires the use to set the "Compile to Library" field on each file by changing the compile settings for each file. I could write another TCL script to call vlog and vcom with the -work flag set, but I would like to avoid that. – Mark Jul 19 '16 at 15:32
  • I usually write a Makefile that includes the compile commands and call it from within ModelSim/Questa. So to reload and re-run a sim I just type "make; restart -f; run -a". If you were so inclined you could bind that to a button to save on typing. – teadotjay Jul 20 '16 at 00:23
0

You can set library mapping for files in your modelsim.ini using the LibMap option:

LibMap = (**/*.vhd => <library name>);

It won't show it in the project / file properties, but when you gui-compile it will actually compile it in the correct library