Project

General

Profile

[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
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1117

Can't compile with "--assert" for files with "unique casez"

Added by Enzo Chi 7 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
High
Assignee:
Category:
TranslationError
% Done:

0%


Description

Verilator 3.886 2016-07-30 rev verilator_3_884-13-gb4a7e46

Can't compile file with "unique casez" with "--assert"

Test code:

unique_case.sv

module unique_case (
                    input bit clk,
                    input bit rst,
                    input bit [1:0] sel,
                    input bit a,
                    input bit b,
                    input bit c,
                    output bit dout
                    );

    always_ff @(posedge clk) begin
        if (rst) begin
            dout <= '0;
        end else begin
            unique casez(sel)
                2'b00 : dout <= a;
                2'b01 : dout <= b;
                2'b1? : dout <= c;
            endcase // unique casez (sel)
        end
    end // always_ff @ (posedge clk)

endmodule // unique_case

Command: verilator --assert --cc unique_case.sv

Error message:
%Error: unique_case.sv:18: Unsupported tristate construct: EQ
%Error: Exiting due to 1 error(s)

Compile the same file without "--assert", everything is fine.

History

#1 Updated by Wilson Snyder 7 months ago

  • Category set to TranslationError
  • Status changed from New to Resolved
  • Assignee set to Wilson Snyder

Indeed had never handled inside casez, thanks for the test. Fixed in git towards 3.891.

#2 Updated by Wilson Snyder 5 months ago

  • Status changed from Resolved to Closed

In 3.900.

#3 Updated by Enzo Chi about 1 month ago

Tried with modified code on 3.902, it still failed. Please check the modified test code.

module unique_case (
    input bit       clk,
    input bit       rst,
    input bit [1:0] sel,
    input bit       a,
    input bit       b,
    input bit       c,
    output bit      dout
    );

    localparam logic DC  = 1'b?;

    always_ff @(posedge clk) begin
        if (rst) begin
            dout <= '0;
        end else begin
            unique casez(sel)
                2'b00 : dout <= a;
                2'b01 : dout <= b;
                {1'b0, DC} : dout <= c;
            endcase // unique casez (sel)
        end
    end // always_ff @ (posedge clk)

endmodule // unique_case

#4 Updated by Wilson Snyder about 1 month ago

The example you showed for me gives an assertion failure since it does overlap.

Can you please modify test_regress/t/t_assert_casez.v and/or a similar file to show the problem and describe what result you expect? Also please open a new bug, since this one already hit a release. Thanks.

Also available in: Atom