You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author Name: Jonathon Donaldson
Original Redmine Issue: 833 from https://www.veripool.org
Original Date: 2014-10-27
Original Assignee: Wilson Snyder (@wsnyder)
I'm not sure if it's something that I'm doing wrong or if it's simply just not supported yet, but I'm wondering how/if I can access the enums in my SV code from within my C++ code. With basic SV parameters using /verilator public/ works really well. But if I try to use it with enums I keep getting a verilator syntax error. For example:
If it's not currently supported I wonder if verilator could simply treat the SV enums as if each enumeration was simply a set of independent parameters (maybe that way verilator could leverage what's already supported)?
Right now I have to copy each SV enum code block into my C++ code somewhere and manual translate it to C++ syntax. Not a huge deal, but it is quite a bit of code duplication that would be great to get rid of.
The text was updated successfully, but these errors were encountered:
Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-10-27T16:34:39Z
Enums are presently flattened and not put into the C code.
Often enums come from CSRs or such, and a company has some flow to autogenerate such enums for both C and Verilog, so verilator doesn't have to translate them.
However if you want to add support for this please feel free. I don't think they should become parameters but real enumerations. They will need to be in a separate class as in Verilog they are separate namespaces (e.g. EnumName::FOO and AnotherEnumName::FOO).
Author Name: Jonathon Donaldson
Original Redmine Issue: 833 from https://www.veripool.org
Original Date: 2014-10-27
Original Assignee: Wilson Snyder (@wsnyder)
I'm not sure if it's something that I'm doing wrong or if it's simply just not supported yet, but I'm wondering how/if I can access the enums in my SV code from within my C++ code. With basic SV parameters using /verilator public/ works really well. But if I try to use it with enums I keep getting a verilator syntax error. For example:
The above results in:
If it's not currently supported I wonder if verilator could simply treat the SV enums as if each enumeration was simply a set of independent parameters (maybe that way verilator could leverage what's already supported)?
Right now I have to copy each SV enum code block into my C++ code somewhere and manual translate it to C++ syntax. Not a huge deal, but it is quite a bit of code duplication that would be great to get rid of.
The text was updated successfully, but these errors were encountered: