data/full_repos/permissive/143278/ivltests/br963.v
 line:6: before: "]"
1: b'%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/br963.v:18: Operator SUB expects 37 bits on the RHS, but RHS\'s VARREF \'popped\' generates 32 bits.\n                                                                     : ... In instance qtest\n   sum1 = sum1 - popped;\n               ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/br963.v:20: Operator ADD expects 37 bits on the RHS, but RHS\'s VARREF \'data\' generates 32 bits.\n                                                                     : ... In instance qtest\n      sum1 = sum1 + data;\n                  ^\n%Warning-WIDTH: data/full_repos/permissive/143278/ivltests/br963.v:24: Operator ADD expects 37 bits on the RHS, but RHS\'s CMETHODHARD \'at\' generates 32 bits.\n                                                                     : ... In instance qtest\n        sum2 = sum2 + values[i];\n                    ^\n%Error: Exiting due to 3 warning(s)\n'
module qtest;
  parameter width = 32;
  parameter depth = 32;

  reg [width-1:0] values[$];
  reg [$clog2(depth)+width-1:0] sum1;
  reg [$clog2(depth)+width-1:0] sum2;

  task new_sample;
    input [width-1:0] data;
    int i;
    begin
      reg [width-1:0] popped;
      if (values.size >= depth)
	begin : foo
	  popped = values.pop_back();
	  sum1 = sum1 - popped;
	end
      sum1 = sum1 + data;
      values.push_front(data);
      sum2 = 0;
      for (i = 0; i < values.size; i++) begin
        sum2 = sum2 + values[i];
      end
      $display("sum1 = %d  sum2 = %d", sum1, sum2);
      if (sum1 !== sum2) begin
        $display("FAILED");
        $finish;
      end
    end
  endtask

  initial begin
    sum1 = 0;
    repeat (2*depth) new_sample({$random});
    $display("PASSED");
  end

endmodule
module qtest;

  parameter width = 32;
  parameter depth = 32;

  reg [width-1:0] values[$];
  reg [$clog2(depth)+width-1:0] sum1;
  reg [$clog2(depth)+width-1:0] sum2;

  task new_sample;
    input [width-1:0] data;
    int i;
    begin
      reg [width-1:0] popped;
      if (values.size >= depth)
	begin : foo
	  popped = values.pop_back();
	  sum1 = sum1 - popped;
	end
      sum1 = sum1 + data;
      values.push_front(data);
      sum2 = 0;
      for (i = 0; i < values.size; i++) begin
        sum2 = sum2 + values[i];
      end
      $display("sum1 = %d  sum2 = %d", sum1, sum2);
      if (sum1 !== sum2) begin
        $display("FAILED");
        $finish;
      end
    end
  endtask

  initial begin
    sum1 = 0;
    repeat (2*depth) new_sample({$random});
    $display("PASSED");
  end

endmodule