0% found this document useful (0 votes)
15 views5 pages

Intel Quartus ModelSim Simulation Guide

Uploaded by

reventhhunt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Intel Quartus ModelSim Simulation Guide

Uploaded by

reventhhunt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

3 Quartus II / Intel Quartus Prime


This tutorial explains how to perform behavioral and post-route simulations using the
Intel Quartus development tool and ModelSim-Intel FPGA Edition. While Intel provides
a version of ModelSim bundled with Quartus, users sometimes face issues with
simulation setup or ModelSim licensing. This guide will help resolve common issues and
walk you through the process of setting up simulations.

If you discover improvements or corrections to this document, feel free to suggest them
or contact your course instructor/project guide.

Pre-requisite Software

Ensure the following are installed:

- Intel Quartus Prime (Lite or Standard Edition)

- ModelSim-Intel FPGA Edition (bundled with Quartus or downloaded separately)

- Proper device support installed via Quartus installer (e.g., Cyclone, Arria families)

Setting Up the Environment for Simulation

1. Set Environment Variables (if needed)

Most setups using ModelSim-Intel FPGA Edition don’t require manual setting of
environment variables, but if you use a separate installation of ModelSim:
1. Locate the [Link] file (usually inside intelFPGA_lite\XX.X\modelsim_ase).

2. Make it writable: Right-click → Properties → Uncheck "Read-only".

3. Set environment variables (for custom setups):

- Go to This PC → Properties → Advanced system settings → Environment Variables.

- Add or edit:

- ModelSim → C:\intelFPGA_lite\XX.X\modelsim_ase\[Link]

- Path → Append: C:\intelFPGA_lite\XX.X\modelsim_ase\win32aloem

2. Compile Design for Simulation in Quartus

1. Create or open a Quartus project.

2. Write or import your HDL code (VHDL or Verilog).

3. Go to Assignments → Settings → EDA Tool Settings → Simulation:

- Set Tool Name to ModelSim-Altera (or Intel FPGA Edition).

- Set Format to VHDL or Verilog.

- Set simulation directory (default is /simulation/modelsim).

- Set Run Time Script to [Link] (automatically generated by Quartus).

4. Click OK.

3. Generate Simulation Netlist


1. Go to Processing → Start → Start EDA Netlist Writer.

- This generates the simulation files inside /simulation/modelsim.

4. Simulate in ModelSim

1. Open ModelSim (Intel FPGA Edition).

2. Navigate to your simulation directory (/simulation/modelsim).

3. Run the following commands (manually or using [Link]):

vlib work

vmap work work

vlog your_design.v ; For Verilog

vcom your_design.vhd ; For VHDL

vsim your_top_module

run 100us

4. Use ModelSim GUI or wave commands to add signals:

add wave *

5. Post-Route (Timing) Simulation (Optional)

1. Perform full compilation in Quartus.

2. Go to Assignments → Settings → EDA Tool Settings → Simulation.


3. Under Simulation Model, choose Timing Simulation instead of Functional Simulation.

4. Re-run EDA Netlist Writer.

5. Follow similar ModelSim steps as above, but using the .vo or .sdo files for gate-level
simulation.

6. Simulation Library Setup (if needed)

If you are using a third-party version of ModelSim (not Intel FPGA Edition):

1. Go to Quartus installation directory:

C:\intelFPGA_lite\XX.X\quartus\eda\sim_lib

2. Manually compile libraries in ModelSim:

vlib altera

vlog -work altera altera_primitives.v

(Repeat for other folders: lpm, sgate, altera_mf, etc.)

3. Add compiled libraries to [Link] using vmap:

vmap altera path_to_altera_library

7. Notes and Tips

- Make sure to use ModelSim-Intel FPGA Edition if available – it automatically handles


most library links.
- You can also write testbenches in a separate file and include them in the simulation
directory.

- Use run –all in ModelSim to simulate the full duration.

- Waveform outputs can be saved for review.

Common questions

Powered by AI

To compile libraries in ModelSim when not using the Intel-specific version, first navigate to the Quartus installation directory where simulation libraries are located (e.g., C:\intelFPGA_lite\XX.X\quartus\eda\sim_lib). Then, use ModelSim commands such as 'vlib' to create library directories and 'vlog' to compile the libraries like 'altera_primitives.v'. This manual step is necessary because third-party ModelSim versions do not automatically handle library linking like the Intel FPGA Edition does, ensuring that all necessary primitives and components are available for simulation .

The 'vcom' and 'vlog' commands in ModelSim are used to compile VHDL and Verilog files, respectively, as part of the simulation setup. They translate the high-level HDL code into an intermediate form that ModelSim can execute, preparing the simulation environment within the designated 'work' library. These commands ensure that the design files are correctly interpreted and ready for simulation execution .

The 'vsim.do' script file in ModelSim automates the setup and execution of simulations by storing a sequence of ModelSim commands required to initialize the simulation environment. It can include commands to create libraries, map them, compile design files, and run simulations with specific parameters, thus streamlining the workflow and minimizing human error during repetitive simulation tasks .

A user might need to modify the 'modelsim.ini' file manually in scenarios where the default ModelSim installation does not include certain configurations or paths needed for simulation. This could occur when using a separate ModelSim installation where default library paths are incorrect or missing. Manually editing 'modelsim.ini' allows users to configure specific library mappings, simulation directories, and environment settings, ensuring that ModelSim can properly locate and use the right files and libraries .

The command 'add wave *' in ModelSim adds all the signals to the waveform window for observation during a simulation. It integrates into the simulation process by allowing users to visually inspect the signal changes over time, aiding in debugging and analysis of the circuit's behavior. This visual representation is crucial for understanding timing relationships and logic errors, making it an essential part of the simulation analysis .

Environment variables play a critical role in customizing the setup process for ModelSim when not using the bundled Intel FPGA Edition. For a separate installation of ModelSim, users need to manually set the environment variables using the modelsim.ini file by locating it in the installation directory and making it writable. Then, specific paths like those in "Advanced system settings" should be set, which enables ModelSim to locate necessary support files, potentially resolving issues if automatic configurations fail .

Functional simulation is used to verify the logic and behavior of the design without any timing delays, focusing on logic correctness as described in the HDL code. In contrast, timing simulation considers the delays introduced by logic synthesis and place-and-route processes, providing a more realistic simulation by including timing information. When using Quartus to generate netlists, the user sets the simulation model type to either 'Functional Simulation' or 'Timing Simulation', and accordingly, different files are used for the simulations in ModelSim .

Using 'run –all' in ModelSim commands the simulator to continue the simulation until all events are processed or a stop condition is encountered. This is useful in scenarios where the entire behavior or convergence of a design needs to be observed without manually specifying simulation time bounds. It simplifies the process, particularly in extensive test setups, where capturing the complete set of interactions is necessary for validating the design .

The guide recommends using ModelSim-Intel FPGA Edition if available because it offers automatic handling of library links, reducing the configuration required by the user. This seamless integration avoids potential compatibility issues and ensures that simulations can be set up more efficiently without manual errors .

To set up a simulation directory in Quartus for ModelSim, open a Quartus project and navigate to Assignments, then Settings, followed by EDA Tool Settings, and select Simulation. Set the tool name to ModelSim-Altera or Intel FPGA Edition and specify the HDL format. The default simulation directory is '/simulation/modelsim', where Quartus will generate the necessary simulation setup scripts and netlists, such as 'vsim.do', which facilitates the simulation process in ModelSim .

You might also like