Altera Home Page
Literature Licensing
Buy On-Line Download

  Home   |   Products   |   Support   |   End Markets   |   Technology Center   |   Education & Events   |   Corporate   |   Buy On-Line  
  Knowledge Database   |   Devices   |   Design Software   |   Intellectual Property   |   Reference Designs   |   Design Examples   |   mySupport  

 Products
   Quartus II
      SOPC Builder
      MAX+PLUS II
      ModelSim-Altera
  
 Resource Centers
      Overview
      Installation & Licensing
      Scripting
      Board Design & I/O
      Synthesis & Netlist Viewers
      Incremental Compilation
      Optimization
      Power Management
   TimeQuest Timing Analyzer
      Classic Timing Analyzer
      Simulation & Verification
      On-Chip Debugging
      HardCopy Design
  
 Software Resources
      OS Support
      Driver Installation
  
 Download & Licensing
      Download
   Licensing
  
 Quartus II EDA Support
      Quartus II Interface
   Synthesis Tools
   Simulation Tools
          Aldec Active-HDL
          ModelSim
          NCSim
          VCS MX
          VCS
   Formal Verification Tools
   Timing Analysis Tools
   Physical Synthesis Tools
   Board Level Tools
  
 Legacy Sw. EDA Support
      View by Vendor
      View by Tool
      View by Function
  

Performing a Functional Simulation with the ModelSim-Altera Software

btnshowall.gif

You can use the Mentor Graphics ModelSim-Altera software, provided with the Quartus II software, to perform a functional simulation of a VHDL or Verilog HDL design that contains Altera-specific components with the ModelSim-Altera interface, or with command-line commands.

 

click to expandTo perform a functional simulation with the ModelSim-Altera interface:

  1. If you have not already done so, set up a project with the ModelSim-Altera software.

  2. To compile the Verilog or VHDL Design Files and test bench files (if you are using a test bench):

  1. On the Compile menu, click Compile.

  2. In the Library list of the Compile HDL Source Files dialog box, select the work library.

  3. In the File name list, type the directory path and file name of the Verilog or VHDL Design File.

    or

    In the Files of Type list, select All Files (*.*), and in the Look in list select the Verilog or VHDL Design File.

Note: If you have generated a VHDL Output File (.vho) or Verilog Output File (.vo) for use in a functional simulation, you should compile it before proceeding.

  1. Click Compile.

  2. Repeat steps 2b to 2d to compile the test bench file(s).

  3. Click Done.

  1. To load the design:

    1. On the Simulate menu, click Simulate. The Simulate dialog box appears.

    2. If you are simulating a Verilog design, to specify the ModelSim precompiled libraries:

      1. Click the Libraries tab.

      2. In the Search Libraries (-L) box, click Add.

      3. Specify the \<ModelSim-Altera install directory>\altera\verilog\220model\ directory.

      4. Repeat step iii to add the \<ModelSim-Altera install directory>\altera\verilog\altera_mf\ directory.

      5. Click OK.

    3. In the Name list, click the + icon to expand the work directory.

    4. Select the top-level design file to simulate.

    5. Click Add.

    6. Click Load.

  2. Perform the functional simulation in the ModelSim-Altera software.

Important: If your design contains the altgxb megafunction or the alt2gxb megafunction, please refer to the appropriate megafunction topic for required settings information.

click to expandTo perform a functional simulation with command-line commands:

To use the Mentor Graphics ModelSim-Altera software, provided with the Quartus II software, to perform a functional simulation of a VHDL or Verilog HDL design that contains Altera-specific components using command-line commands:

  1. If you have not already done so, set up a ModelSim-Altera project with command-line commands.

  2. If your design contains the altgxb megafunction, to map to the precompiled Stratix GX functional simulation model libraries type the following command at the ModelSim prompt:

    vmap altgxb \<ModelSim-Altera install directory>\altera\<verilog or vhdl>\altgxb\ 

     

    Important: If your design contains the altgxb megafunction or the alt2gxb megafunction, please refer to the appropriate megafunction topic for required settings information.

  3. To map the VHDL-87-compliant design libraries, type the following commands at the ModelSim prompt:

    vmap lpm \<ModelSim-Altera install directory>\altera\220model_87\ Enter
    vmap altera_mf \
    <ModelSim-Altera install directory>\altera\altera_mf_87\ Enter

     

  4. To compile the Verilog or VHDL Design Files and test bench files (if you are using a test bench), type the following commands at the ModelSim prompt.

    For VHDL designs:

    vcom -work work<design name>.vhd 
    vcom -work work
    <test bench>.vhd 

    For Verilog HDL designs:

    vlog -work work<design name>.v 
    vlog -work work
    <test bench>.v 

  5. To load the design, type the following commands at the ModelSim prompt.

    For VHDL designs:

    vsim work.<top-level design entity> 

    For Verilog designs:

    vsim -L \<ModelSim-Altera install directory>\altera\verilog\220model\ -L \<ModelSim-Altera install directory>\altera\verilog\altera_mf\ work.<top-level design entity> Enter

  6. Perform the functional simulation in the ModelSim-Altera software.

 

Note: You can use batch files to set up and compile each of the libraries automatically. Copy all the commands displayed in the ModelSim-Altera or ModelSim PE or SE main window into a text file and name the file with a .do extension (that is, <file name>.do). Use this script to recompile the libraries if you update them.

To run a macro script:

  1. From the Mentor Graphics ModelSim main window, click Execute Macro.

  2. In the Execute Do File dialog box, locate your ModelSim macro file (.do).

  3. Click Open.

 

To continue with the ModelSim-Altera simulation flow and perform a timing simulation, set up a project with the ModelSim-Altera software.

 

 

  Please Give Us Feedback