Electronics > FPGA

ModelSim "soft pathnames" and MGC_LOCATION_MAP

(1/1)

Bassman59:
Has anyone ever used this feature on Windows?

I'm working from home for a bit and all of my ModelSim projects are broken because they have hard absolute paths.

The project setting "Location map -- convert pathnames to softnames" requires an environment variable MGC_LOCATION_MAP, but there's no useful documentation from Mentor about how to set this.

Ideally, of course, the map would be to a location relative to the project file's directory. That is, given a tree:


project root \
             \src
             \tb
             \fitter

and the ModelSim project file lives in tb.

Ideally, the path to the sources would be ..\src and the path to test benches would be in ..\tb which is referencing tb but that's OK.

Bassman59:
replying to myself:

This feature is stupid.

If you do NOT check the "convert pathnames to softnames" box, then your MPF can have relative paths that will not get converted to an absolute path. The environment variable doesn't matter.

The problem is that when you add files to the project, they are added with an absolute path, so you have to go in and manually edit the MPF to change the paths to relative.

I guess the design decisions they made back in 1990 or whenever are still paying dividends!

Daixiwen:
I stopped creating projects in Modelsim when I discovered VUnit. If you can spare a few days to become familiar with it you will save a lot of time in the long run. You create your project files in Python, with all the power of the language for automatic absolute/relative path finding, and you can include files with wildcards. VUnit automatically makes a dependency tree from your source code and only recompiles the files that need recompiling. It automatically finds your testbenches, and you can write them so that each test can be individually run during a test or not.
If you combine this with an add-on such as TerosHDL in Visual Studio Code, you can run each test directly without leaving the editor and without even needing to open Modelsim.

Bassman59:

--- Quote from: Daixiwen on January 31, 2022, 09:11:12 am ---I stopped creating projects in Modelsim when I discovered VUnit. If you can spare a few days to become familiar with it you will save a lot of time in the long run. You create your project files in Python, with all the power of the language for automatic absolute/relative path finding, and you can include files with wildcards. VUnit automatically makes a dependency tree from your source code and only recompiles the files that need recompiling. It automatically finds your testbenches, and you can write them so that each test can be individually run during a test or not.
If you combine this with an add-on such as TerosHDL in Visual Studio Code, you can run each test directly without leaving the editor and without even needing to open Modelsim.

--- End quote ---

Thanks! I just installed it, now to find those few days to spare on a small project so I can wrap my head around it.

ModelSim's UI is so long in the tooth it's unbelievable.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version