-
Notifications
You must be signed in to change notification settings - Fork 13
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 native python functional model #289
Conversation
…out xcelium and vcs
Oddly the tests passed for fpga on buildkite but not the normal one. It seems like conda has some weird python system path setup. I will take a look into it. One workaround is to use Edit: Can't reproduce it on cadence7 either. Is there anyway to reproduce the error? |
The conda env is setup with the following commands:
so it creates a local environment in the current working directory. I'm guessing we need to configure pysv to use the correspond library load path? Is there a way we can point it to a custom directory, e.g. with an environment variable? I guess this is similar to how Could it be that |
Relevant part of the workflow: https://github.com/leonardt/fault/blob/master/.buildkite/pipeline.yml#L12-L13 |
For libraries, pysv uses the As for linking, it uses pybind11's built in capability to detect currently python executable and libraries. The error seems to look like library loading issue. |
@leonardt I tried to prune unnecessary imports from pysv's side to avoid switching Here is my working directory on cadence7:
Conda is created at Tried with several Linux distro with conda and still can't reproduce the error. Would be nice if all the tests are containerized and easy to reproduce. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, finally got CI passing, some minor comments to address before merging
Usage example:
DUT:
Functional model (used for demonstrate class constructor and method call):
Test code:
Nee functions/class introduced
make_call
to tester classCallExpression
toexpression
Var
to supportvar.foo
, wherevar
is declaredtester.Var
, andfoo
is a function name. Compile time check to ensure correctnessCode refactored
Simulator tested
Discussion
This should solve #280 fundamentally by allowing arbitrary Python code execution inside a simulator. It also enables runtime model check with values unknown during compilation time.
Most of the heavy lifting is done via the
pysv
package. Currently there are some limitation on how the code should rewritten. Notably how the class and functions import are handled. If there is enough use case for that I can spend some time to solve that issue.Roadmap