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

Assignment of parameter value to Perl variable #134

Closed
markcohen32 opened this issue Sep 6, 2022 · 3 comments
Closed

Assignment of parameter value to Perl variable #134

markcohen32 opened this issue Sep 6, 2022 · 3 comments
Labels
question Further information is requested

Comments

@markcohen32
Copy link

Hi, Is there any syntax that supports this following case?
`addrmap ADDRMAP_EXAMPLE #(longint unsigned SIZE= 2) {

<% for ( $i = 0; $i < $SIZE; $i += 1 ) { %>
sub_addrmap sub_addrmap_inst_<%=$i%>;
sub_addrmap_inst_<%=$i%> -> hdl_path = "hdl_path_example_for_inst_<%=$i%>";
<% } %>
};`

I'm trying to create some kind of bypass to the unsupported assignment of properties of array elements.

@amykyta3
Copy link
Member

amykyta3 commented Sep 7, 2022

No this is not possible.
The Perl preprocessor processes the input file prior to any RDL source parsing. RDL parameters are evaluated at the end - once the RDL source has been compiled and final expressions are being elaborated.

@amykyta3 amykyta3 added the question Further information is requested label Sep 7, 2022
@markcohen32
Copy link
Author

Thanks for the quick response. Is there any plan to support dynamic assignments? Or, do we have any way to use the existing abilities to use workaround for it?

@amykyta3
Copy link
Member

amykyta3 commented Sep 8, 2022

I have some ideas on how to address #51, but it currently is not a priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants