-
Notifications
You must be signed in to change notification settings - Fork 58
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
SV default input port values #306
Comments
Do any of your default input port values depend on parameters or localparams? It would be easier to craft a conversion for this feature if not, thus allowing the expression to be directly substituted into the module instantiation as shown. |
Parameters yes in some cases, localparams no (can you even reference localparams in port declarations?). For example, in one case I have a default value like so: |
Yes, of course! The following is perfectly valid: module top(x);
localparam W = 10;
input [W:0] x;
endmodule Here's a more cursed example where parameters reference localparams: Lines 15 to 24 in 8cc828c
|
Whew. Yeah, I can definitely see how that would make things complicated. Well, stop-gap is at least remove the default value specification from the output completely since that needs to be done either way, and then potentially error out when one of those ports isn't connected somewhere. |
I added support for input ports with default values in 5d5723f. Please let me know if it works for you! |
@alexforencich I'm closing this as completed, as I believe I've implemented the feature you requested. Thank you for the suggestion! Please let me know if you run into any trouble. |
SV allows specifying default values for input ports. However, sv2v does not handle these correctly, so tools like quartus complain about the syntax.
Test case:
Currently, this converts to:
But, it should be more like:
The text was updated successfully, but these errors were encountered: