mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 01:54:10 +00:00
techmap: Add a Kogge-Stone option for $lcu
mapping
This commit is contained in:
parent
d73f71e813
commit
c38201e15d
|
@ -230,6 +230,7 @@ module _90_lcu (P, G, CI, CO);
|
||||||
// in almost all cases CI will be constant zero
|
// in almost all cases CI will be constant zero
|
||||||
g[0] = g[0] | (p[0] & CI);
|
g[0] = g[0] | (p[0] & CI);
|
||||||
|
|
||||||
|
`ifndef KOGGE_STONE
|
||||||
// [[CITE]] Brent Kung Adder
|
// [[CITE]] Brent Kung Adder
|
||||||
// R. P. Brent and H. T. Kung, "A Regular Layout for Parallel Adders",
|
// 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
|
// IEEE Transaction on Computers, Vol. C-31, No. 3, p. 260-264, March, 1982
|
||||||
|
@ -249,6 +250,14 @@ module _90_lcu (P, G, CI, CO);
|
||||||
p[j] = p[j] & p[j - 2**(i-1)];
|
p[j] = p[j] & p[j - 2**(i-1)];
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
assign CO = g;
|
assign CO = g;
|
||||||
|
|
Loading…
Reference in a new issue