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:
parent
289673a807
commit
1a562f9605
4 changed files with 37 additions and 1 deletions
20
tests/techmap/lcu_refined.v
Normal file
20
tests/techmap/lcu_refined.v
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue