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

Add support for _source_code_ attribute for runtime generated class definitions #13

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

leonardt
Copy link
Contributor

For fault, I am trying to do a runtime generated class definition (need to do rewrites to add logic that converts the function interface from magma types to system verilog types, so we need to do things like flatten the arguments for tuples). inspect.getsource doesn't work when we use exec to define a class (since it tries to look for the file it was defined in. This adds a special magic attribute that a downstream tool can set on a class that provides the source code so we can avoid using inspect.

@leonardt
Copy link
Contributor Author

@leonardt
Copy link
Contributor Author

Here's the error when it tries to find the source: https://github.com/leonardt/fault/runs/1883703264#step:6:717

@Kuree Kuree merged commit 4eef029 into Kuree:master Feb 12, 2021
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.

2 participants