Using HWD with ModelSim

This is the ModelSim preferences box.

Each time ModelSim compiles the source code, temporary files are created. These files are stored somewhere.

You can choose to store these files in the source code location, or create a specific path for the project files, in which all temporary files (of all sources) will be compiled into.

It is better working that way in case you have instantiations in your code, so Modelsim will check all relations and look for the previous file data in the WORK folder.

When the 'Use file location..' checkbox is checked, each file will be compiled in its own folder, as shown here:

When the 'Use file location..' checkbox is un-checked, and you choose a 'global' folder, all files will be compiled in one location, as shown here:

Here's an Example:

We want to compile Top.vhd, which is located here:

c:\projects\CounterOne\topProject

In Top.vhd there’s an instantiation to a component called: myFSM.vhd located here:

c:\projects\CounterOne\fsm1\

If you click on ‘Use file location..’, after compiling Top.vhd, the temporary files will be created here:

c:\projects\CounterOne\topProject\work (assuming you chose ‘work’ as your library name).

After compiling myFSM.vhd, the temporary files will be created here:

c:\projects\CounterOne\fsm1\

There’s no connection between the files. There is a chance the compilation will fail.

If you choose a global ‘work’ folder location, say here:

c:\projects\CounterOne\work 

(so, ‘Use file location..’ is not checked), all files will be compiled into that folder, and ModelSim would see all binding connections. This is a better approach.