|
发表于 2011-6-28 14:36:26
|
显示全部楼层
本帖最后由 thjan65 于 2011-6-28 14:37 编辑
有的.
TOOLS->MEGA WIZARD->CREATE NEW MEGA FUNCTION-> 右邊 設定OUTPUT FILE ->左邊 選DIVIDE_LPM 或 ALTFP_DIV
然後設定參數, 就可以了
以下是 DIVIDE_LPM 範例 8BIT/8BIT 結果
// synopsys translate_off
`timescale 1 ps / 1 ps
// synopsys translate_on
module DIV (
denom,
numer,
quotient,
remain);
input [7:0] denom;
input [7:0] numer;
output [7:0] quotient;
output [7:0] remain;
wire [7:0] sub_wire0;
wire [7:0] sub_wire1;
wire [7:0] quotient = sub_wire0[7:0];
wire [7:0] remain = sub_wire1[7:0];
lpm_divide lpm_divide_component (
.denom (denom),
.numer (numer),
.quotient (sub_wire0),
.remain (sub_wire1),
.aclr (1'b0),
.clken (1'b1),
.clock (1'b0));
defparam
lpm_divide_component.lpm_drepresentation = "UNSIGNED",
lpm_divide_component.lpm_hint = "LPM_REMAINDERPOSITIVE=TRUE",
lpm_divide_component.lpm_nrepresentation = "UNSIGNED",
lpm_divide_component.lpm_type = "LPM_DIVIDE",
lpm_divide_component.lpm_widthd = 8,
lpm_divide_component.lpm_widthn = 8;
endmodule |
|