How can I find the original value within a PortSymbol in Pyslang?
#1420
-
|
How can I find the original value within a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
I noticed that the |
Beta Was this translation helpful? Give feedback.
-
|
I'm also trying to override parameters via paramOverrides to ensure that the bit width of the Port and other information is exactly what I need. However, I'm currently facing an issue: I only know how to use the simple format like compilation.options.paramOverrides = ['WIDTH=256'], but the complex format such as top.fifo.WIDTH=256 doesn't work. |
Beta Was this translation helpful? Give feedback.
-
|
What you are calling the "value" here is actually the type of the port. It's not really possible with the current slang AST to get the constant expressions inside a type declaration, since types are uniquified across all logic vectors of a given width (which is needed for type equivalency checking, for example). You might be able to do something like get the underlying SyntaxNode for the port declaration you care about and rebind the expression yourself manually to inspect the Expression tree. As far as hierarchical param overrides go, they are supported as of the current unreleased version of slang. You will need to build the Python library from source if you want to use it before the next official release. |
Beta Was this translation helpful? Give feedback.

What you are calling the "value" here is actually the type of the port. It's not really possible with the current slang AST to get the constant expressions inside a type declaration, since types are uniquified across all logic vectors of a given width (which is needed for type equivalency checking, for example). You might be able to do something like get the underlying SyntaxNode for the port declaration you care about and rebind the expression yourself manually to inspect the Expression tree.
As far as hierarchical param overrides go, they are supported as of the current unreleased version of slang. You will need to build the Python library from source if you want to use it before the ne…