altera ip 核小究

用quartus的MegaWizard工具生成一个乘法器multiplier,会在工程目录下产生

multiplier.qip    (可选)

multiplier_bb.v  (可选)

multiplier.v

文件。

Multiplier.v 文件的内容

// megafunction wizard: %LPM_MULT%

// GENERATION: STANDARD

// VERSION: WM1.0

// MODULE: lpm_mult

// ============================================================

// File Name: multiplier.v

// Megafunction Name(s):

//                       lpm_mult

//

// Simulation Library Files(s):

//                       lpm

// ============================================================

// ************************************************************

// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!

//

// 10.0 Build 262 08/18/2010 SP 1 SJ Full Version

// ************************************************************

//Copyright (C) 1991-2010 Altera Corporation

//Your use of Altera Corporation's design tools, logic functions

//and other software and tools, and its AMPP partner logic

//functions, and any output files from any of the foregoing

//(including device programming or simulation files), and any

//associated documentation or information are expressly subject

//to the terms and conditions of the Altera Program License

//Subscription Agreement, Altera MegaCore Function License

//Agreement, or other applicable license agreement, including,

//without limitation, that your use is for the sole purpose of

//programming logic devices manufactured by Altera and sold by

//Altera or its authorized distributors.  Please refer to the

//applicable agreement for further details.

// synopsys translate_off

`timescale 1 ps / 1 ps

// synopsys translate_on

module multiplier (

         clock,

         dataa,

         datab,

         result);

         input           clock;

         input         [7:0]  dataa;

         input         [7:0]  datab;

         output      [15:0]  result;

         wire [15:0] sub_wire0;

         wire [15:0] result = sub_wire0[15:0];

         lpm_mult lpm_mult_component (

                                     .clock (clock),

                                     .dataa (dataa),

                                     .datab (datab),

                                     .result (sub_wire0),

                                     .aclr (1'b0),

                                     .clken (1'b1),

                                     .sum (1'b0));

         defparam

                   lpm_mult_component.lpm_hint = "MAXIMIZE_SPEED=5",

                   lpm_mult_component.lpm_pipeline = 2,

                   lpm_mult_component.lpm_representation = "UNSIGNED",

                   lpm_mult_component.lpm_type = "LPM_MULT",

                   lpm_mult_component.lpm_widtha = 8,

                   lpm_mult_component.lpm_widthb = 8,

                   lpm_mult_component.lpm_widthp = 16;

endmodule

生成的模块multiplier 只是在实例化lpm_mult模块的基础上,根据MegaWizard的配置结果,用defparam对该模块内部的对应的参数进行了更改。因此,如果对要使用的模块比较熟练的话,更方便一点的做法是不用MegaWizard进行配置,而是直接按照这种方法用hdl语言来对乘法模块进行调用。

原文地址:https://www.cnblogs.com/daqiang/p/3182894.html