Open PhilippvK opened 6 months ago
Addition: every pass/transform should be configurable via the Seal5Settings
The details about the new API is still to be decided. I propose to roughly follow these steps:
main()
into get_parser()
and run(args)
, allowing sys.argv
to be overridden by Python. This allows us to call the transforms from within Python with minimal changes to the passes. The full cmdline is generated manually in the pass functions.seal5.transform.infer_types.InferTypes
. The features remain untouched.Step 1. (& 2.) can be implemented effortlessly, which allows us to eliminate the debugging related issues raised in https://github.com/tum-ei-eda/seal5/issues/64#issuecomment-2081996631. We can also benchmark the Python-based approach vs. the original cmdline-only based one in terms of runtime.
Caveats:
Since the transforms and backends are included in the Seal5 Python codebase anyways, it might be reasonable to call them directly from python instead of opening up a subprocess running
python -m seal5.transform.name ...
. If we decide to support using the Python API we should make sure that we have an consistent Inferface. (Python API and CLI of each transform should be feature-compatible and common args for all transforms (log level, ...) should be defined only one)This change would also be welcome for https://github.com/tum-ei-eda/M2-ISA-R, so i will think about upstreaming it there as well.
To get started, we should define new abstract classes
Seal5Frontend
,Seal5Transform
, andSeal5Backend
for introducing such API.TODOs: