3

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.

DylanM
  • 333
  • 2
  • 5
  • 17

4 Answers4

3

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.

DylanM
  • 333
  • 2
  • 5
  • 17
2

I'll also point out that if you don't want to rely on default order finding the file, there is also a vsim parameter to specify where the .ini file is:

For example:

vsim -modelsimini ./modelsim.ini -do sim.do top
Hambone
  • 15,600
  • 8
  • 46
  • 69
Dan Cogan
  • 21
  • 1
1

I don't remember 100% of the .ini precedence and copying logic, but you probably have a modelsim.ini in the directory from which you start the simulation. That file probably has the old settings in it.

Modelsim use a local .ini file when you start a simulation, I think it totally ignores the global .ini if a local one is there. I also think it copies the global one when you start the simulation for the first time, i.e. if there is no local .ini.

Modelsim needs a local .ini file, since it contains both the parameters and the library mapping for the simulation. Try modifying it or deleting it to see if your new parameters get used.

Also note that if you launch Modelsim from another tool (like Xilinx's design suite), the .ini file may come from the other tool instead of Modelsim. For example, when modelsim is launched from Xilinx, it has a .ini that contains the mapping for Xilinx's simulation libraries.

Jonathan Drolet
  • 3,318
  • 1
  • 12
  • 23
  • Thanks for your answer. I've tried a few things : the file with the highest priority is the .ini in the project directory, followed by the .ini in the install directory (read only if the first can't be found). The changes in none of them has effect unfortunately. However, if none of them can be found I get an error message on launch. *I'm using ModelSim as installed with the Libero SoC Suite but I launch it directly from its install directory..* – DylanM May 06 '15 at 12:40
0

I've had this same problem occasionally. If I recall correctly, the way around it was to create a new modelsim.ini file located one directory above the ModelSim executable, and then edit this file.

rick
  • 1,626
  • 11
  • 18
  • Thanks, I tried that, however it didn't take it in account either. Actually, even if the modelsim.ini was read on startup, the applied parameters were the ones in a .mpf file (with the same content as a .ini) in the project directory.. – DylanM May 11 '15 at 13:10