-
Notifications
You must be signed in to change notification settings - Fork 69
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
Access to the parameters of the component #135
Comments
The information exists, but it is not part of the public API. Here's how you would extract that information. Assume "my_node" represents an instance of "reg_example": # Get final parameter value after any overrides
for p in my_node.inst.parameters:
if p.name == "REGWIDTH":
value = p.get_value()
break
# Get original parameter value prior to any override
for p in my_node.inst.original_def.parameters:
if p.name == "REGWIDTH":
value = p.get_value()
break It is important for me to note - since this is not part of the publicly documented API, I cannot guarantee that this will work in the future in case I decide to change the underlying implementation. Since I'm curious, what are you aiming to accomplish in this situation? |
My Intention is to create an automation that would create verilog registers corresponding to the rdl registers. And, as can be assumed from my question, I would like to use parametrization too. |
Another question, in case of assignment of a parameter value by another parameter - can this data be accessed too?
I'd like to have the information saying that the property regwidth is assigned by a parameter called "REGWIDTH" and this parameter is assigned by another parameter called "TOP_REGWIDTH_PARAM". |
The Links: https://github.com/SystemRDL/systemrdl-compiler/blob/main/systemrdl/core/parameter.py#L15 But reminder - this is well beyond the "stable API" and I guarantee I will be changing it once I start work on #58. I suspect once I complete that feature, the ability to defer parameter evaluation will more closely resemble what you actually need. |
When is #58 supposed to be implemented? |
I hope to start work on #58 this year, but we'll see. Keep in mind that all of these SystemRDL tools are done in my free time in the evenings. It has become a bizarre hobby project for me 😆 Currently, there is no way to determine how a particular value was assigned to a property since all that information is discarded during elaboration. All assignment expressions are evaluated into their final values. The only thing that remains of the abstract syntax tree are the leftover references in the parameters I mentioned earlier. Once #58 is implemented, you'll be able to mark a top-level parameter as "deferred" (or whatever I decide to call it) and then any assignments that interact with that parameter will end up preserving that part of their AST. |
I missed this in your prior comment:
Be sure to check out my other project - PeakRDL-regblock. |
This ability would be helpful. Hope you'll have the time to implement this. Traversing the AST seems to be pretty difficult and, as you said, unstable. Anyway, I'm not sure if the following question is worth another thread, but it's also related to RDL parameters.
|
Unfortunately it doesn't look like the SystemRDL spec defines a mechanism for defining auto-sized array literals.
|
Hi,
I've been trying to find a method/property of some components that would give me an access to the parameter definitions and values.
For instance:
Instantiation:
reg_example #(.REGWIDTH(64),.DESCRIPTION("test description")) reg_example_inst;
I'd like to have access to the parameters through the RegNode component that would allow me to extract the defined parameters, their original + override values.
Does something like that exists in the current API?
Thanks
The text was updated successfully, but these errors were encountered: