Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for /*verilator public*/ on SV structs too? #860
Author Name: Jonathon Donaldson
The recently added feature of being able to use /verilator public/ on SV enums is priceless and works very very well. I no longer have to duplicate (i.e. recreate) any enums in my C++ code that already exist in my SV code. This saves loads of tedious copy & paste work when creating the testbench!
I'm now wondering if the same capability can easily be added for SV structs? The reason I ask is because I also have a lot of SV structs in my designs that are made up of these enums and so I end up having to duplicate the SV structs in my C++ code.
Let's assume I have the following SV package that I verilate:
With the current version of verilator the "/verilator public/" on the struct is ignored. So this results in having to do the following in the C++ testbench code:
But if /verilator public/ worked on SV structs then all I would have to do is this:
With the existing support for /verilator public/ on SV enums is support for SV structs something that can be easily added? Or are SV structs a whole different problem altogether that would require a significant amount of work?
I attached an example in test_regress format.
Original Redmine Comment
Structures can reference structures and arrays, so this is a lot harder than enums. If you'd like to work more on a patch an I can give suggestions as to how to proceed.