mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-28 12:19:01 +00:00
xilinx: cleanup DSP48E1 handling for abc9
This commit is contained in:
parent
f65fc845e5
commit
512596760b
3 changed files with 125 additions and 86 deletions
|
@ -771,38 +771,15 @@ module DSP48E1 (
|
|||
.RSTM(RSTM),
|
||||
.RSTP(RSTP)
|
||||
);
|
||||
|
||||
generate
|
||||
wire [29:0] $A;
|
||||
wire [17:0] $B;
|
||||
wire [47:0] $C;
|
||||
wire [24:0] $D;
|
||||
wire [47:0] $PCIN;
|
||||
|
||||
if (PREG == 0) begin
|
||||
if (MREG == 0 && AREG == 0) assign $A = A;
|
||||
else assign $A = 30'bx;
|
||||
if (MREG == 0 && BREG == 0) assign $B = B;
|
||||
else assign $B = 18'bx;
|
||||
if (MREG == 0 && DREG == 0) assign $D = D;
|
||||
else assign $D = 25'bx;
|
||||
|
||||
if (CREG == 0) assign $C = C;
|
||||
else assign $C = 48'bx;
|
||||
|
||||
assign $PCIN = PCIN;
|
||||
end
|
||||
else begin
|
||||
assign $A = 30'bx, $B = 18'bx, $C = 48'bx, $D = 25'bx, $PCIN = 48'bx;
|
||||
end
|
||||
|
||||
if (USE_MULT == "MULTIPLY" && USE_DPORT == "FALSE")
|
||||
$__ABC9_DSP48E1_MULT dsp_comb(.$A($A), .$B($B), .$C($C), .$D($D), .$P($P), .$PCIN($PCIN), .$PCOUT($PCOUT), .P(P), .PCOUT(PCOUT));
|
||||
else if (USE_MULT == "MULTIPLY" && USE_DPORT == "TRUE")
|
||||
$__ABC9_DSP48E1_MULT_DPORT dsp_comb(.$A($A), .$B($B), .$C($C), .$D($D), .$P($P), .$PCIN($PCIN), .$PCOUT($PCOUT), .P(P), .PCOUT(PCOUT));
|
||||
else if (USE_MULT == "NONE" && USE_DPORT == "FALSE")
|
||||
$__ABC9_DSP48E1 dsp_comb(.$A($A), .$B($B), .$C($C), .$D($D), .$P($P), .$PCIN($PCIN), .$PCOUT($PCOUT), .P(P), .PCOUT(PCOUT));
|
||||
else
|
||||
$error("Invalid DSP48E1 configuration");
|
||||
endgenerate
|
||||
$__ABC9_DSP48E1 #(
|
||||
.AREG(AREG),
|
||||
.BREG(BREG),
|
||||
.CREG(CREG),
|
||||
.DREG(DREG),
|
||||
.MREG(MREG),
|
||||
.PREG(PREG),
|
||||
.USE_DPORT(USE_DPORT),
|
||||
.USE_MULT(USE_MULT)
|
||||
) dsp_comb (
|
||||
.$A(A), .$B(B), .$C(C), .$D(D), .$P($P), .$PCIN(PCIN), .$PCOUT($PCOUT), .P(P), .PCOUT(PCOUT));
|
||||
endmodule
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue