Monday, February 10, 2025

What's the expr_eval.c Thing in Your Repo Doing?

From the oracle himself:

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

Who Needs Cadence Anymore (for Schematic Tree Reporting that is :)? Make Your Own Reporter with chatGPT!

You know what I mean, if you've used Cadence - the SHIFT-T thing that gives you the schematic tree can be VERY useful, at times. No Cade...