Author Topic: ModelSim "soft pathnames" and MGC_LOCATION_MAP  (Read 1497 times)

0 Members and 1 Guest are viewing this topic.

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2502
  • Country: us
  • Yes, I do this for a living
ModelSim "soft pathnames" and MGC_LOCATION_MAP
« on: January 28, 2022, 04:06:05 pm »
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.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2502
  • Country: us
  • Yes, I do this for a living
Re: ModelSim "soft pathnames" and MGC_LOCATION_MAP
« Reply #1 on: January 28, 2022, 04:21:36 pm »
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!
 

Offline Daixiwen

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: no
Re: ModelSim "soft pathnames" and MGC_LOCATION_MAP
« Reply #2 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.
 
The following users thanked this post: Bassman59

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2502
  • Country: us
  • Yes, I do this for a living
Re: ModelSim "soft pathnames" and MGC_LOCATION_MAP
« Reply #3 on: January 31, 2022, 07:29:11 pm »
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.

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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf