Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-use host Python process when compiling from command line #372

Merged
merged 12 commits into from
Jul 30, 2024

Conversation

ducky64
Copy link
Collaborator

@ducky64 ducky64 commented Jul 30, 2024

... instead of spawning a sub-process. This keeps namespaces consistent (in a way that spawning a subprocess wouldn't) and allows the use of a Python debugger. Resolves #362

NOTE FOR DEBUGGING: the IDE (compile-design) does not yet support debugging, so you'll need to create a main stub (like bllinky_skeleton.py, as if running from the command line) and debug from that. But breakpoints do work.

Implementation-wise, this 'flips' the client / server role: after sending the design to compile to the server, the Python process then acts as an HDL server until receiving an empty request (denoting end of compilation), then waits for the compilation result. This also restructures the interface structure, notably bringing the core compiler interface structurally closer to the Python implementation, with a dedicated serializer / deserializer class (instead of it being monolithic).

This also refactors the compiler to eliminate error suppression, instead moving it into the generator test case (using redirect_stderr) which is the only place this functionality is used. This new structure also un-suppresses a warning in the test suite, which will be addressed separately.

Also bumps the compiler version.

@ducky64 ducky64 merged commit f80beeb into master Jul 30, 2024
11 checks passed
@ducky64 ducky64 deleted the integrated-python branch July 30, 2024 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant