EDA Interfaces

Creating & Instantiating a VHDL Function for Use with the FPGA Express or FPGA Compiler II Software



You can create or modify design files that contain custom megafunction variations of Altera-provided functions. You can then instantiate the custom megafunction variations in a design file for use with the FPGA Express or FPGA Compiler II and Quartus® II software. This procedure shows only how to instantiate a RAM megafunction using VHDL; however, you can use similar procedures to instantiate other Altera-provided functions.

  1. If you have not already done so, proceed to Set Up the FPGA Express Working Environment or Set Up the FPGA Compiler II Working Environment.

  2. If you have not already done so, create a VHDL design in the FPGA Express or the FPGA Compiler II software, by using one of the following procedures:

  3. Open the MegaWizard® Plug-In Manager (Tools menu) and specify appropriate options for the megafunction you want to instantiate.
  4. The MegaWizard Plug-In Manager generates custom megafunction variations that are based on Altera-provided megafunctions, including library of parameterized modules (LPM) functions such as the lpm_ram_dq function, as well as Altera® megafunctions, such as the altclklock, altcam, altlvds_rx, and altlvds_tx functions.

    Refer to the following example to create a VHDL custom megafunction variation of the lpm_ram_dq function:

  5. To prepare the VHDL design for synthesis with the FPGA Express or FPGA Compiler II software, you must specify that the tool should treat the design file created in the MegaWizard Plug-In Manager as a "black box." The software then makes the correct connections to the ports in the EDIF netlist file (.edf). The Quartus II software reads in the EDIF netlist file as an EDIF Input File (.edf) and processes the instantiated megafunction. If the top-level design file doesn't have a module declaration, the FPGA Express or FPGA Compiler II software infers a "black box". The MegaWizard Plug-In Manager also generates a file with the extension _bb.v that can be used as an empty module declaration for use as a black box. To treat the design file for the megafunction as a "black box," refer to the following example:
  6. NOTE The design file generated by the MegaWizard Plug-In Manager must be in the same directory as the EDIF Input File or added to the Quartus II project.

  7. Perform a functional simulation of the design using the VCS software or another simulation tool.
  8. Continue to Generate EDIF Netlist Files with the FPGA Express Software, or Generate EDIF Netlist Files with the FPGA Compiler II Software.

  9. If you have not already done so, create a new project or open an existing project.

  10. Compile the design in the Quartus II software.

  11. If necessary, proceed to Perform a Timing Simulation with the ModelSim® Software or simulate the design with another Verilog HDL simulation tool.


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.