-
Notifications
You must be signed in to change notification settings - Fork 146
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
TriState code generation uses poorly supported Verilog-2001 port aliases #327
Comments
This is actually a general problem with all code generation invoving |
Can you explain what you think is wrong with that Verilog? I notice that you've instantiated a submodule with instance name If you're referring to the dot notation in the port list, that is valid Verilog. However, we have noticed that some tools do not like it. In the
into this:
The reason we use the first form is because there is no other way to express designs where multiple inout ports share the same signal. In your case, and probably in most designs, there are no shared inout ports, and so the simpler form can be used. (We might want to improve BSC to output this simpler form, when possible, so that there'd be no need for the script. I don't recall if there's a reason why that's hard to do.) |
I've never seen this syntax before (and it frankly looks wholly wrong; I'd only have expected such syntax in SystemVerilog perhaps; I guess that's just another thing Verilog can surprise you with...) and my synthesis tools don't support it. I did look into a fix for this last night for the simpler form, but didn't get anywhere unfortunately. |
For the record, after doing some diving, this syntax was apparently introduced in Verilog 2001; see IEEE-1364-2001 section 12.3.3 |
It's been around since Verilog 2001 and was in 2005 -- I can't say whether newer standards have removed it. In the IEEE 1364 standards, it is described in chapter 12 on "Hierarchical structures", in 12.3 "Ports". It appears first in the syntax grammar table:
and it appears in the examples:
I believe that if you have two ports sharing the same inout, that is the only way you can write the module. The examples also include:
|
As an aside, I've filed a bug for this in Yosys, and hopefully this simply strengthens my case for Verilog-2001-or-later support in e.g. #294. :) |
Would it make sense to print a warning if this syntax is used in the generated Verilog when the |
bsc -verilog -u T.bsv
gives:Looks like there's some simple bug that causes the names to be generated improperly.See below; this is a standard, but uncommon feature.The text was updated successfully, but these errors were encountered: