Altera Home Page
文档资料 许可
在线购买 下载

  主页   |   产品   |   支持   |   最终市场   |   技术中心   |   教育与活动   |   公司介绍   |   在线购买  
  mySupport   |   器件   |   软件   |   IP   |   设计范例   |   参考设计  

 产品
   Quartus II
      SOPC Builder
      MAX+PLUS II
      ModelSim-Altera
  
 资源中心
      简介
      安装&许可
      脚本
       电路板设计& I/O
      网表阅读器 & 综合
      编译增强特性
      优化
      功耗管理
   TimeQuest时序分析器
      标准时序分析器
      仿真 & 确认
      片内调试
      HardCopy设计
  
 软件资源
      操作系统支持
      驱动安装
  
 下载与许可
      下载
   许可
  
 Quartus II EDA 支持
      Quartus II 接口
   综合工具
   仿真工具
          Aldec Active-HDL
          ModelSim
          NCSim
          VCS MX
          VSS
   验证工具
   时序分析工具
   再综合工具
   电路板级工具
  
 老版软件EDA支持
      供应商类
      工具类
      功能类
  

Performing a Functional Simulation with the NCSim Software

btnshowall.gif

You can use the Cadence NCSim software to perform a functional simulation of a VHDL or Verilog HDL design that contains Altera-specific components:

 

click to expandTo perform a functional simulation of a Verilog HDL design with the NCSim interface:

  1. If you have not already done so, set up the NCSim working environment.

  2. Start the NCSim software by typing nclaunch  at a command prompt.

  3. To create a work directory, on the Edit menu, point to Add, and then click New Library and type the name of the work library in the Library box.

Note: Altera recommends using the NCSim (NC-Verilog or NC-VHDL) default library names when you create a library. You should name the NCSim software libraries as follows:

  • When you run the NCSim software independently from the Quartus II software, you should name your library work.

  • When you run the NCSim software automatically from the Quartus II software to perform a gate level simulation, your library is automatically named gate_work under the current project directory, and the work alias is mapped to the gate_work directory.

  1. Copy the cds.lib and hdl.var files, which are located in the /<NCSim installation directory path>/tools/inca/files/ directory, to the /<project directory>/simulation/ncsim directory.

  2. Edit the cds.lib and hdl.var files as follows:

File Name

File Contents

Function

cds.lib

DEFINE<work library>./work

Maps the <work library> to the physical location of the work library.

hdl.var

DEFINE WORK<work library>

Maps the NCSim variable WORK to the <work library>.

  1. If the design contains CAM, RAM, or ROM functions, and you are using a Hexadecimal (Intel-Format) File (.hex) or a Memory Initialization File (.mif) for the INIT_FILE parameter, convert the memory initialization data:

    1. Export the HEX or MIF File as a RAM Initialization File (.rif) in the Quartus II software.

    2. Add the text parameter lpm_file = "<RIF name>.rif"; for the CAM, RAM, or ROM function to the top-level design or test bench file.

    3. Click Sim Compiler.

    4. In the Compile Sim dialog box, turn on Define Macro and type NO_PLI in the box.

    5. Click Apply.

  2. To compile the appropriate project files and libraries into the work library:

    1. Click Sim Compiler.

    2. In the File box, type in the path of the test bench file (if you are using one).

    3. In the Work Library list, select the work library.

    4. Click OK.

    5. Repeat steps 7a through 7d to compile the Sim Design File (.v) for the project and the appropriate functional simulation libraries.

Note:

  • If the design contains the altgxb megafunction, you must set the value of the pll_areset signal to start high in the test bench or waveform file for the design. If the megafunction does not instantiate a GXB transmitter PLL, you must set the values of the rx_analogreset and rx_digitalreset signals to start high.

  • If your design contains the alt2gxb megafunction, Altera recommends that you set the value of the gxb_powerdown signal to start high in the test bench or waveform file for the design. If the instantiated alt2gxb megafunction does not use gxb_powerdown signal, Altera requires that you set the values of the tx_digitalreset, rx_analogreset, and rx_digitalreset signals to start high. Assert tx_digitalreset long enough so that tx_clkout registers it and assert rx_digitalreset a few clock cycles longer than rx_analogreset so that rx_clkout can register rx_digitalreset. Altera requires that you apply the same reset sequence mentioned above after dynamic channel reconfiguration.

 

  1. To elaborate the design, click Elaborator and type <work library>.<top-level entity name> in the Design Unit box.

click to expandTo perform a functional simulation of a Verilog HDL design with command-line commands:

  1. If you have not already done so, perform Setting Up the NCSim Working Environment.

  2. To create a work library in the project directory, type the following command at the command prompt:

  3. mkdir<work library> Enter

  4.  

  5. Note: Altera recommends using the NCSim (NC-Verilog or NC-VHDL) default library names when you create a library. You should name the NCSim software libraries as follows:

    • When you run the NCSim software independently from the Quartus II software, you should name your library work.

    • When you run the NCSim software automatically from the Quartus II software, your library is automatically named gate_work under the current project directory, and the work alias is mapped to the gate_work directory.

  1. Copy the cds.lib and hdl.var files, which are located in the /<NCSim installation directory path>/tools/inca/files/ directory, to the /<project directory>/simulation/ncsim directory.

  1. Edit the cds.lib and hdl.var files as follows:

     

    File Name

    File Contents

    Function

    cds.lib

    DEFINE<work library>./work

    Maps the <work library> to the physical location of the work library.

    hdl.var

    DEFINE WORK<work library>

    Maps the NCSim variable WORK to the <work library>.

     

  2. If the design contains CAM, RAM, or ROM functions, and you are using a Hexadecimal (Intel-Format) File (.hex) or a Memory Initialization File (.mif) for the INIT_FILE parameter, to convert the memory initialization data:

    1. Export the HEX or MIF File as a RAM Initialization File (.rif) in the Quartus II software.

    2. Add the text parameter lpm_file = "<RIF name>.rif"; for the CAM, RAM, or ROM function to the top-level design or test bench file.

  3. To compile the appropriate project files and libraries into the work library, type the following commands at the command prompt from within the project directory:

  1. ncvlog<test bench file> Enter
    ncvlog
    <design name>.v Enter
    ncvlog
    /quartus/eda/sim_lib/220model.v Enter
    ncvlog
    /quartus/eda/sim_lib/altera_mf.v Enter
    ncvlog
    /quartus/eda/sim_lib/stratixgx_mf.v Enter (If your design contains the altgxb megafunction)

     

    Note:

    • If the design contains the altgxb megafunction, you must set the value of the pll_areset signal to start high in the test bench or waveform file for the design. If the megafunction does not instantiate a GXB transmitter PLL, you must set the values of the rx_analogreset and rx_digitalreset signals to start high.

    • If your design contains the alt2gxb megafunction, Altera recommends that you set the value of the gxb_powerdown signal to start high in the test bench or waveform file for the design. If the instantiated alt2gxb megafunction does not use gxb_powerdown signal, Altera requires that you set the values of the tx_digitalreset, rx_analogreset, and rx_digitalreset signals to start high. Assert tx_digitalreset long enough so that tx_clkout registers it and assert rx_digitalreset a few clock cycles longer than rx_analogreset so that rx_clkout can register rx_digitalreset. Altera requires that you apply the same reset sequence mentioned above after dynamic channel reconfiguration.

  2.  

    Note: If you are using a RIF to specify memory initialization data, add the string -define NO_PLI before 220model.v and altera_mf.v in the above commands.

     

  1. To elaborate and simulate the design, type the following command at the command prompt:

ncelab<work library>.<top-level entity name> Enter

ncsim<work library>.<top-level entity name> Enter

click to expandTo perform a functional simulation of a VHDL design with the NCSim interface:

  1. If you have not already done so, set up the NCSim working environment.

  2. Start the NCSim software by typing nclaunch  at a command prompt.

  3. To create a work directory, on the Edit menu, point to Add, and then click New Library and type the name of the work library in the Library box.

Note: Altera recommends using the NCSim (NC-Verilog or NC-VHDL) default library names when you create a library. You should name the NCSim software libraries as follows:

  • When you run the NCSim software independently from the Quartus II software, you should name your library work.

  • When you run the NCSim software automatically from the Quartus II software, your library is automatically named gate_work under the current project directory, and the work alias is mapped to the gate_work directory.

  1. Copy the cds.lib and hdl.var files, which are located in the /<NCSim installation directory path>/tools/inca/files/ directory, to the /<project directory>/simulation/ncsim directory.

  2. Edit the cds.lib and hdl.var files as follows:

     

    File Name

    File Contents

    Function

    cds.lib

    DEFINE<work library>./work
    DEFINE LPM
    <work library>
    DEFINE ALTERA_MF
    <work library>

    Maps the <work library> to the physical location of the work library, and the variables LPM and ALTERA_MF to the work library.

    hdl.var

    DEFINE WORK<work library>

    Maps the NCSim variable WORK to the <work library>.

     

    Note: If you compile a design for the Arria GX or Stratix II GX device families that uses HSSI, the cds.lib must map multiple logical libraries to a physical library that you designate. The NC VHDL warning message "Multiple logical libraries mapped to a single location" might appear,however, you may ignore this warning since it does not affect simulation.The cds.lib file must contain the following lines with <device family> replaced with either arriagx or stratixiigx as appropriate:

     

    SOFTINCLUDE ${CDS_INST_DIR}/tools/inca/files/cdsvhdl.lib

    SOFTINCLUDE ${CDS_INST_DIR}/tools/inca/files/cdsvlog.lib

    DEFINE work ./<physical library name>

    DEFINE <device family>_hssi ./<physical library name>

    DEFINE <device family> ./<physical library name>

    DEFINE lpm ./<physical library name>

    DEFINE sgate ./<physical library name>

  3.  
  1. To compile the appropriate project files and libraries into the work library:

    1. Click VHDL Compiler.

    2. Type the path of the test bench file (if you are using one) in the File box.

    3. In the Work Library list, select the work library.

    4. Click OK.

    5. Repeat steps 6a through 6d to compile the VHDL Design File (.vhd) for the project and the appropriate functional simulation libraries.

    6.  

      Note:

      • If the design contains the altgxb megafunction, you must set the value of the pll_areset signal to start high in the test bench or waveform file for the design. If the megafunction does not instantiate a GXB transmitter PLL, you must set the values of the rx_analogreset and rx_digitalreset signals to start high.

      • If your design contains the alt2gxb megafunction, Altera recommends that you set the value of the gxb_powerdown signal to start high in the test bench or waveform file for the design. If the instantiated alt2gxb megafunction does not use gxb_powerdown signal, Altera requires that you set the values of the tx_digitalreset, rx_analogreset, and rx_digitalreset signals to start high. Assert tx_digitalreset long enough so that tx_clkout registers it and assert rx_digitalreset a few clock cycles longer than rx_analogreset so that rx_clkout can register rx_digitalreset. Altera requires that you apply the same reset sequence mentioned above after dynamic channel reconfiguration.

    7.  

      Note: For VHDL-93 compliant designs, turn on Enable VHDL 93 features in the VHDL Compiler dialog box.

       

  2. To elaborate the design, click Elaborator and type <work library>.<top-level entity name> in the Design Unit box.

  3. To simulate the design, click Simulator and type <work library>.<top-level entity name> in the Snapshot box.

arrowright.gifTo perform a functional simulation of a VHDL design with command-line commands:

  1. If you have not already done so, set up the NCSim working environment.

  2. To create a work library in the project directory, type the following command at the command prompt:

  3. mkdir<work library> Enter

Note: Altera recommends using the NCSim (NC-Verilog or NC-VHDL) default library names when you create a library. You should name the NCSim software libraries as follows:

  • When you run the NCSim software independently from the Quartus II software, you should name your library work.

  • When you run the NCSim software automatically from the Quartus II software, your library is automatically named gate_work under the current project directory, and the work alias is mapped to the gate_work directory.

  1. Copy the cds.lib and hdl.var files, which are located in the /<NCSim installation directory path>/tools/inca/files/ directory, to the /<project directory>/simulation/ncsim directory.

  1. Edit the cds.lib and hdl.var files as follows:
     

    File Name

    File Contents

    Function

    cds.lib

    DEFINE<work library>./work
    DEFINE LPM
    <work library>
    DEFINE ALTERA_MF
    <work library>

    Maps the <work library> to the physical location of the work library, and the variables LPM and ALTERA_MF to the work library.

    hdl.var

    DEFINE WORK<work library>

    Maps the NCSim variable WORK to the <work library>.

     

    Note: If you compile a design for the Arria GX or Stratix II GX device families that uses HSSI, the cds.lib must map multiple logical libraries to a physical library that you designate. The NC VHDL warning message "Multiple logical libraries mapped to a single location" might appear,however, you may ignore this warning since it does not affect simulation.The cds.lib file must contain the following lines with <device family> replaced with either arriagx or stratixiigx as appropriate:

     

    SOFTINCLUDE ${CDS_INST_DIR}/tools/inca/files/cdsvhdl.lib

    SOFTINCLUDE ${CDS_INST_DIR}/tools/inca/files/cdsvlog.lib

    DEFINE work ./<physical library name>

    DEFINE <device family>_hssi ./<physical library name>

    DEFINE <device family> ./<physical library name>

    DEFINE lpm ./<physical library name>

    DEFINE sgate ./<physical library name>

     

    When defining library names, do not use library names that begin with numeric characters, for example, 220model.

  2. To compile the appropriate project files and libraries into the work library, type the following commands at the command prompt from within the project directory:

ncvhdl /quartus/eda/sim_lib/altera_primitives.vhd Enter (If your design targets a Stratix III or Cyclone III device.)
ncvhdl /quartus/eda/sim_lib/altera_primitives_components.vhd
 Enter(If your design targets a Stratix III or Cyclone IIIdevice.)
ncvhdl -v93 -relax -work lpm
<drive>:/quartus/eda/sim_lib/220pack.vhd Enter
ncvhdl -v93 -relax -work lpm <drive>:/quartus/eda/sim_lib/220model.vhd Enter
ncvhdl -v93 -work altera_mf
<drive>:/quartus/eda/sim_lib/altera_mf.vhd Enter
ncvhdl -v93 -work altera_mf
<drive>:/quartus/eda/sim_lib/altera_mf_components.vhd Enter
ncvhdl
<test bench file> Enter
ncvhdl
<design name>.vhd  Enter

If your design contains the altgxb megafunction, type the following commands to compile the appropriate libraries:

ncvhdl -v93 -work sgate<drive>:/quartus/eda/sim_lib/sgate_pack.vhd Enter
ncvhdl -v93 -work sgate
<drive>:/quartus/eda/sim_lib/sgate.vhd Enter
ncvhdl -v93 -work altgxb
<drive>:/quartus/eda/sim_lib/stratixgx_mf.vhd Enter
ncvhdl -v93 -work altgxb
<drive>:/quartus/eda/sim_lib/stratixgx_mf_components.vhd Enter

 

Note:

  • If the design contains the altgxb megafunction, you must set the value of the pll_areset signal to start high in the test bench or waveform file for the design. If the megafunction does not instantiate a GXB transmitter PLL, you must set the values of the rx_analogreset and rx_digitalreset signals to start high.

  • If your design contains the alt2gxb megafunction, Altera recommends that you set the value of the gxb_powerdown signal to start high in the test bench or waveform file for the design. If the instantiated alt2gxb megafunction does not use gxb_powerdown signal, Altera requires that you set the values of the tx_digitalreset, rx_analogreset, and rx_digitalreset signals to start high. Assert tx_digitalreset long enough so that tx_clkout registers it and assert rx_digitalreset a few clock cycles longer than rx_analogreset so that rx_clkout can register rx_digitalreset. Altera requires that you apply the same reset sequence mentioned above after dynamic channel reconfiguration.

 

Note: For the functional simulation libraries for VHDL-87 compliant designs, type the following commands to compile the simulation libraries:

ncvhdl [-v87] -work -relax lpm<drive>:/quartus/eda/sim_lib/220model_87.vhd Enter
ncvhdl [-v87] -work altera_mf
<drive>:/quartus/eda/sim_lib/altera_mf_87.vhd Enter

  1. To elaborate the design, type the following command at the command prompt:

ncelab<work library>.<top-level entity name> Enter

  1. To simulate the design, type the following command at the command prompt:

ncsim<work library>.<top-level entity name> Enter

 

To elaborate the design, click Elaborator and type <work library>.<top-level entity name> in the Design Unit box.

To continue with the NCSim simulation flow, performing a timing simulation with the NCSim software.

 

 

  请填写反馈意见
  注册索取最新邮件通知