mirror of https://github.com/zachjs/sv2v.git
don't inline module-level constants into static prefixes
This commit is contained in:
parent
c00f508e81
commit
4533e4fffb
|
|
@ -1,3 +1,11 @@
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Fixed module-level localparams being needlessly inlined when forming longest
|
||||||
|
static prefixes, which could cause deep recursion and run out of memory on
|
||||||
|
some designs
|
||||||
|
|
||||||
## v0.0.10
|
## v0.0.10
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ asConst scopes expr =
|
||||||
asConstRaw :: Scopes Kind -> Expr -> Writer Any Expr
|
asConstRaw :: Scopes Kind -> Expr -> Writer Any Expr
|
||||||
asConstRaw scopes expr =
|
asConstRaw scopes expr =
|
||||||
case lookupElem scopes expr of
|
case lookupElem scopes expr of
|
||||||
|
Just (accesses@[_, _], _, Const{}) -> return $ accessesToExpr accesses
|
||||||
Just (_, _, Const Nil) -> recurse
|
Just (_, _, Const Nil) -> recurse
|
||||||
Just (_, _, Const expr') -> asConstRaw scopes expr'
|
Just (_, _, Const expr') -> asConstRaw scopes expr'
|
||||||
Just{} -> tell (Any True) >> return Nil
|
Just{} -> tell (Any True) >> return Nil
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
module top;
|
||||||
|
`include "always_spin.vh"
|
||||||
|
logic [Z - 1:0] foo;
|
||||||
|
logic flag;
|
||||||
|
logic bar;
|
||||||
|
always_comb
|
||||||
|
bar = foo[Z - 1] & flag;
|
||||||
|
endmodule
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
module top;
|
||||||
|
`include "always_spin.vh"
|
||||||
|
wire [Z - 1:0] foo;
|
||||||
|
wire flag;
|
||||||
|
reg bar;
|
||||||
|
always @*
|
||||||
|
bar = foo[Z - 1] & flag;
|
||||||
|
endmodule
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
parameter A = 1;
|
||||||
|
localparam B = A + A;
|
||||||
|
localparam C = B + B;
|
||||||
|
localparam D = C + C;
|
||||||
|
localparam E = D + D;
|
||||||
|
localparam F = E + E;
|
||||||
|
localparam G = F + F;
|
||||||
|
localparam H = G + G;
|
||||||
|
localparam I = H + H;
|
||||||
|
localparam J = I + I;
|
||||||
|
localparam K = J + J;
|
||||||
|
localparam L = K + K;
|
||||||
|
localparam M = L + L;
|
||||||
|
localparam N = M + M;
|
||||||
|
localparam O = N + N;
|
||||||
|
localparam P = O + O;
|
||||||
|
localparam Q = P + P;
|
||||||
|
localparam R = Q + Q;
|
||||||
|
localparam S = R + R;
|
||||||
|
localparam T = S + S;
|
||||||
|
localparam U = T + T;
|
||||||
|
localparam V = U + U;
|
||||||
|
localparam W = V + V;
|
||||||
|
localparam X = W + W;
|
||||||
|
localparam Y = X + X;
|
||||||
|
localparam Z = $clog2(Y + Y);
|
||||||
Loading…
Reference in New Issue