-
Notifications
You must be signed in to change notification settings - Fork 893
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
Support enumerated values in ilang, output to VCD files #1594
Comments
- information also useful for strongly-typed enums (not implemented) - resolves enum values in ilang part of YosysHQ#1594 - still need to output enums to VCD (or better yet FST) files
- information also useful for strongly-typed enums (not implemented) - resolves enum values in ilang part of YosysHQ#1594 - still need to output enums to VCD (or better yet FST) files
I believe this proposal has been implemented as a part of #1642. |
@RobertBaruch Could you explain why you suggested the following format?
To me it seems like |
To support not having to add leading zeros, as in 16'0. |
When is not having leading zeroes important? The current representation is harder to work with in whatever backend ends up interpreting the enumeration, is that justified? |
I have no opinion either way. It was just based on my own usage in Verilog, but if it's automatically generated, it makes no difference. |
Thanks for the explanation. If you are not opposed to it, I would much prefer to use a simpler representation that represents the state less ambiguously. I will prepare a PR. |
Proposal:
It would be nice to support enumerated values in ilang, and then be able to see those values in VCD files, similar to how nMigen simulates and then outputs string values to vcd.
Example output from nMigen. Here, the
op
signal is an enumerated signal, so it has typestring
.This could be accomodated by adding attributes to such enumerated signals, e.g.:
where the format is
\enum_<width>_<bits>
. Here,SUB
would be equivalent to1'0
andADD
to1'1
.Then, whenever yosys writes a VCD file including that signal, it would use
$var string
for the signal, attempt to match any value for that signal against\enum_<width>_<bits>
, and if present, writes<attr-string>/<value>
for the value of the signal, e.g.sADD/1
. If the value of the signal does not have such an attribute, then the string value of the signal is the numeric value,s<value>
, e.g.s1
.It wouldn't be necessary at this point to support Verilog enums. Presumably once enumerated values are supported in ilang it would maybe be part of the way to supporting Verilog enums.
The text was updated successfully, but these errors were encountered: