How To: Simulate a Design with Intel Quartus IP

Modified on Tue, 9 Jul at 6:08 PM

How To: Simulate a Design with Intel Quartus IP

Introduction

This How To guide is intended to be used by Intel customers to simulate their FPGA designs with Quartus IP via Metrics DSim Cloud. It provides a generic procedure that can be applied to all such designs. The procedure gives recommended best practices without limiting the user's flexibility on workflow.



Contents

  1. Prerequisites
  2. Procedure
    1. Prepare your local workspace
    2. Create a compile list
    3. Create a compile script or list of DSim Cloud CLI commands
    4. Simulate your design in DSim Cloud

Prerequisites


Quartus

  1. Have a working installation of Intel Quartus Prime on your local machine.
  2. Successfully compile your design in Quartus Prime.

DSim Cloud

  1. Complete the DSim Cloud Tutorial.
  2. Understand how to run a simulation in DSim - Verilog and/or VHDL, as applicable to your design.
  3. Review considerations for choosing the DSim Cloud local workspace.
  4. Understand how to use libraries in DSim.
  5. Understand how to use DSim Cloud CLI Tool simulator commands.

Procedure


1. Prepare your local workspace

Ensure that all files needed to simulate your design are under your local workspace. These files include all design, testbench, memory initialization, and source code for generated IP blocks. For the purpose of this guide, we will call this local workspace <my_project>.


From the local workspace root directory initialize the local workspace:


 

Create a folder under *&lt;my_project&gt;* called *metrics* where you will simulate your design with DSim Cloud. For example, you can create it as *&lt;my_project&gt;/simulation/metrics*. Copy all your memory initialization files (*\*.mif*) to this folder. *\*mif* files are not compiled but must reside in the same folder where you run your DSim Cloud simulation.

If any source code for an IP block is encrypted, you must provide the file encrypted for Metrics. Metrics encrypted IP files are located in the ***intelfpga*** folders alongside the encrypted IP folders for other simulators (*aldec*, *cadence*, *mentor*, *synopsys*). For example:

*/intelFPGApro/22.2/ip/altera/alterajesd204/src/lib/phy_adapter/**intelfpga**/alterajesd204phyadapterxs.v*

To use any of the IP encrypted for Metrics, you will have to either copy the files from these ***intelfpga*** directories into your local workspace and reference them from there, or use the files from the DSim Cloud by referencing them using the `QUARTUS_HOME` environment variable. See [Quartus FPGA HDL Library Package](./dsim_cloud_intel_quartus_library_package.md) for more information.

<div id="create-a-compile-list"></div>

### 2. Create a compile list

For all the files required for compilation and simulation, you must know their language type, the library into which they should be compiled, and their source file location. For VHDL files, the order of compilation must be known. If desired, you can create a list of all files needed to compile and simulate the design, to keep track of this information. For example, under *&lt;my_project&gt;*:

|**Order**|***file_name***|**Type\***|***library_name***|***path***|
|---|---|---|---|---|
|1|fifo_generated.v|Verilog|sim_lib|/ip/sim/|
|2|my_block.vhd|VHDL|design_lib|/src/hdl/|
|3|my_unencrypted_ip.v|Verilog|ip_lib|/ip/sim/|
|4|encrypted_ip_1.v|Verilog|ip_lib|/ip/sim/|
|5|encrypted_ip_2.vhd**|VHDL|ip_lib|%QUARTUS_HOME%/ip/altera/../..<br/>/intelfpga/encrypted_ip_2.vhd|
|6|my_dut.vhd|VHDL-2008|work|/src/hdl/|
|7|my_tb.sv|SV|test_lib|/src/tb/|

\*VHDL = VHDL-1993 unless otherwise noted

\*\*this file is not in your local workspace, but is being referenced from the DSim Cloud Quartus FPGA HDL Library Package

A compile list may be easily generated in Quartus by doing the following:

<span>1.</span>  Run **Analysis & Synthesis**.

<span>2.</span>  Under the Compilation Report, click **Synthesis**.

<div>



</div>

<span>3.</span> Right-click **Source Files Read**, then click **Export**.

<span>4.</span> Copy the list of files, in compilation order (from top to bottom) from the resulting *Source Files Read* report that end in *.vhd, *.vhdl, *.v, or *.sv into the compile list.

<div id="create-a-compile-script-or-list-of-dsim-cloud-commands"></div>

### 3. Create a compile script or list of DSim Cloud CLI commands

There are many ways to compile and simulate your design with the DSim simulator, contained within the DSim Cloud platform. Basically, you need to wrap the DSim command options to [analyze, elaborate, and run](./source/dsim/docs/usermanual/SimulationComponents.md) your design, in single quotes so that the DSim command is executed in the remote workspace.

Both IP and design files must be compiled into the appropriate libraries with DSim Cloud CLI commands. The commands are different for Verilog / SystemVerilog files and VHDL files.

<div id="verilog_systemverilog"></div>

#### Verilog / SystemVerilog

 

mdc dvlcom -a '-lib /.v'


 

For example:

 

mdc dvlcom -a '-lib sim_lib ./ip/sim/fifo_generated.v' mdc dvlcom -a '-lib ip_lib -F ip_filelist.txt'


 

<div id="vhdl"></div>

#### VHDL

 

mdc dvhcom -a '-vhdl93 -lib /.vhd'


 

For example:

 

mdc dvhcom -a '-vhdl2008 -lib work ./src/hdl/my_dut.vhd'


 

Depending on the complexity of your design, and your familiarity with scripting, you can put all these DSim Cloud CLI commands together in a compile script and run the script with DSim Cloud. The script runs on your local machine and makes calls to DSim through the DSim Cloud CLI.

<div id="simulate-your-design-in-dsim-cloud"></div>

### 4. Simulate your design in DSim Cloud

<span>1.</span>  Start a remote workspace in your local workspace directory *&lt;my_project&gt;* from section 1 of the Procedure.

 

mdc workspace start


 

<span>2.</span>  Navigate to the *&lt;my_project&gt;/simulation/metrics* folder where you will run your simulation.

<span>3.</span>  [Set up the Intel Quartus precompiled libraries in DSim Cloud](./how_to_set_up_intel_quartus_precompiled_libraries_in_dsim_cloud.md).

<span>4.</span>  Compile all the files into their appropriate libraries using the methods in section 3.

<span>5.</span>   Elaborate your design. For example:

 

mdc dsim -a '-genimage image -top test_lib.my_tb +acc+b'


 

<span>6.</span> Run your design. For example:

 

mdc dsim -a '-image image -waves waves.mxd -wave-scope-specs wave.list'


 

<span>7.</span> You can view waveforms and/or download the DSim log to debug your simulation.

 

mdc view wave waves.mxd
mdc download dsim.log


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article