Compiler directives for re-defination of user code and macro expansion with backstic

Hi Folks,

I need help with compiler directives or macro expansion with backstic”. I have below code and I want to re-define either from command line or last compiled file.

ifndef VIP_LOG_ERR_MSG define VIP_LOG_ERR_MSG(MY_STRING) $display(MY_STRING)
`endif

initial begin
` LOG_ERR_MSG(“This is local VIP error at %t”, $realtime);
end

///Last compiled code in my TB (last_file.vh)
define VIP_LOG_ERR_MSG(MY_STRING) \ uvm_error(“New definition of VIP_LOG_ERR_MSG here : %s”,MY_STRING);

xmvlog: *W,NONPRT (last_file.vh ,23|24): non-printable character (0x9d) ignored.
`uvm_error(“New definition of VIP_LOG_ERR_MSG here : %s”,MY_STRING);
|
xmvlog: *W,MACRDF (last_file.vh ,23|46): text macro ’ VIP_LOG_ERR_MSG’ redefined - replaced with new definition.
file: (last_file.vh )

Even though it logs “text macro ’ VIP_LOG_ERR_MSG’ redefined - replaced with new definition” message in log, but still I don’t see the definition re-defined. Any pointers would be much apricated.
I still see “This is local VIP error at 1111.12ps” message in log instead (expecting) of “New definition of VIP_LOG_ERR_MSG here :”

Thanks,
Aneesh

In reply to aneesh2010:

Text macros get expended as they are encountered in the source. If you change a text macro later in the source, it has no effect on the previous expansion

Thank you Dave. Do you have any suggestion to override that code, any other method or pointers would be really helpful.