Skip to content

Conversation

NikLeberg
Copy link
Contributor

I had a bit of fun trying to fix issue #1125 as it seemed rather simple.

The basic stuff works. But some other does not:

  • does not support alternative labels for if/case generate blocks
    • I had trouble supporting both, the normal label and the alternative label at the same time. Because the current code overwrites the ident of the generate block if an alternative label was found. In such a case gen_case and gen_case_true would both resolve to gen_case_true.
  • if the 'path_name is accessed from outside the generate block, instead of returning e.g. :issue1125:gen_case: it returns only :issue1125:
    • Interesting to think about what we would even return for the gen_for label if we are outside the loop. Inside we have gen_for(0), gen_for(1), etc. But outside? Only gen_for?
    • I tested this with modelsim and it returns whatever it wants.... sometimes gen_for(1) and sometimes gen_for. So it does not seem very important.

Let me know if you see another way of implementing it. Please feel also absolutely free to discard everything and implement your own fix.

Cheers

Fixes #1125

@nickg
Copy link
Owner

nickg commented Jan 9, 2025

does not support alternative labels for if/case generate blocks

I need to check what the LRM says here but I think this is fine as-is.

if the 'path_name is accessed from outside the generate block, instead of returning e.g. :issue1125:gen_case: it returns only :issue1125:

Concurrent blocks have the same problem. I'll try to fix it at the weekend.

@nickg nickg merged commit cd37999 into nickg:master Jan 9, 2025
12 checks passed
@NikLeberg NikLeberg deleted the sup_gen_label_path branch January 10, 2025 00:21
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.

Error: no visible declaration for LABEL
2 participants