Skip to content

Commit 9184496

Browse files
committed
techmap: wrap builtin $lcu as golden module in PPA tests
1 parent a41ef02 commit 9184496

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

tests/techmap/han-carlson.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
yosys -import
22

33
read_verilog +/choices/han-carlson.v
4-
read_verilog lcu_refined.v
4+
read_verilog -icells lcu_refined.v
55
design -save init
66

77
for {set i 1} {$i <= 16} {incr i} {

tests/techmap/kogge-stone.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
yosys -import
22

33
read_verilog +/choices/kogge-stone.v
4-
read_verilog lcu_refined.v
4+
read_verilog -icells lcu_refined.v
55
design -save init
66

77
for {set i 1} {$i <= 16} {incr i} {

tests/techmap/lcu_refined.v

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
// Copied from techlibs/common/simlib.v
2-
// with this condition removed: (^{P, G, CI} !== 1'bx)
31
module lcu (P, G, CI, CO);
2+
parameter WIDTH = 2;
43

5-
parameter WIDTH = 2;
4+
input [WIDTH-1:0] P, G;
5+
input CI;
66

7-
input [WIDTH-1:0] P; // Propagate
8-
input [WIDTH-1:0] G; // Generate
9-
input CI; // Carry-in
7+
output [WIDTH-1:0] CO;
108

11-
output reg [WIDTH-1:0] CO; // Carry-out
9+
reg [WIDTH-1:0] p, g;
1210

13-
integer i;
14-
always @* begin
15-
CO[0] = G[0] || (P[0] && CI);
16-
for (i = 1; i < WIDTH; i = i+1)
17-
CO[i] = G[i] || (P[i] && CO[i-1]);
18-
end
11+
\$lcu #(.WIDTH(WIDTH)) impl (.P(P), .G(G), .CI(CI), .CO(CO));
1912

2013
endmodule

0 commit comments

Comments
 (0)