aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-12-02 22:07:25 +0000
committerGitHub <noreply@github.com>2020-12-02 22:07:25 +0000
commitc3eb346e1ecbed57200458d7bd0fdfd5add88ba4 (patch)
tree80a55b4e642f5d96bd52c582b7ce1f8efde90177
parent2945e27020ee36227ecad23f490d3205b21d040b (diff)
parent264e924abb85424a70daf50662700e3aceada689 (diff)
downloadyosys-c3eb346e1ecbed57200458d7bd0fdfd5add88ba4.tar.gz
yosys-c3eb346e1ecbed57200458d7bd0fdfd5add88ba4.tar.bz2
yosys-c3eb346e1ecbed57200458d7bd0fdfd5add88ba4.zip
Merge pull request #2467 from YosysHQ/dave/nexus-carry-fix
nexus: More efficient CO mapping
-rw-r--r--techlibs/nexus/arith_map.v4
1 files changed, 2 insertions, 2 deletions
diff --git a/techlibs/nexus/arith_map.v b/techlibs/nexus/arith_map.v
index fd9d61be3..ce14a15ea 100644
--- a/techlibs/nexus/arith_map.v
+++ b/techlibs/nexus/arith_map.v
@@ -88,9 +88,9 @@ module _80_nexus_alu (A, B, CI, BI, X, Y, CO);
.COUT(FCO[i+2])
);
- assign CO[i] = (AA[i] && BB[i]) || (((i == 0) ? CI : CO[i-1]) && (AA[i] || BB[i]));
+ assign CO[i] = (AA[i] && BB[i]) || ((Y[i] ^ AA[i] ^ BB[i]) && (AA[i] || BB[i]));
if (i+1 < Y_WIDTH) begin
- assign CO[i+1] = (AA[i+1] && BB[i+1]) || (CO[i] && (AA[i+1] || BB[i+1]));
+ assign CO[i + 1] = (AA[i] && BB[i]) || ((Y[i] ^ AA[i] ^ BB[i]) && (AA[i] || BB[i]));
assign Y[i+1] = Y1[i];
end
end endgenerate