Implicit port connection not properly checked

Posted 19 days ago by Antonio Strollo

Post a topic
Un Answered
A
Antonio Strollo

Consider the following simple Systemverilog code:


module test (input logic clk, rst, output logic [3:0] cnt);
always_ff @ (posedge clk)
 if (rst)
   cnt <= 0;
 else
   cnt <= cnt + 1;
endmodule : test

module tb_test;
logic clk, rst;
logic [3:0] cnt2;

test mm (.*); // Error here

initial begin
    rst = 1'b1;
    #3ns rst = 1'b0;
    #120ns;
    $display("End of simulation");
    $finish;
end

always begin
    clk = 1'b0;
    #2ns;
    clk = 1'b1;
    #2ns;
end
endmodule : tb_test

There is an error in the implicit port connection: test mm (.*)  (due to the mispelled variable cnt2). However, this error is not reported by dsim that performs the simulation without signaling any error or warnings. Command issued:

dsim -noopt -timescale 1ns/1ps  +acc -waves test.vcd example.sv

Metrics DSim version: 20240923.0.0 (b:R #c:0 h:e981d301ee os:ubuntu_22.04)


1 Votes


1 Comments

C

Christine Andress posted 18 days ago Admin

Hello,

Thank you for your test case.  I have created an internal enhancement request for this issue.  The SystemVerilog Language Reference Manual is a little unclear if this should be an error or not, but we agree that DSim should at least issue a warning.


0 Votes

Login to post a comment