Changing the modelsim.ini file (ModelSim)

DylanM picture DylanM · May 5, 2015 · Viewed 14.7k times · Source

I would like to make a modifications on several parameters in ModelSim like the MessageFormat for instance. To that extent, I made changes to the modelsim.ini file located in ModelSim installation directory but when I re-launch ModelSim, the default parameters are still there.

The procedure is quite simple according to ModelSim's User Guide :

  1. Open the modelsim.ini file with a text editor.
  2. Find the variable you want to edit in the appropriate section of the file.
  3. Type the new value for the variable after the equal ( = ) sign.
  4. If the variable is commented out with a semicolon ( ; ) remove the semicolon.
  5. Save.

I know I'm editing the right file (upon launch, ModelSim prints "reading C:/[install path]/modelsim.ini and if I delete or rename it I get a warning) so I really have no idea why none of my changes are taken in account.

Is there something I'm not doing right? It feels like I'm missing something obvious here.

Answer

DylanM picture DylanM · May 11, 2015

I finally found what was causing this :

When ModelSim starts, it searches for a modelsim.ini file in your project directory. If found, transcript will simply print "reading modelsim.ini". However, in my case, the file was not read, i.e. the parameters specified were not taken in account and, if the file was empty or contained random text, no error or warning appeared when launching ModelSim.

If it can't find a modelsim.ini file there, it looks for the same file in the install directory. If found, the transcript will print "reading [install directory]/modelsim.ini". The rest is the same as before, this file is not really read (again, in my case).

If a modelsim.ini file cannot be found anywhere, transcript will print the following error : " Error: (vish-7) Failed to open ini file "modelsim.ini" in read mode." However, apart from this error, everything will work correctly.

It turned out that the parameters ModelSim actually used were stored in another file : [ProjectDirectory]/[ProjectName].mpf This file contains exactly the same information that you find in a .ini file (the content was in my case exactly the same as in the default .ini).

Changes to this file are correctly taken in account by ModelSim.