SystemVerilog .* Notation

A customer asked me what would happen if a variable didn't exist when using the SystemVerilog .* port notation. Actually, I knew the answer to this, but forgot I did, so did a little EDA Playground test to see:

module DUT (input i, output o);
  assign i = 0;
endmodule


module T;

  DUT dut (.*); 
endmodule


https://www.edaplayground.com/x/43KN

This is an error, because all variables required by the .* notation must exist. It also does strict type checking, so this will not compile, either:

module T;
  logic i; 

  int o;
  DUT dut (.*);
endmodule


because int is the wrong width.

A customer asked me about this. I didn't know the answer, so I wrote a few lines of code on EDA Playground. EDA Playground is great for that, because it's always on. You don't have to queue for licences, wait for EDA tools to start, create new files, fire up editors...

Comments

Popular posts from this blog

Bit Width Casting in SystemVerilog

How to convert a std_logic_vector to a hex string?

Can you add/remove more than 1 item from a queue?