- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I'm a user trying to use modelsim. When I try to add simulation after compiling files. I'm having trouble with the work library showing up as empty. I think .v files or .mpf files should be created within work, but they always get created outside of it. Please help me... I don't know much about computers, so please explain in detail. Thank you.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Step 1 Make Sure the Work Library Exists
Without the work folder, all compiled files may go to the wrong places. Check ModelSim’s preferences to ensure that the working folder is set correctly. To examine the log screen, look at the bottom of the interface; type the following command.
vlib work
If the library already exists, ModelSim will say so. If it does not, this command will create it.
At the bottom of the interface, there is a window named transcript. Let's open ModelSim first to verify if the library exists.
Type the command vlib work.
Now let’s check to see if “work” appears.
Step 2: Compile Your Verilog Files into the Work Library
Now that we know the work library is there, let's make sure your Verilog files are compiled correctly.
Method 1: Using the GUI
- Go to the "Compile" menu → Click "Compile".
- Select your .v files from where they are saved.
- Look at the "Library" column in the compile window.
- It should say "work" (if not, select "work").
- Click "Compile", then "Done".
Method 2: Using Commands
Alternatively, you can compile manually by typing:
vlog -work work myfile.v
(Replace myfile.v with your actual file name.)
Step 3: Verify the Work Library is Not Empty
After compiling, check if files were added to work:
- Open "Library" tab on the left.
- Click the "+" next to "work".
- You should see your compiled modules listed.
If the work library is still empty, your files might not be compiled correctly.
Step 4: Check Your File Paths
If files are getting created outside of work, it may be due to incorrect paths.
- Look at the path where your .v files are saved.
- Make sure they are in your ModelSim project folder.
- Check where ModelSim is compiling to:
- Open Compile → Compile Options.
- Ensure the "Library" is set to "work".
Step 5: Load Simulation Properly
If your files are compiled correctly but still not appearing in simulation:
- Go to "Simulate" → "Start Simulation".
- Expand the "work" library.
- Select your top module.
- Click "OK".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I still haven't solved the work(empty) phenomenon. But your advice was a hint, so I was able to proceed with the simulation I wanted. Thank you. However, this is only a temporary measure, and I don't know how long I can proceed with all the work I want. Let me explain my situation now.
When I create a project, I get work(empty), but I'm using the fact that if I create a source and store it directly in the work folder, I can compile it. Why does saving a project directly in the work folder get workempty and the source file is possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Checking the understanding:
When you create a project, ModelSim automatically generates a work library, but in your case, it shows as empty even though you expect it to contain compiled files.
However, when you manually save and compile a source file into work, ModelSim recognizes it and allows simulation.
This means the library exists, but ModelSim’s project system isn’t linking to it properly.
If the understanding is correct, here are some possible Causes and Fixes
1. Your Work Library Is Not Set as the Active Library
Even though the work directory exists, ModelSim might not be treating it as the active library. Try setting it manually:
Command:
vmap work work
2. The Project Is Using a Different Work Library Path
Your project might be looking at the wrong work directory.
Open Project Settings and check where the "work" library is mapped.
Also, check the Compile Options to ensure compiled files are going into work.
Instead of manually placing source files into work, try moving them to the project folder and compiling from there.
3. Your Project Might Have Corrupted or Misconfigured Settings
Sometimes, ModelSim's internal settings can become misconfigured. Try these steps:
Close ModelSim and delete the modelsim.ini file in your project directory.
Restart ModelSim, and it will regenerate modelsim.ini with default settings.
Run:
vlib work
vmap work work
Then try recompiling.
4. ModelSim Might Be Using a Different Default Library
In the Library tab, right-click and check the library settings.
Ensure that work is the default library for compilation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any update for the above?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is there any further update or concern?
Thanks,
Regards,
Sheng
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As we do not receive any response from you on the previous answer that we have provided. Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page