eval_expr.c is a c file generated from a yacc-like grammar parser, eval_expr.y
this code adds the ability in xschem to evaluate infix arithmetic expressions.
If a transistor has an attribute
ad="expr('int((@nf + 1)/2) * @W / @nf * 0.29')"
first "@..." parameters are substituted with numbers and then the string inside expr(...) is passed to this new eval_expr code and a single number is returned.
This way we have ad=xxx in the netlist instead of a complicated and long expression. This was done because some simulators can not resolve expressions with variables.
No comments:
Post a Comment