Quartus® Prime Pro Edition User Guide: Third-party Simulation

ID 683870
Date 4/01/2024
Public
Document Table of Contents

1.2.1. Compilation Stage

In the first stage of simulation you run compilation commands.

Inputs to a Compilation Command

The compilation command takes as input one or more design files, testbench files, and simulation library files.

What Does a Compilation Command Do?

A compilation command does the following:

  1. Reads the files that you specify as arguments to the command.
  2. Analyzes the content of the files, which includes checking for syntax errors and other issues.
  3. Stores the analyzed content (such as the module definitions) in a directory in a simulator specific proprietary format. The directory is known as a library directory. You can also specify the directory as an input argument.

    This step of storing the analyzed content of HDL files in a library directory is known as compiling the files into a library directory, or simply compiling a file.

Compiling a file is similar to running Quartus® Prime Analysis & Synthesis, in that the analyzed file content is stored in design database directory. The compilation is also loosely analogous to compiling a C/C++ file into an object file, where the object file is stored in a separate directory.

The library directory contains the definitions of all modules that are defined in the files that you compiled into the library. You use these module definitions in the elaboration stage. You may need to run multiple compilation commands to compile all the files into library directories.

Compilation Command Example

Consider a design example that has two design files, foo.sv and bar.sv, and one testbench file, my_testbench.sv.

To compile these files, you first create a new directory, for example my_work. Next, you run the simulator specific compilation command that takes in the file names and directory name as inputs, as the File and Directory Name Input to Simulator Specific Compilation Command figure shows. Once the command runs successfully, one or more files appear in the my_work library directory. The directory contains the definitions of all modules the three HDL files define, in a proprietary format that only the simulator understands.

Figure 2. File and Directory Name Input to Simulator Specific Compilation Command