Netlist icon indicating copy to clipboard operation
Netlist copied to clipboard

"Closure Parameters"(?)

Open dan-fritchman opened this issue 2 years ago • 1 comments

In breaking news to me, parameters of the form of closure_param below:

.param a=5 b=6
.param closure_param(par1,par2) = 'par1 > par2 ? a : b'
.param calls_that_closure = '12 * closure_param(13, 14)'
  • (a) Are valid syntactically, in each major commercial simulator I have tried
  • (b) Are actively used by major device models

I don't know if they give such a thing a name. Here I will call it a "closure parameter", since it looks very much like a function-call which also captures some of its environment.

It is not yet clear whether nesting these among "regular parameters" like so is supported:

.param a=5 b=6 closure(x,y) = 'x > y ? a : b'

dan-fritchman avatar Apr 14 '22 21:04 dan-fritchman