Closed Keno closed 2 months ago
Reduced:
va"""
`define f(arg) arg
`define g(arg) `f(arg)
module test(x);
analog begin
`g(VMAX_s) = 1;
end
endmodule
"""
Fixing the reduction alone doesn't fix the full testcase. There's a similar issue with the expansion of one_over_one_minus_P
.
Reduced to just that part:
@macroexpand va"""
`define mypower2(x,power,result) \
if (power == -1.0) begin \
result = 1.0 / (x); \
end else begin \
result = pow(x, power); \
end
`define juncapfunction(P,one_over_one_minus_P) \
`mypower2(abc, (-P * one_over_one_minus_P), wgamma)
`define juncapcommon(PBOT_i, one_over_one_minus_PBOT) \
`juncapfunction(PBOT_i, one_over_one_minus_PBOT)
`define JuncapExpressInit1(PBOT_i, one_over_one_minus_PBOT) \
`juncapcommon(PBOT_i, one_over_one_minus_PBOT)
module test(x);
analog begin
`JuncapExpressInit1(PBOT, one_over_one_minus_PBOT)
end
endmodule
"""
and fully minimized:
@macroexpand va"""
`define f(a) a
`define g(b,c) `f((b * c))
module test(x);
real foo;
analog begin
foo = `g(PBOT, one_over_one_minus_PBOT);
end
endmodule
"""
Fixed internally, will be pushed with next rebase.
Standalone example
VMAX_s
is not subsituted forVMAX
in the inner macro expansion.