Step 1: Create a Verilog HDL Variation of a Megafunction

To create a custom Verilog HDL version of the lpm_add_sub function with the MegaWizard Plug-In Manager, follow these steps:

  1. Choose MegaWizard Plug-In Manager (Tools menu). The first page of the MegaWizard Plug-In Manager appears.

  2. Show Me

    MegaWizard Plug-In Manager Page 1

  3. In the first page of the MegaWizard Plug-In Manager, make sure Create a new custom megafunction variation is selected and click Next.

  4. Under Which megafunction would you like to customize?, click the + icon to expand the arithmetic folder, and then select LPM_ADD_SUB.

  5. Specify the following responses to the remaining wizard prompts:

  6. Wizard Prompt: Response:
    Which device family will you be using? APEX20KE
    Which type of output file do you want to create? Verilog HDL
    What name do you want for the output file? d:\qdesigns\fir_filter\accum.v
    How wide should the 'dataa' and 'datab' input buses be? 12
    Which operating mode do you want for the adder/subtractor? Addition only
    Is the 'dataa' or 'datab' input bus value a constant? No, both values vary
    Do you want any optional inputs or outputs? Make sure all options are turned off
    Do you want to pipeline the function? No

  7. Click Finish. The wizard creates the accum.v file, and the file is ready to be imported into your project.


To continue the tutorial, proceed to Step 2: Add Wizard-Generated Files to the Project.