-
Notifications
You must be signed in to change notification settings - Fork 56
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
Different types in generate branches results in error #265
Comments
In the discussion following #155 (comment), I wondered whether sv2v should need to be able to determine that a particular code path is unreachable to short-circuit code that is invalid or cannot be represented downstream. Based on #226 and openhwgroup/cv32e40x@3438fdb, it doesn't seem like cv32e40x required this behavior until earlier this year. It might be possible to support this pattern by detecting and replacing the invalid branch with a |
I'm afraid I don't have many thoughts on this topic. For now, I just worked around this issue by duplicating the MPU and enabling one of the paths in each module. Before, I did not even know it was possible to change types via parameters in SystemVerilog ^^ But it seems that to use type parameters one needs support for this feature, right? Because depending on which type is selected, it has to be handled differently. This could also be handled by the preprocessor (`ifdef/`endif), but is not practical. The solution you proposed seems to work well for this use case, and I can't think of a scenario where the contents of the invalid branch are needed. Thanks for taking a look at this! Please know there is no rush to support this right now, since I found a workaround for my use case. |
Here's a slightly different issue that seems to be related to this one. The repository https://github.com/pulp-platform/obi contains various IPs that are compatible with the OBI bus protocol. The OBI bus can be configured with various features enabled or disabled. Depending on the configuration, certain fields of a struct are accessed in some of the modules. If the rready feature is disabled, sv2v still errors out that the field could not be found in the struct. See This also applies at least to I think if sv2v would ignore the disabled branch, then this should work too. |
Using two different types in two different generate branches for the same signal results in the following error:
Proprietary simulators I have tried seem to ignore the other inactive branch.
This feature is used in the MPU of the cv32e40x.
Here is a minimal example to reproduce the error:
The text was updated successfully, but these errors were encountered: