3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-08 10:25:19 +00:00

Merge pull request #2467 from YosysHQ/dave/nexus-carry-fix

nexus: More efficient CO mapping
This commit is contained in:
David Shah 2020-12-02 22:07:25 +00:00 committed by GitHub
commit c3eb346e1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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