Tidy up, fix undriven

This commit is contained in:
Eddie Hung 2019-09-19 20:04:52 -07:00
parent 8a94ce7aa5
commit 691686f92c
1 changed files with 35 additions and 33 deletions

View File

@ -303,8 +303,8 @@ __CELL__ #(
generate generate
if (USE_MULT == "MULTIPLY" && USE_DPORT == "FALSE") begin if (USE_MULT == "MULTIPLY" && USE_DPORT == "FALSE") begin
// Disconnect the A-input if MREG is enabled, since // Disconnect the A-input if MREG is enabled, since
// combinatorial path is broken // combinatorial path is broken
if (AREG == 0 && MREG == 0 && PREG == 0) if (AREG == 0 && MREG == 0 && PREG == 0)
assign iA = A, pA = 1'bx; assign iA = A, pA = 1'bx;
else else
@ -320,21 +320,20 @@ __CELL__ #(
if (DREG == 0) if (DREG == 0)
assign iD = D; assign iD = D;
else if (techmap_guard) else if (techmap_guard)
$error("Invalid DSP48E1 configuration: DREG enabled but USE_DPORT == \"FALSE\""); $error("Invalid DSP48E1 configuration: DREG enabled but USE_DPORT == \"FALSE\"");
assign pD = 1'bx; assign pD = 1'bx;
if (ADREG == 1 && techmap_guard) if (ADREG == 1 && techmap_guard)
$error("Invalid DSP48E1 configuration: ADREG enabled but USE_DPORT == \"FALSE\""); $error("Invalid DSP48E1 configuration: ADREG enabled but USE_DPORT == \"FALSE\"");
assign pAD = 1'bx; assign pAD = 1'bx;
if (PREG == 0) begin if (PREG == 0) begin
assign pP = 1'bx; if (MREG == 1)
if (MREG == 1) \$__ABC_REG rM (.Q(pM));
\$__ABC_REG rM (.Q(pM)); else
else assign pM = 1'bx;
assign pM = 1'bx; assign pP = 1'bx;
end end else begin
else begin
\$__ABC_REG rP (.Q(pP));
assign pM = 1'bx; assign pM = 1'bx;
\$__ABC_REG rP (.Q(pP));
end end
if (MREG == 0 && PREG == 0) if (MREG == 0 && PREG == 0)
@ -351,8 +350,8 @@ __CELL__ #(
`DSP48E1_INST(\$__ABC_DSP48E1_MULT ) `DSP48E1_INST(\$__ABC_DSP48E1_MULT )
end end
else if (USE_MULT == "MULTIPLY" && USE_DPORT == "TRUE") begin else if (USE_MULT == "MULTIPLY" && USE_DPORT == "TRUE") begin
// Disconnect the A-input if MREG is enabled, since // Disconnect the A-input if MREG is enabled, since
// combinatorial path is broken // combinatorial path is broken
if (AREG == 0 && ADREG == 0 && MREG == 0 && PREG == 0) if (AREG == 0 && ADREG == 0 && MREG == 0 && PREG == 0)
assign iA = A, pA = 1'bx; assign iA = A, pA = 1'bx;
else else
@ -369,19 +368,22 @@ __CELL__ #(
assign iD = D, pD = 1'bx; assign iD = D, pD = 1'bx;
else else
\$__ABC_REG #(.WIDTH(25)) rD (.I(D), .O(iD), .Q(pD)); \$__ABC_REG #(.WIDTH(25)) rD (.I(D), .O(iD), .Q(pD));
if (PREG == 0) begin if (PREG == 0) begin
if (MREG == 1) if (MREG == 1) begin
\$__ABC_REG rM (.Q(pM)); assign pAD = 1'bx;
else begin \$__ABC_REG rM (.Q(pM));
assign pM = 1'bx; end else begin
if (ADREG == 1) if (ADREG == 1)
\$__ABC_REG rAD (.Q(pAD)); \$__ABC_REG rAD (.Q(pAD));
else else
assign pAD = 1'bx; assign pAD = 1'bx;
end assign pM = 1'bx;
end end
else assign pP = 1'bx;
end else begin
assign pAD = 1'bx, pM = 1'bx;
\$__ABC_REG rP (.Q(pP)); \$__ABC_REG rP (.Q(pP));
end
if (MREG == 0 && PREG == 0) if (MREG == 0 && PREG == 0)
assign mP = oP, mPCOUT = oPCOUT; assign mP = oP, mPCOUT = oPCOUT;
@ -397,8 +399,8 @@ __CELL__ #(
`DSP48E1_INST(\$__ABC_DSP48E1_MULT_DPORT ) `DSP48E1_INST(\$__ABC_DSP48E1_MULT_DPORT )
end end
else if (USE_MULT == "NONE" && USE_DPORT == "FALSE") begin else if (USE_MULT == "NONE" && USE_DPORT == "FALSE") begin
// Disconnect the A-input if MREG is enabled, since // Disconnect the A-input if MREG is enabled, since
// combinatorial path is broken // combinatorial path is broken
if (AREG == 0 && PREG == 0) if (AREG == 0 && PREG == 0)
assign iA = A, pA = 1'bx; assign iA = A, pA = 1'bx;
else else
@ -411,16 +413,16 @@ __CELL__ #(
assign iC = C, pC = 1'bx; assign iC = C, pC = 1'bx;
else else
\$__ABC_REG #(.WIDTH(48)) rC (.I(C), .O(iC), .Q(pC)); \$__ABC_REG #(.WIDTH(48)) rC (.I(C), .O(iC), .Q(pC));
if (DREG == 1 && techmap_guard)
$error("Invalid DSP48E1 configuration: DREG enabled but USE_DPORT == \"FALSE\"");
assign pD = 1'bx;
if (ADREG == 1 && techmap_guard)
$error("Invalid DSP48E1 configuration: ADREG enabled but USE_DPORT == \"FALSE\"");
assign pAD = 1'bx;
if (MREG == 1 && techmap_guard) if (MREG == 1 && techmap_guard)
$error("Invalid DSP48E1 configuration: MREG enabled but USE_MULT == \"NONE\""); $error("Invalid DSP48E1 configuration: MREG enabled but USE_MULT == \"NONE\"");
assign pM = 1'bx; assign pM = 1'bx;
if (DREG == 1 && techmap_guard) if (PREG == 1)
$error("Invalid DSP48E1 configuration: DREG enabled but USE_DPORT == \"FALSE\"");
assign pD = 1'bx;
if (ADREG == 1 && techmap_guard)
$error("Invalid DSP48E1 configuration: ADREG enabled but USE_DPORT == \"FALSE\"");
assign pAD = 1'bx;
if (PREG == 1)
\$__ABC_REG rP (.Q(pP)); \$__ABC_REG rP (.Q(pP));
else else
assign pP = 1'bx; assign pP = 1'bx;
@ -440,6 +442,6 @@ __CELL__ #(
end end
else else
$error("Invalid DSP48E1 configuration"); $error("Invalid DSP48E1 configuration");
endgenerate endgenerate
`undef DSP48E1_INST `undef DSP48E1_INST
endmodule endmodule