Define macro breaks the syntax checking in SVE
Status: Beta
Brought to you by:
mballance
`define GET_TIMEOUT_FROM_CMD_LINE(OPT_NAME, OPT_NAME_STR, NAME_STR, DEFAULT_VAL)\ \ num_matches = cmd_line.get_arg_value("+``OPT_NAME``", timeout_str); \ \ if (num_matches > 1) \ begin \ `uvm_warning( \ "STARVATION & DEADLOCK CHECKER", \ $sformatf({"UVM command line option %s matched more than once using ", \ "value from the first match." }, \ OPT_NAME_STR \ ) \ ) \ end \ if (num_matches > 0) \ begin \ if (timeout_str[0] == "=") \ begin \ timeout_str = timeout_str.substr(1, (timeout_str.len()-1)); \ end \ OPT_NAME``_ns = timeout_str.atoi(); \ `uvm_info( \ "STARVATION & DEADLOCK CHECKER", \ $sformatf("%s set to %0dns", NAME_STR, OPT_NAME``_ns), \ UVM_NONE \ ) \ end \ else \ begin \ OPT_NAME``_ns = DEFAULT_VAL; \ `uvm_info( \ "STARVATION & DEADLOCK CHECKER", \ $sformatf("Using default %s of %0dns", NAME_STR, OPT_NAME``_ns), \ UVM_NONE \ ) \ end
This is macro defination and when I use this macro, its break the syntax checking
`GET_TIMEOUT_FROM_CMD_LINE(deadlock_timeout, "deadlock_timeout", "deadlock timeout", 'd1000000) `GET_TIMEOUT_FROM_CMD_LINE(starvation_read_timeout_base, "starvation_read_timeout_base", "read starvation timeout base", 'd500000) `GET_TIMEOUT_FROM_CMD_LINE(starvation_read_timeout_per_beat, "starvation_read_timeout_per_beat", "read starvation timeout per beat", 'd1000000)
:) I really appriciate your work,
thats very nice feature to see macro Expansion view. It will surely be
helpful.
cant wait to get that release. :)
Thanks
Vinay Jain
On Fri, Jul 29, 2016 at 4:57 PM, Matthew Ballance mballance@users.sf.net
wrote:
--
Best Regards,
Vinay Jain
Related
Bugs:
#433Thanks for reporting this! The pre-processor was tripping over the escaped macro-parameter reference inside the string. This issue will be fixed in the 1.8.8 release.
Also in the 1.8.8 release is a first version of a Macro Expansion view, that was very helpful in giving me a first-level indication of where the issue was.