3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-21 05:13:40 +00:00

techmap: add TCL test for Han-Carlson adder

This commit is contained in:
Emil J. Tywoniak 2024-11-28 15:16:48 +01:00
parent 289673a807
commit 1a562f9605
4 changed files with 37 additions and 1 deletions

View file

@ -0,0 +1,20 @@
// Copied from techlibs/common/simlib.v
// with this condition removed: (^{P, G, CI} !== 1'bx)
module lcu (P, G, CI, CO);
parameter WIDTH = 2;
input [WIDTH-1:0] P; // Propagate
input [WIDTH-1:0] G; // Generate
input CI; // Carry-in
output reg [WIDTH-1:0] CO; // Carry-out
integer i;
always @* begin
CO[0] = G[0] || (P[0] && CI);
for (i = 1; i < WIDTH; i = i+1)
CO[i] = G[i] || (P[i] && CO[i-1]);
end
endmodule