data/full_repos/permissive/202080108/test/SuperStack_tb.v
None: at end of input
1: b'%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:1: Cannot find include file: assert.vh\n`include "assert.vh" \n         ^~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/202080108/test,data/full_repos/permissive/202080108/assert.vh\n             data/full_repos/permissive/202080108/test,data/full_repos/permissive/202080108/assert.vh.v\n             data/full_repos/permissive/202080108/test,data/full_repos/permissive/202080108/assert.vh.sv\n             assert.vh\n             assert.vh.v\n             assert.vh.sv\n             obj_dir/assert.vh\n             obj_dir/assert.vh.v\n             obj_dir/assert.vh.sv\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:3: Cannot find include file: SuperStack.vh\n`include "SuperStack.vh" \n         ^~~~~~~~~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/202080108/test/SuperStack_tb.v:52: Unsupported: Ignoring delay on this delayed statement.\n  always #1 clk = ~clk;\n         ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:55: Unsupported or unknown PLI call: $dumpfile\n    $dumpfile("SuperStack_tb.vcd");\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:56: Unsupported or unknown PLI call: $dumpvars\n    $dumpvars(0, SuperStack_tb);\n    ^~~~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:59: Define or directive not defined: \'`assert\'\n    `assert(status, `EMPTY);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:59: syntax error, unexpected \',\'\n    `assert(status, `EMPTY);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:59: Define or directive not defined: \'`EMPTY\'\n    `assert(status, `EMPTY);\n                    ^~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:62: Define or directive not defined: \'`POP\'\n    op   <= `POP;\n            ^~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:62: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    op   <= `POP;\n                ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:65: Define or directive not defined: \'`assert\'\n    `assert(error, `UNDERFLOW);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:65: syntax error, unexpected \',\'\n    `assert(error, `UNDERFLOW);\n                 ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:65: Define or directive not defined: \'`UNDERFLOW\'\n    `assert(error, `UNDERFLOW);\n                   ^~~~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/202080108/test/SuperStack_tb.v:64: Unsupported: Ignoring delay on this delayed statement.\n    #2\n    ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:68: Define or directive not defined: \'`PUSH\'\n    op   <= `PUSH;\n            ^~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:68: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    op   <= `PUSH;\n                 ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:71: Define or directive not defined: \'`assert\'\n    `assert(status, `NONE);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:71: syntax error, unexpected \',\'\n    `assert(status, `NONE);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:71: Define or directive not defined: \'`NONE\'\n    `assert(status, `NONE);\n                    ^~~~~\n%Warning-STMTDLY: data/full_repos/permissive/202080108/test/SuperStack_tb.v:70: Unsupported: Ignoring delay on this delayed statement.\n    #2\n    ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:72: Define or directive not defined: \'`assert\'\n    `assert(out   , 8\'h00);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:72: syntax error, unexpected \',\'\n    `assert(out   , 8\'h00);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:74: Define or directive not defined: \'`PUSH\'\n    op   <= `PUSH;\n            ^~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:74: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    op   <= `PUSH;\n                 ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:77: Define or directive not defined: \'`assert\'\n    `assert(status, `NONE);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:77: syntax error, unexpected \',\'\n    `assert(status, `NONE);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:77: Define or directive not defined: \'`NONE\'\n    `assert(status, `NONE);\n                    ^~~~~\n%Warning-STMTDLY: data/full_repos/permissive/202080108/test/SuperStack_tb.v:76: Unsupported: Ignoring delay on this delayed statement.\n    #2\n    ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:78: Define or directive not defined: \'`assert\'\n    `assert(out   , 8\'h01);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:78: syntax error, unexpected \',\'\n    `assert(out   , 8\'h01);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:79: Define or directive not defined: \'`assert\'\n    `assert(out1  , 8\'h00);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:79: syntax error, unexpected \',\'\n    `assert(out1  , 8\'h00);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:81: Define or directive not defined: \'`PUSH\'\n    op   <= `PUSH;\n            ^~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:81: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    op   <= `PUSH;\n                 ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:84: Define or directive not defined: \'`assert\'\n    `assert(status, `FULL);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:84: syntax error, unexpected \',\'\n    `assert(status, `FULL);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:84: Define or directive not defined: \'`FULL\'\n    `assert(status, `FULL);\n                    ^~~~~\n%Warning-STMTDLY: data/full_repos/permissive/202080108/test/SuperStack_tb.v:83: Unsupported: Ignoring delay on this delayed statement.\n    #2\n    ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:85: Define or directive not defined: \'`assert\'\n    `assert(out   , 8\'h02);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:85: syntax error, unexpected \',\'\n    `assert(out   , 8\'h02);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:86: Define or directive not defined: \'`assert\'\n    `assert(out1  , 8\'h01);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:86: syntax error, unexpected \',\'\n    `assert(out1  , 8\'h01);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:87: Define or directive not defined: \'`assert\'\n    `assert(out2  , 8\'h00);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:87: syntax error, unexpected \',\'\n    `assert(out2  , 8\'h00);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:90: Define or directive not defined: \'`NONE\'\n    op <= `NONE;\n          ^~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:90: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n    op <= `NONE;\n               ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:92: Define or directive not defined: \'`assert\'\n    `assert(status, `FULL);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:92: syntax error, unexpected \',\'\n    `assert(status, `FULL);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:92: Define or directive not defined: \'`FULL\'\n    `assert(status, `FULL);\n                    ^~~~~\n%Warning-STMTDLY: data/full_repos/permissive/202080108/test/SuperStack_tb.v:91: Unsupported: Ignoring delay on this delayed statement.\n    #2\n    ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:93: Define or directive not defined: \'`assert\'\n    `assert(out   , 8\'h02);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:93: syntax error, unexpected \',\'\n    `assert(out   , 8\'h02);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:94: Define or directive not defined: \'`assert\'\n    `assert(out1  , 8\'h01);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:94: syntax error, unexpected \',\'\n    `assert(out1  , 8\'h01);\n                  ^\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:95: Define or directive not defined: \'`assert\'\n    `assert(out2  , 8\'h00);\n    ^~~~~~~\n%Error: data/full_repos/permissive/202080108/test/SuperStack_tb.v:95: syntax error, unexpected \',\'\n    `assert(out2  , 8\'h00);\n                  ^\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module SuperStack_tb();

  parameter WIDTH = 8;
  parameter DEPTH = 1;

  localparam MAX_STACK = (1 << DEPTH+1) - 1;

  reg              clk = 0;
  reg              reset;
  reg  [      2:0] op;
  reg  [WIDTH-1:0] data;
  reg  [DEPTH  :0] offset;
  reg  [DEPTH  :0] underflow_limit=0;
  reg  [DEPTH  :0] upper_limit=0;
  wire [DEPTH  :0] index;
  wire [WIDTH-1:0] out;
  wire [WIDTH-1:0] out1;
  wire [WIDTH-1:0] out2;
  wire [WIDTH-1:0] getter;
  wire [      1:0] status;
  wire [      1:0] error;

  SuperStack #(
    .WIDTH(WIDTH),
    .DEPTH(DEPTH),
    .ZEROED_SLICES(1)
  )
  dut(
    .clk(clk),
    .reset(reset),
    .op(op),
    .data(data),
    .offset(offset),
    .underflow_limit(underflow_limit),
    .upper_limit(upper_limit),
    .lower_limit(2'b0),
    .dropTos(1'b0),
    .index(index),
    .out(out),
    .out1(out1),
    .out2(out2),
    .getter(getter),
    .status(status),
    .error(error)
  );

  always #1 clk = ~clk;

  initial begin
    $dumpfile("SuperStack_tb.vcd");
    $dumpvars(0, SuperStack_tb);


    `assert(status, `EMPTY);


    op   <= `POP;
    data <= 0;
    #2
    `assert(error, `UNDERFLOW);


    op   <= `PUSH;
    data <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h00);

    op   <= `PUSH;
    data <= 1;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h01);
    `assert(out1  , 8'h00);

    op   <= `PUSH;
    data <= 2;
    #2
    `assert(status, `FULL);
    `assert(out   , 8'h02);
    `assert(out1  , 8'h01);
    `assert(out2  , 8'h00);


    op <= `NONE;
    #2
    `assert(status, `FULL);
    `assert(out   , 8'h02);
    `assert(out1  , 8'h01);
    `assert(out2  , 8'h00);


    op   <= `PUSH;
    data <= 3;
    #2
    `assert(error, `OVERFLOW);
    `assert(out  , 8'h02);
    `assert(out1 , 8'h01);
    `assert(out2 , 8'h00);


    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h01);
    `assert(out1  , 8'h00);

    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h00);

    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `EMPTY);


    op   <= `REPLACE;
    data <= 4;
    #2
    `assert(error, `UNDERFLOW);

    op   <= `PUSH;
    data <= 5;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h05);

    op   <= `REPLACE;
    data <= 6;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h06);

    op <= `NONE;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h06);


    reset <= 1;
    #2
    reset <= 0;
    `assert(status, `EMPTY);
    `assert(index , 0);






    op              <= `NONE;
    underflow_limit <= 1;
    #2
    `assert(status, `UNDERFLOW);

    `assert(index , 0);



    op   <= `PUSH;
    data <= 8;
    #2
    `assert(status, `EMPTY);
    `assert(out   , 8'h08);
    `assert(index , 1);


    op   <= `PUSH;
    data <= 9;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h09);
    `assert(out1  , 8'h08);
    `assert(index , 2);

    op <= `INDEX_RESET;
    offset <= 1;
    #2
    `assert(status, `EMPTY);
    `assert(out   , 8'h08);
    `assert(index , 1);


    op   <= `POP;
    data <= 0;
    #2
    op <= `NONE;
    `assert(error, `UNDERFLOW);
    `assert(out  , 8'h08);
    `assert(index, 1);


    underflow_limit <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h08);
    `assert(index , 1);


    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `EMPTY);
    `assert(index , 0);


    op <= `INDEX_RESET_AND_PUSH;
    data            <= 10;
    underflow_limit <= 2;
    offset          <= 0;
    #2
    `assert(status, `UNDERFLOW);
    `assert(out   , 8'h0a);
    `assert(index , 1);

    op <= `INDEX_RESET_AND_PUSH;
    data            <= 11;
    underflow_limit <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h0b);
    `assert(index , 1);


    op <= `UNDERFLOW_SET;
    data            <= 12;
    underflow_limit <= 1;
    offset          <= 0;
    #2
    `assert(error, `BAD_OFFSET);
    `assert(out  , 8'h0b);
    `assert(index, 1);

    upper_limit <= 1;
    #2
    `assert(status, `EMPTY);
    `assert(out   , 8'h0c);
    `assert(index , 1);

    op <= `NONE;
    #2
    `assert(status, `EMPTY);
    `assert(index , 1);

    op   <= `PUSH;
    data <= 13;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h0d);
    `assert(index , 2);


    offset <= 0;
    op <= `UNDERFLOW_GET;
    #2
    `assert(status, `NONE);
    `assert(getter, 8'h0c);
    `assert(index , 2);

    offset <= 1;
    op <= `UNDERFLOW_GET;
    #2
    `assert(error, `BAD_OFFSET);
    `assert(index, 2);


    op <= `INDEX_RESET;
    offset <= 3;
    #2
    `assert(status, `FULL);
    `assert(out   , 8'h00);
    `assert(out1  , 8'h0d);
    `assert(out2  , 8'h0c);
    `assert(index , 3);

    $finish;
  end

endmodule
module SuperStack_tb();


  parameter WIDTH = 8;
  parameter DEPTH = 1;

  localparam MAX_STACK = (1 << DEPTH+1) - 1;

  reg              clk = 0;
  reg              reset;
  reg  [      2:0] op;
  reg  [WIDTH-1:0] data;
  reg  [DEPTH  :0] offset;
  reg  [DEPTH  :0] underflow_limit=0;
  reg  [DEPTH  :0] upper_limit=0;
  wire [DEPTH  :0] index;
  wire [WIDTH-1:0] out;
  wire [WIDTH-1:0] out1;
  wire [WIDTH-1:0] out2;
  wire [WIDTH-1:0] getter;
  wire [      1:0] status;
  wire [      1:0] error;

  SuperStack #(
    .WIDTH(WIDTH),
    .DEPTH(DEPTH),
    .ZEROED_SLICES(1)
  )
  dut(
    .clk(clk),
    .reset(reset),
    .op(op),
    .data(data),
    .offset(offset),
    .underflow_limit(underflow_limit),
    .upper_limit(upper_limit),
    .lower_limit(2'b0),
    .dropTos(1'b0),
    .index(index),
    .out(out),
    .out1(out1),
    .out2(out2),
    .getter(getter),
    .status(status),
    .error(error)
  );

  always #1 clk = ~clk;

  initial begin
    $dumpfile("SuperStack_tb.vcd");
    $dumpvars(0, SuperStack_tb);


    `assert(status, `EMPTY);


    op   <= `POP;
    data <= 0;
    #2
    `assert(error, `UNDERFLOW);


    op   <= `PUSH;
    data <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h00);

    op   <= `PUSH;
    data <= 1;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h01);
    `assert(out1  , 8'h00);

    op   <= `PUSH;
    data <= 2;
    #2
    `assert(status, `FULL);
    `assert(out   , 8'h02);
    `assert(out1  , 8'h01);
    `assert(out2  , 8'h00);


    op <= `NONE;
    #2
    `assert(status, `FULL);
    `assert(out   , 8'h02);
    `assert(out1  , 8'h01);
    `assert(out2  , 8'h00);


    op   <= `PUSH;
    data <= 3;
    #2
    `assert(error, `OVERFLOW);
    `assert(out  , 8'h02);
    `assert(out1 , 8'h01);
    `assert(out2 , 8'h00);


    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h01);
    `assert(out1  , 8'h00);

    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h00);

    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `EMPTY);


    op   <= `REPLACE;
    data <= 4;
    #2
    `assert(error, `UNDERFLOW);

    op   <= `PUSH;
    data <= 5;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h05);

    op   <= `REPLACE;
    data <= 6;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h06);

    op <= `NONE;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h06);


    reset <= 1;
    #2
    reset <= 0;
    `assert(status, `EMPTY);
    `assert(index , 0);






    op              <= `NONE;
    underflow_limit <= 1;
    #2
    `assert(status, `UNDERFLOW);

    `assert(index , 0);



    op   <= `PUSH;
    data <= 8;
    #2
    `assert(status, `EMPTY);
    `assert(out   , 8'h08);
    `assert(index , 1);


    op   <= `PUSH;
    data <= 9;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h09);
    `assert(out1  , 8'h08);
    `assert(index , 2);

    op <= `INDEX_RESET;
    offset <= 1;
    #2
    `assert(status, `EMPTY);
    `assert(out   , 8'h08);
    `assert(index , 1);


    op   <= `POP;
    data <= 0;
    #2
    op <= `NONE;
    `assert(error, `UNDERFLOW);
    `assert(out  , 8'h08);
    `assert(index, 1);


    underflow_limit <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h08);
    `assert(index , 1);


    op   <= `POP;
    data <= 0;
    #2
    `assert(status, `EMPTY);
    `assert(index , 0);


    op <= `INDEX_RESET_AND_PUSH;
    data            <= 10;
    underflow_limit <= 2;
    offset          <= 0;
    #2
    `assert(status, `UNDERFLOW);
    `assert(out   , 8'h0a);
    `assert(index , 1);

    op <= `INDEX_RESET_AND_PUSH;
    data            <= 11;
    underflow_limit <= 0;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h0b);
    `assert(index , 1);


    op <= `UNDERFLOW_SET;
    data            <= 12;
    underflow_limit <= 1;
    offset          <= 0;
    #2
    `assert(error, `BAD_OFFSET);
    `assert(out  , 8'h0b);
    `assert(index, 1);

    upper_limit <= 1;
    #2
    `assert(status, `EMPTY);
    `assert(out   , 8'h0c);
    `assert(index , 1);

    op <= `NONE;
    #2
    `assert(status, `EMPTY);
    `assert(index , 1);

    op   <= `PUSH;
    data <= 13;
    #2
    `assert(status, `NONE);
    `assert(out   , 8'h0d);
    `assert(index , 2);


    offset <= 0;
    op <= `UNDERFLOW_GET;
    #2
    `assert(status, `NONE);
    `assert(getter, 8'h0c);
    `assert(index , 2);

    offset <= 1;
    op <= `UNDERFLOW_GET;
    #2
    `assert(error, `BAD_OFFSET);
    `assert(index, 2);


    op <= `INDEX_RESET;
    offset <= 3;
    #2
    `assert(status, `FULL);
    `assert(out   , 8'h00);
    `assert(out1  , 8'h0d);
    `assert(out2  , 8'h0c);
    `assert(index , 3);

    $finish;
  end

endmodule