The idv_doxyfilter_sv.pl doesn't handle structs and unions that are declared as Packed, which also implies that it doesn't handle when they are handled as signed either.
For example, here is the output of the tool with some typedef struct signed, unsigned, packed declared.

Per the SystemVerilog spec this is the syntax for Structs, Unions, Packed Structs and Unions. There are also tagged unions but for the purpose of conversion, the same methodology should be followed.





Proposed solution:
Just like what is done for a typedef enum (see below), something very similar in Strategy needs to be done for typedef struct and unions
Enumerated Typedef
SV Enumerated Typedef looks exactly like C++ enum
Except that C++ enums are always of type int
SV: typedef enum [type] {...} enumtypename
C++: typedef enum [optional enumtypename] [: type] {...} enumtypename
Current Strategy:
- get rid of any optional type information
- note when in an enum body
if (/typedef enum/) {
if (/\benum\b\s+{/) {}
else {
s/\benum\b(.?){/enum {/;
}
}
else {
if (/\benum\b\s+{/) {}
else {
s/\benum\b(.?){/enum {/;
}
}
The idv_doxyfilter_sv.pl doesn't handle structs and unions that are declared as Packed, which also implies that it doesn't handle when they are handled as signed either.
For example, here is the output of the tool with some typedef struct signed, unsigned, packed declared.

Per the SystemVerilog spec this is the syntax for Structs, Unions, Packed Structs and Unions. There are also tagged unions but for the purpose of conversion, the same methodology should be followed.

Proposed solution:
Just like what is done for a typedef enum (see below), something very similar in Strategy needs to be done for typedef struct and unions
Enumerated Typedef
SV Enumerated Typedef looks exactly like C++ enum
Except that C++ enums are always of type int
SV: typedef enum [type] {...} enumtypename
C++: typedef enum [optional enumtypename] [: type] {...} enumtypename
Current Strategy:
- get rid of any optional type information
- note when in an enum body
if (/typedef enum/) {
if (/\benum\b\s+{/) {}
else {
s/\benum\b(.?){/enum {/;
}
}
else {
if (/\benum\b\s+{/) {}
else {
s/\benum\b(.?){/enum {/;
}
}