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
It fails during macro expansion because SIZE'd0 is used as the full macro target, and not just SIZE. The reason is the logic that deals with the following (i.e. concatenation which leads to a recursive macro call):
`define FOO(TYPE,ARG,FLAG) `M_UVM_``TYPE(ARG,FLAG)
`define M_UVM_ARRAY(arg1, arg2) yo
`FOO(ARRAY, byte_valid, UVM_NOPACK)
So the former currently fails and the latter works. Obviously SIZE'd0 cannot be a legal macro name, but that's irrelevant here. When the macro text in D is scanned we can't know whether it will expand to a new macro call SIZE_rest_of_macro_name or 42'd0.
The LRM doesn't appear to be very clear on the rules here and there is not much available example code except for the latter example above (from the uvm reference implementation).
The text was updated successfully, but these errors were encountered:
The following test fails:
It fails during macro expansion because
SIZE'd0
is used as the full macro target, and not justSIZE
. The reason is the logic that deals with the following (i.e. concatenation which leads to a recursive macro call):So the former currently fails and the latter works. Obviously
SIZE'd0
cannot be a legal macro name, but that's irrelevant here. When the macro text inD
is scanned we can't know whether it will expand to a new macro callSIZE_rest_of_macro_name
or42'd0
.The LRM doesn't appear to be very clear on the rules here and there is not much available example code except for the latter example above (from the uvm reference implementation).
The text was updated successfully, but these errors were encountered: