未分类

Third-party simulation tools for on-site programmable gate arrays connection

FPGA Third-Party Simulation Tool Integration: A Complete Guide to Connecting Your Verification Flow

Most FPGA engineers hit the same wall eventually. The vendor’s built-in simulator works fine for a quick check, but when you need serious debugging, code coverage, or mixed-language verification, it falls apart. That is when you reach for a third-party simulator. The problem is not the simulator itself. The problem is getting it to talk to your FPGA toolchain without spending three days on configuration files.

This guide covers how to actually connect third-party simulation tools to the major FPGA development environments. No fluff. No brand worship. Just the steps that work.

Why You Would Even Want a Third-Party Simulator

The integrated simulators that ship with FPGA toolchains are convenient. You click a button and a waveform pops up. But convenience has limits.

Vendor simulators often lag behind in language support. SystemVerilog features, UVM methodologies, and advanced debugging tools tend to arrive later in the vendor ecosystem than in dedicated simulation platforms. When your testbench grows beyond a few hundred lines, you start feeling the gap.

Third-party tools also give you portability. Your simulation scripts do not care which FPGA vendor you target. The same testbench runs against Xilinx primitives today and Intel primitives tomorrow. That kind of flexibility saves weeks when you switch projects.

How the Integration Actually Works

At a high level, the connection between an FPGA toolchain and a third-party simulator comes down to three things.

Simulation libraries. These are pre-compiled models of the FPGA fabric. LUTs, flip-flops, block RAMs, PLLs, SERDES transceivers. The simulator needs these to know what a Xilinx BUFG or an Intel altpll actually does at the behavioral level.

Configuration files. The simulator needs to know where those libraries live. This is usually handled through an ini file or a library mapping file that tells the simulator which compiled library corresponds to which FPGA primitive.

Launch scripts. The FPGA toolchain generates a set of commands that compile your design, load the testbench, and fire up the simulator. This can be a TCL script, a shell script, or a do file depending on the tool.

Get these three right and everything else is just clicking buttons.

Connecting ModelSim or QuestaSim to Vivado

This is the most common combination in the industry. Vivado generates the design, Modelsim or QuestaSim runs the verification.

Compiling the Simulation Libraries

Vivado ships with a built-in command to compile all the necessary libraries for your target device family. Open Vivado, go to Tools, then Compile Simulation Libraries. Select your simulator, pick the language (Verilog or VHDL or both), choose the device family, and point it to an output directory.

The tool then calls the simulator’s compiler in the background and builds everything. This can take anywhere from five minutes to thirty minutes depending on how many device families you selected. Do not interrupt it.

When it finishes, check the output directory. You should see folders like unisims_ver, unimacro_ver, and secureip. These are your simulation libraries.

Wiring the Configuration File

This is the step most people miss. The compiled libraries exist on disk, but Modelsim does not know about them yet. You need to update the modelsim.ini file.

Find the modelsim.ini that lives in your Modelsim installation directory. Open it and add a line pointing to the library path you created earlier. It should look something like this.

1[Library]
2unisims_ver = C:/Xilinx/Vivado/2024.1/data/verilog/src/unisims
3unimacro_ver = C:/Xilinx/Vivado/2024.1/data/verilog/src/unimacro
4

Save the file. Restart Modelsim. The libraries should now appear in the Library panel when you compile your design.

Running Simulation From Vivado

Once the libraries are wired, go to Flow, then Simulation Settings. Set the simulator to Modelsim or QuestaSim, point it to the simulator executable, and specify the library path. Now when you click Run Simulation, Vivado generates all the files, launches the simulator, and you see your waveform.

If you want more control, use the TCL console. The command launch_simulation gives you full access to every option without going through the GUI.

Connecting ModelSim to Quartus Prime

Quartus takes a slightly different approach. Instead of a separate compilation step, Quartus can generate simulation files directly from the project.

Setting the Tool Path in Quartus

Go to Tools, then Options. Find EDA Tool Options under the General category. Enter the full path to your Modelsim executable. For example.

1C:/modeltech64_2024.1/win64/vsim.exe
2

Make sure the path has no Chinese characters and no spaces. This causes more problems than anything else in the entire flow.

Generating the Simulation Netlist

In your project settings, go to EDA Tool Settings, then Simulation. Set Tool name to ModelSim-Altera. Choose your output format (Verilog or VHDL). Set the top-level module and make sure Compile test bench is enabled.

Quartus then generates a simulation directory under your project root. Inside you will find the compiled netlist, a testbench template, and a modelsim.ini file. Open Modelsim, create a new project in that directory, add all the generated files, and you are ready to simulate.

The Testbench Template Trick

Quartus can auto-generate a testbench template for you. Go to Processing, then Start Test Bench Template Writer. This creates a skeleton testbench with the correct port mappings. You still need to write the stimulus yourself, but at least the boilerplate is done.

One thing to watch for. If your design uses Altera-specific IP like PLLs or FIFOs, make sure the simulation libraries include altera_mf. You may need to manually add this library to your Modelsim project.

Working With Domestic FPGA Toolchains

The integration pattern is the same for non-Western FPGA vendors, but the details differ.

Pango Design and Modelsim

Pango Design Suite (used with Logos series devices) has a dedicated menu for this. Go to Tools, then Compile Simulation Libraries. Set the simulator executable path to your Modelsim vsim.exe. Set the output directory to a clean folder with no spaces in the path. Click Compile.

When it finishes, copy the generated modelsim.ini to your Modelsim installation directory. Replace the existing file. This registers all the Pango-specific primitives with the simulator.

TD Software and Modelsim

For Anlogic EF2 series devices using TD software, the flow is similar. TD generates simulation models for the FPGA fabric. You compile those models into a Modelsim library using the vlog command. Then you add the library path to your modelsim.ini.

The directory structure matters here. Keep TD project files separate from Modelsim work files. A clean layout looks like this.

1project_root/
2├── td_project/
3│   ├── src/
4│   └── constraint/
5├── modelsim_work/
6│   ├── anlogic_lib/
7│   └── modelsim.ini
8└── doc/
9

This keeps your simulation environment reproducible. When a new engineer clones the repo, they run one script and everything works.

Common Integration Failures and How to Fix Them

Library not found errors. This means your modelsim.ini is not pointing to the right place. Double-check the path. On Windows, the path separator is a backslash. Make sure you are not mixing forward and back slashes.

Simulator launches but waveform shows X everywhere. The simulator loaded but could not find the primitive models. This usually means the unisim library is not mapped. In Modelsim, type vmap to see all mapped libraries. If unisims_ver is missing, add it manually.

Version mismatch crashes. Vivado 2024.1 expects Modelsim 2023.2 or later. If you try to use an older simulator, you get cryptic error messages. Check the compatibility matrix before you start.

Path with spaces or non-ASCII characters. This breaks TCL scripts silently. The tool does not throw an error. It just fails to find files. Always use paths like C:/EDA/Vivado/ not C:/Program Files/Xilinx/.

Building a Reusable Simulation Script

Do not rely on the GUI every time. Write a TCL script that does the full flow.

tcl1# Setup paths
2set vivado_path "C:/Xilinx/Vivado/2024.1"
3set modelsim_path "C:/modeltech64_2024.1/win64"
4set work_dir "./sim_work"
5
6# Compile libraries
7exec $vivado_path/bin/vivado -mode batch -source compile_libs.tcl
8
9# Launch simulation
10exec $modelsim_path/vsim -c -do "do run_sim.do; quit -f"
11

The compile_libs.tcl calls Vivado’s library compilation. The run_sim.do compiles your RTL, loads the testbench, runs the simulation, and dumps the waveform. One command. Every time. Same result.

This is what separates a hobby project from a production flow. The script does not forget steps. The script does not click the wrong button. The script runs the same way on Monday morning and Friday afternoon.

Keeping Your Simulation Environment Clean

Version control your simulation scripts. The TCL files, the do files, the modelsim.ini. All of it goes into Git. When someone breaks the build, you bisect to the exact commit that introduced the problem.

Do not commit generated files. The compiled libraries are large and they change with every tool version. Commit the scripts that generate them, not the output.

Use a separate work directory for each project. Modelsim caches compiled designs in the work library. If two projects share the same work directory, you get name collisions that are almost impossible to debug.

Pin your tool versions. A simulation that passed last month might fail today if the vendor pushed a library update. Lock your Vivado and Modelsim versions in a configuration file and check them at the start of every build.

tcl1if {[version -short] ne "2024.1"} {
2    puts "ERROR: Wrong Vivado version. Expected 2024.1."
3    exit 1
4}
5

That one check saves you from hours of chasing phantom bugs that are actually just version drift.

ChipApex is a global distributor of electronic components: ICs, semiconductors, passives & interconnects. Source active & obsolete parts with wholesale pricing, fast RFQ response, and worldwide delivery.Official website address:chipapex.com

Related Articles

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

Back to top button