title: Passing a module name as parameter
body: <p>I want to create this generic wrapper for a bunch of modules I am writing. The wrapper should provide the ability to connect these modules to different type of NoCs without having to change the behavior of the inner modules.</p>
  
  <p>I thought that one way to do this would be the following.
  Considering a very simple module to wrap:</p>
  
  <pre><code>module add #(                                                                                                                       
               parameter COLUMN_WIDTH     = 32                                                                                        
               )
  
     (
      //data in                                                                                                                       
      input logic [COLUMN_WIDTH-1:0]  col_1,
      input logic [COLUMN_WIDTH-1:0]  col_2,
      //data out                                                                                                                      
      output logic [COLUMN_WIDTH-1:0] col_o
  
      );
  
     assign col_o = col_1 + col_2;
  
  endmodule
  </code></pre>
  
  <p>The wrapper should be the following:</p>
  
  <pre><code>module wrapper #(                                                                                                                   
                   parameter COLUMN_WIDTH     = 32,                                                                                   
                   parameter WRAPPED_MODULE   = add                                                                                   
               )
     (
      //data in                                                                                                                       
      input logic [COLUMN_WIDTH-1:0]  col_1,
      input logic [COLUMN_WIDTH-1:0]  col_2,
      //data out                                                                                                                      
      output logic [COLUMN_WIDTH-1:0] col_o,
      /* std signals */
      input logic                     clk,
      input logic                     reset_i // reset everything                                                                     
      );
  
     logic [COLUMN_WIDTH-1:0]         max_result;
  
     WRAPPED_MODULE #(.COLUMN_WDITH(COLUMN_WIDTH),
                      ) a(
                          .*
                          );
  
     always @(posedge clk) begin
        if (reset_i)
          max_result &lt;= 0;
        else
          max_result &lt;= (col_o &gt; max_result) ? col_o : max_result;
     end
  
  endmodule
  </code></pre>
  
  <p>The error I get is the following:</p>
  
  <pre><code>Error-[IND] Identifier not declared
  wrapper.sv, 4
    Identifier 'add' has not been declared yet. If this error is not expected, 
    please check if you have set `default_nettype to none.
  </code></pre>
  
  <p>Which makes sense since a parameter is not the same as a macro.
  A complete design should possibly instantiate a bunch of wrapped modules and I don't want to duplicate code by creating a wrapper for each inner module.
  How can I do that?</p>