Forum Discussion
ModelSim Intel FPGA Ed. 2020.1 not updating changes to HDL File
This is a very common point of confusion. ModelSim does **not** directly read your source HDL files at simulation time — it compiles them into a compiled library (by default the `work` library directory on disk). When you "reload" or "restart" the simulation inside ModelSim, it re-elaborates from those already-compiled library files, **not** from your updated source. That's why you keep seeing the original behaviour — the compiled library is stale.
Here's the root cause and the fix:
Why it happens
The simulation workflow requires assembling a script that compiles the simulation files into libraries, elaborates the top-level testbench, and then runs the simulation model. ModelSim works from the compiled library output of that compilation step, not directly from your HDL sources. FPGA Simulation Generic Workflow Simply reloading or restarting within ModelSim skips the compilation step entirely.
What you need to do after every Quartus recompile
- Recompile in Quartus first. Click Processing > Start Compilation to compile the design and regenerate the simulation files (including the
.doscript). The Messages window indicates when compilation is complete. ModelSim – FPGA Edition Simulation Quick-Start Quartus Prime Standard Edition - Re-run the RTL Simulation launch from Quartus. Click Tools > Run Simulation Tool > RTL Simulation. The Quartus Prime software launches ModelSim – FPGA Edition ModelSim – FPGA Edition Simulation Quick-Start Quartus Prime Standard Edition with a freshly generated script that recompiles all the HDL into the work library from scratch. This is the clean way to pick up your changes.
- Alternatively, if you prefer to stay inside ModelSim, re-execute the generated
.doscript from the Transcript window (e.g.do simulation/mentor/msim_setup.tclor whichever script Quartus generated). Platform Designer generates a ModelSim simulation script (msim_setup.tcl) that compiles the required files for simulation and sets up commands to load the simulation. You can run this script in ModelSim to compile, elaborate, or load for simulation. Embedded Design Handbook Re-running it forces recompilation of the updated sources.
Bottom line: "Restart" or "Run -all" inside an open ModelSim session only re-runs an already-elaborated model. You must re-execute the compilation script (or use Tools > Run Simulation Tool > RTL Simulation from Quartus) to push your HDL edits into the work library and make ModelSim see them. Once you build that habit into your edit → compile in Quartus → re-run script → simulate loop, the stale-file problem goes away.
Note: To continue using AI Responder, please start your next inquiry with ai_responder
Disclaimer (Beta): The AI Responder is currently provided as a beta feature. AI-generated responses may contain errors or omissions. Please verify technical guidance with official Altera documentation before implementation.
Thank you very much.