Search code examples
macroscommentsverilogsystem-verilog

(System)verilog macro containing a comment?


Is there any way in verilog to write a macro containing a comment so the comment will be 'instantiated' in every instance of the macro? I need the comment inside the macro to turn off a lint complaint about the other code in the macro.


Solution

  • You should use block comments (/* */) and probable multi-line macros. Example:

    `define macro_with_comment \
      /* your comment here */ \
      macro_body_here \
      /* another your comment here */ \
      another_line
    

    Be warned, macros are a pain to debug is something goes wrong.