Menu

#433 Define macro breaks the syntax checking in SVE

v1.0_(example)
closed-fixed
None
5
2016-07-29
2016-07-27
Vinay Jain
No
`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)
2 Attachments

Related

Bugs: #433

Discussion

  • Matthew Ballance

    • status: open --> closed-fixed
     
    • Vinay Jain

      Vinay Jain - 2016-08-06

      :) 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:

      • status: open --> closed-fixed
      • Comment:

      Thanks 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.


      [bugs:#433] Define macro breaks the syntax checking in SVE

      Status: closed-fixed
      Group: v1.0_(example)
      Created: Wed Jul 27, 2016 04:30 PM UTC by Vinay Jain
      Last Updated: Wed Jul 27, 2016 04:30 PM UTC
      Owner: Matthew Ballance
      Attachments:

      ~~~
      `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)
      ~~~


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/sveditor/bugs/433/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

      --
      Best Regards,
      Vinay Jain

       

      Related

      Bugs: #433

  • Matthew Ballance

    Thanks 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.

     

Log in to post a comment.