Skip to content

Remove empty case and if replace with body #12

@wsnyder

Description

@wsnyder

The below is the result of minimizing, for Verilator giving a %q as the only error. (Arbitrary way to look for the display statement still existing):

package uvm_pkg;
  virtual class uvm_report_catcher;
    function string get_id();
    endfunction
  endclass
endpackage
module t;
  import uvm_pkg::*;
  class my_catcher extends uvm_report_catcher;
    virtual function int catch(string msg);
      if (get_id() == "UVMCB_TRC") begin
        case ("Z")
          "A": $display("bad format %q");
          "B": $display("format");
          "C": $display("format");
        endcase
      end
    endfunction
  endclass
endmodule

I think best-case output is:

module t;
  class my_catcher;
    virtual function int catch(string msg);
        $display("bad format %q");
    endfunction
  endclass
endmodule

Please consider

  1. try removing case items.
  2. try case (x) ign: y becomes y
  3. try if (x) y becomes y.
  4. try if (x) ign; else y becomes y.

Thanks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions