Author Topic: RC3 SystemVerilog macro beautification  (Read 7388 times)

warnerrs

  • Senior Community Member
  • Posts: 114
  • Hero Points: 4
RC3 SystemVerilog macro beautification
« on: October 29, 2015, 10:11:50 PM »
Very common in SystemVerilog is defining classes in macros like this:

Code: [Select]
    `define rvm_export_suffix( SUFFIX )                                               \
    class rvm_export``SUFFIX#( type TARGET=rvm_export_base ) extends rvm_export_base; \
        function new(string name = "", rvm_component parent = null);                  \
            super.new(name,parent);                                                   \
        endfunction                                                                   \
        virtual function void write( rvm_object obj );                                \
            TARGET tgt;                                                               \
            $cast(tgt, m_parent);                                                     \
            tgt.write``SUFFIX( obj );                                                 \
        endfunction                                                                   \
    endclass

After beautification, it looks like this:

Code: [Select]
    `define rvm_export_suffix( SUFFIX )                                               \
    class rvm_export``SUFFIX#( type TARGET=rvm_export_base ) extends rvm_export_base; \
    function new(string name = "", rvm_component parent = null);                  \
    super.new(name,parent);                                                   \
    endfunction                                                                   \
    virtual function void write( rvm_object obj );                                \
    TARGET tgt;                                                               \
    $cast(tgt, m_parent);                                                     \
    tgt.write``SUFFIX( obj );                                                 \
    endfunction                                                                   \
    endclass

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: RC3 SystemVerilog macro beautification
« Reply #1 on: October 30, 2015, 01:59:26 PM »
Reproduced, I'll take a look at it. 

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: RC3 SystemVerilog macro beautification
« Reply #2 on: November 04, 2015, 02:42:09 PM »
Fixed in rc5.