/sv_proto

Limited support for Protocol Buffers in SystemVerilog.

Primary LanguageSystemVerilogOtherNOASSERTION

Caveats

Real Numbers

Randomization

Not all simulators support real number randomization (or it requires a separate license). As such, real numbers are not declared as `rand` by default.

This behavior can be changed by throwing the following define during verilog compilation:

+define+pb_real_rand=rand

Queues

UVM does not provide object field macros for queues of type real. Thus, real number queues will not print, pack/unpack, or compare, copy, etc.

Protocol Buffer Features Not Supported

Groups

Groups have been deprecated in the protocol buffer specification.

Enum `allow_alias` option

The allow_alias option on enums will create illegal enumerations in SystemVerilog as for a given enumeration type, each enumeration constant must have a unique value.

Repated `bytes` fields lack uvm field macros

UVM does not provide object field macros for nested arrays. Thus, these fields will not print, pack/unpack, or compare, copy, etc.

Initialization of Required Fields

To make randomization as easy as possible, class members do not use the `local` modifier or setters and getters. This makes it impossible to make know if a field has been manually initialized. If an object is randomized or created from deserialization, all required field are marked as initialized.

`oneof` may not work correctly

The previously mentioned about required fields means that multiple fields in a oneof may be serialized which could cause errors in parsers in different languages when deserializing.