data/full_repos/permissive/135701568/stack.v
1: b'%Warning-UNSIGNED: data/full_repos/permissive/135701568/stack.v:24: Comparison is constant due to unsigned arithmetic\n                                                                  : ... In instance stack\n          if(pointer < 0) begin\n                     ^\n                   ... Use "/* verilator lint_off UNSIGNED */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module stack(clk, rst, push, pop, writeData, readData);
  input clk, rst, push, pop;
  input[11:0] writeData;
  output[11:0] readData;
  reg[11:0] stackArray[7:0];
  reg[2:0] pointer;
  integer i;
  always@(posedge clk, posedge rst) begin
    if(rst) begin
      for (i=0; i<=7; i=i+1) begin
        stackArray[i] = 12'b0;
      end
      pointer = 3'b0;
    end
    else begin
      if(push) begin
        stackArray[pointer] <= writeData;
        if(pointer < 7) begin
          pointer = pointer + 1;
        end
      end
      else begin
        if(pop) begin
          if(pointer < 0) begin
            pointer = pointer - 1;
          end
        end
      end
    end
  end
  assign readData = stackArray[pointer];
endmodule
module stack(clk, rst, push, pop, writeData, readData);

  input clk, rst, push, pop;
  input[11:0] writeData;
  output[11:0] readData;
  reg[11:0] stackArray[7:0];
  reg[2:0] pointer;
  integer i;
  always@(posedge clk, posedge rst) begin
    if(rst) begin
      for (i=0; i<=7; i=i+1) begin
        stackArray[i] = 12'b0;
      end
      pointer = 3'b0;
    end
    else begin
      if(push) begin
        stackArray[pointer] <= writeData;
        if(pointer < 7) begin
          pointer = pointer + 1;
        end
      end
      else begin
        if(pop) begin
          if(pointer < 0) begin
            pointer = pointer - 1;
          end
        end
      end
    end
  end
  assign readData = stackArray[pointer];
endmodule