data/full_repos/permissive/161029703/src/uma/L2Cache/TimeStamp_stimulus.v
 line:20: before: "["
1: b'%Warning-STMTDLY: data/full_repos/permissive/161029703/src/uma/L2Cache/TimeStamp_stimulus.v:8: Unsupported: Ignoring delay on this delayed statement.\n        #20 reset = 1\'b0;\n        ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/161029703/src/uma/L2Cache/TimeStamp_stimulus.v:11: Unsupported: Ignoring delay on this delayed statement.\n        #2 clk = ~clk;\n        ^\n%Warning-STMTDLY: data/full_repos/permissive/161029703/src/uma/L2Cache/TimeStamp_stimulus.v:33: Unsupported: Ignoring delay on this delayed statement.\n            #4 \n            ^\n%Error: data/full_repos/permissive/161029703/src/uma/L2Cache/TimeStamp_stimulus.v:50: Unsupported: Seeding $random doesn\'t map to C++, use $c("srand")\n            access = ($random(seed) - 1) % 16;\n                      ^~~~~~~\n%Error: Internal Error: data/full_repos/permissive/161029703/src/uma/L2Cache/TimeStamp_stimulus.v:50: ../V3Ast.cpp:358: Null item passed to setOp1p\n            access = ($random(seed) - 1) % 16;\n                                    ^\n                        ... See the manual and https://verilator.org for more assistance.\n'
module TimeStamp_stimulus;
    reg clk, reset;
  
    initial begin
        clk = 1'b1;
        reset = 1'b1;
        #20 reset = 1'b0;
    end
    always
        #2 clk = ~clk;
  
    wire [3:0] oldest;
    reg en;
    reg [3:0] access;
    TimeStamp time_stamp(.clk(clk), .reset(reset), .en(en), .access(access), .oldest_stamp(oldest));
  
    integer i, j, seed;
  
    integer count[0:15];
    integer max_value;
    integer max_index;
  
    initial begin
        en = 1'b0;
        access = 4'h0;
        seed = 0;
        for (j = 0; j < 16; j = j + 1) begin
            count[j] = 0;
        end
        #21
        for (i = 0; i < 10000; i = i + 1) begin
            #4 

            max_value = count[0];
            max_index = 0;
            for (j = 1; j < 16; j = j + 1) begin
                if (count[j] > max_value) begin
                    max_value = count[j];
                    max_index = j;
                end
            end
          
            if (max_index != oldest) begin
                $display("Error: mismatch");
                $stop;
            end
          

            access = ($random(seed) - 1) % 16;
            en = $random(seed) % 2;
            

            if (en == 1) begin
                for (j = 0; j < 16; j = j + 1)
                    count[j] = count[j] + 1;
                count[access] = 0;
                #8 begin end
            end
        end
        $display("PASS");
    end
endmodule
module TimeStamp_stimulus;

    reg clk, reset;
  
    initial begin
        clk = 1'b1;
        reset = 1'b1;
        #20 reset = 1'b0;
    end
    always
        #2 clk = ~clk;
  
    wire [3:0] oldest;
    reg en;
    reg [3:0] access;
    TimeStamp time_stamp(.clk(clk), .reset(reset), .en(en), .access(access), .oldest_stamp(oldest));
  
    integer i, j, seed;
  
    integer count[0:15];
    integer max_value;
    integer max_index;
  
    initial begin
        en = 1'b0;
        access = 4'h0;
        seed = 0;
        for (j = 0; j < 16; j = j + 1) begin
            count[j] = 0;
        end
        #21
        for (i = 0; i < 10000; i = i + 1) begin
            #4 

            max_value = count[0];
            max_index = 0;
            for (j = 1; j < 16; j = j + 1) begin
                if (count[j] > max_value) begin
                    max_value = count[j];
                    max_index = j;
                end
            end
          
            if (max_index != oldest) begin
                $display("Error: mismatch");
                $stop;
            end
          

            access = ($random(seed) - 1) % 16;
            en = $random(seed) % 2;
            

            if (en == 1) begin
                for (j = 0; j < 16; j = j + 1)
                    count[j] = count[j] + 1;
                count[access] = 0;
                #8 begin end
            end
        end
        $display("PASS");
    end
endmodule