-
Notifications
You must be signed in to change notification settings - Fork 64
Description
The calyx-py library contains not only the general machinery for generating Calyx programs but also several specific math-ish unit generators: gen_exp, gen_ln, and gen_msb.
Having all this together is not only weird from first principles, it also causes one real problem: the library's source-location tracking does some funky stuff with stack traces. In particular, it ignores stack frames that come from the calyx-py library itself:
calyx/calyx-py/calyx/py_ast.py
Lines 72 to 74 in 85968c4
| if not frame.filename.startswith(library_path): | |
| user = frame | |
| break |
This has the weird effect that these gen_* scripts are sometimes considered part of the library and sometimes not (e.g., when they are invoked on the command line).
Let's separate this stuff out into a standalone Python package—maybe something like frontends/gen_math or whatever. One wrinkle will be updating all the dependencies that use these generators: principally, the TVM/Relay frontend.