We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f19de3 commit 12f1f41Copy full SHA for 12f1f41
flow/platforms/common/lcu_kogge_stone.v
@@ -0,0 +1,34 @@
1
+(* techmap_celltype = "$lcu" *)
2
+module _80_lcu_kogge_stone (P, G, CI, CO);
3
+ parameter WIDTH = 2;
4
+
5
+ (* force_downto *)
6
+ input [WIDTH-1:0] P, G;
7
+ input CI;
8
9
10
+ output [WIDTH-1:0] CO;
11
12
+ integer i, j;
13
14
+ reg [WIDTH-1:0] p, g;
15
16
+ wire [1023:0] _TECHMAP_DO_ = "proc; opt -fast";
17
18
+ always @* begin
19
+ p = P;
20
+ g = G;
21
22
+ // in almost all cases CI will be constant zero
23
+ g[0] = g[0] | (p[0] & CI);
24
25
+ for (i = 0; i < $clog2(WIDTH); i = i + 1) begin
26
+ for (j = WIDTH - 1; j >= 2**i; j = j - 1) begin
27
+ g[j] = g[j] | p[j] & g[j - 2**i];
28
+ p[j] = p[j] & p[j - 2**i];
29
+ end
30
31
32
33
+ assign CO = g;
34
+endmodule
0 commit comments