3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-14 21:51:28 +00:00

techmap: Split out Kogge-Stone into a separate file

This commit is contained in:
Martin Povišer 2024-03-25 18:39:55 +01:00
parent c38201e15d
commit 4570d064e5
3 changed files with 55 additions and 10 deletions

View file

@ -207,7 +207,7 @@ module _90_fa (A, B, C, X, Y);
endmodule
(* techmap_celltype = "$lcu" *)
module _90_lcu (P, G, CI, CO);
module _90_lcu_brent_kung (P, G, CI, CO);
parameter WIDTH = 2;
(* force_downto *)
@ -230,7 +230,6 @@ module _90_lcu (P, G, CI, CO);
// in almost all cases CI will be constant zero
g[0] = g[0] | (p[0] & CI);
`ifndef KOGGE_STONE
// [[CITE]] Brent Kung Adder
// R. P. Brent and H. T. Kung, "A Regular Layout for Parallel Adders",
// IEEE Transaction on Computers, Vol. C-31, No. 3, p. 260-264, March, 1982
@ -250,14 +249,6 @@ module _90_lcu (P, G, CI, CO);
p[j] = p[j] & p[j - 2**(i-1)];
end
end
`else
for (i = 0; i < $clog2(WIDTH); i = i + 1) begin
for (j = 2**i; j < WIDTH; j = j + 1) begin
g[j] = g[j] | p[j] & g[j - 2**i];
p[j] = p[j] & p[j - 2**i];
end
end
`endif
end
assign CO = g;