[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  Schedule::Load
  SVN::S4
  Synopsys-modes
  SystemPerl
  Verilog-Pli
  Voneline
  Vregs
General Info
  Papers

Is it possible to use type as a parameter?

Added by Alex Solomatnikov about 1 year ago

SystemVerilog LRM has the following example:

module ma #( parameter p1 = 1, *parameter type* p2 = shortint )
         (input logic [p1:0] i, output logic [p1:0] o);
   p2 j = 0; // type of j is set by a parameter, (shortint unless redefined)
   always @(i) begin
      o = i;
      j++;
   end
endmodule

Replies (3)

RE: Is it possible to use type as a parameter? - Added by Wilson Snyder about 1 year ago

Not presently, I'll look at it.

RE: Is it possible to use type as a parameter? - Added by Wilson Snyder about 1 year ago

This is a good sized change which I can't get to immediately. If you can file a bug, I'll try. If you'd like to take a stab at implementing it I can give tips.

RE: Is it possible to use type as a parameter? - Added by Alex Solomatnikov about 1 year ago

This is very useful feature if one uses typedefs (as I am trying to do now). However, it is possible to write code without it (which is unlike type casting), although the code is more cumbersome.

(1-3/3)