When using typedef to declare a user-defined type, both these forms are accepted by EDA Playground:
typedef reg[4:0] reg5;
typedef logic[4:0] logic5;
However, if doing something similar based on wire type, then this format fails:
typedef wire[4:0] wire5;
I get "Syntax Error".
How can that be explained?
It is illegal to declare a
typedefwith awiretype, according to the IEEE Std 1800-2017. Refer to section 6.18 User-defined types:A
wireis not adata_type, whereasregandlogicare. Awireis anet_type.