aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-18 00:27:54 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-18 00:27:54 +0200
commit6f33fc3e87f5d0429f2236662eb31954e51a71ed (patch)
treecfa3493d041d67cec4096d630dbadcd75415c0dd
parent4b3834e0cc3c34b6845ab50ffd7e9fe396173e8d (diff)
downloadyosys-6f33fc3e87f5d0429f2236662eb31954e51a71ed.tar.gz
yosys-6f33fc3e87f5d0429f2236662eb31954e51a71ed.tar.bz2
yosys-6f33fc3e87f5d0429f2236662eb31954e51a71ed.zip
Performance fix for new $__lcu techmap rule
-rw-r--r--techlibs/common/techmap.v12
1 files changed, 5 insertions, 7 deletions
diff --git a/techlibs/common/techmap.v b/techlibs/common/techmap.v
index 5bbe883ef..366351ec0 100644
--- a/techlibs/common/techmap.v
+++ b/techlibs/common/techmap.v
@@ -293,7 +293,7 @@ module \$__lcu (P, G, CI, CO);
output reg [WIDTH:0] CO;
- integer i, j, k;
+ integer i, j;
reg [WIDTH-1:0] p, g;
wire [1023:0] _TECHMAP_DO_ = "proc; opt -fast";
@@ -312,18 +312,16 @@ module \$__lcu (P, G, CI, CO);
// Main tree
for (i = 1; i <= $clog2(WIDTH); i = i+1) begin
for (j = 2**i - 1; j < WIDTH; j = j + 2**i) begin
- k = j - 2**(i-1);
- g[j] = g[j] | p[j] & g[k];
- p[j] = p[j] & p[k];
+ g[j] = g[j] | p[j] & g[j - 2**(i-1)];
+ p[j] = p[j] & p[j - 2**(i-1)];
end
end
// Inverse tree
for (i = $clog2(WIDTH); i > 0; i = i-1) begin
for (j = 2**i + 2**(i-1) - 1; j < WIDTH; j = j + 2**i) begin
- k = j - 2**(i-1);
- g[j] = g[j] | p[j] & g[k];
- p[j] = p[j] & p[k];
+ g[j] = g[j] | p[j] & g[j - 2**(i-1)];
+ p[j] = p[j] & p[j - 2**(i-1)];
end
end
end