data/full_repos/permissive/197806087/blocked_matrix_multiplication/tb/tb.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Warning-STMTDLY: data/full_repos/permissive/197806087/blocked_matrix_multiplication/tb/tb.v:62: Unsupported: Ignoring delay on this delayed statement.\n            #5; clk = ~clk;\n            ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/197806087/blocked_matrix_multiplication/tb/tb.v:63: Unsupported: Ignoring delay on this delayed statement.\n            #5; clk = ~clk;\n            ^\n%Warning-STMTDLY: data/full_repos/permissive/197806087/blocked_matrix_multiplication/tb/tb.v:68: Unsupported: Ignoring delay on this delayed statement.\n        #12; rst = 0; #12; rst = 1;\n        ^\n%Warning-STMTDLY: data/full_repos/permissive/197806087/blocked_matrix_multiplication/tb/tb.v:68: Unsupported: Ignoring delay on this delayed statement.\n        #12; rst = 0; #12; rst = 1;\n                      ^\n%Error: data/full_repos/permissive/197806087/blocked_matrix_multiplication/tb/tb.v:74: Unsupported or unknown PLI call: $dumpfile\n        $dumpfile("data/dumpfile.vcd");\n        ^~~~~~~~~\n%Error: data/full_repos/permissive/197806087/blocked_matrix_multiplication/tb/tb.v:75: Unsupported or unknown PLI call: $dumpvars\n        $dumpvars(0, tb);\n        ^~~~~~~~~\n%Error: Exiting due to 2 error(s), 4 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module tb;

localparam DATA_WIDTH = 16;
localparam K = 21;
localparam M = 21;
localparam N = 21;

localparam K_BLOCK_SIZE = 3;
localparam M_BLOCK_SIZE = 3;
localparam N_BLOCK_SIZE = 1;

reg clk;
reg rst;

top #(
    .DATA_WIDTH(DATA_WIDTH),
    .K(K),
    .M(M),
    .N(N),
    .K_BLOCK_SIZE(K_BLOCK_SIZE),
    .M_BLOCK_SIZE(M_BLOCK_SIZE),
    .N_BLOCK_SIZE(N_BLOCK_SIZE)
) dut (
    .clk(clk),
    .rst(rst)
);

    integer itr_n, itr_m, itr_k;
    initial begin
        for(itr_m = 0; itr_m < M; itr_m = itr_m + 1) begin
            for(itr_n = 0; itr_n < N; itr_n = itr_n + 1) begin
                for(itr_k = 0; itr_k < K; itr_k = itr_k + 1) begin
                    dut.A[itr_m][itr_k] = itr_m * K + itr_k;
                    dut.B[itr_k][itr_n] = itr_k * N + itr_n;
                end
            end
        end

        $display("A:");
        for(itr_m = 0; itr_m < M; itr_m = itr_m + 1) begin
            for(itr_k = 0; itr_k < K; itr_k = itr_k + 1) begin
                $write("%d ",dut.A[itr_m][itr_k]);
            end
            $display("");
        end

        $display("B:");
        for(itr_k = 0; itr_k < K; itr_k = itr_k + 1) begin
            for(itr_n = 0; itr_n < N; itr_n = itr_n + 1) begin
                $write("%d ",dut.B[itr_k][itr_n]);
            end
            $display("");
        end
    end

    integer i;
    initial begin
        clk = 0;
        rst = 1;
        for(i = 0; i <= 1000; i = i+1) begin
            #5; clk = ~clk;
            #5; clk = ~clk;
        end
    end
    integer j;
    initial begin
        #12; rst = 0; #12; rst = 1;



    end
    initial begin
        $dumpfile("data/dumpfile.vcd");
        $dumpvars(0, tb);
    end

    integer x, y;
    always @(negedge dut.done_pipe) begin
        if(rst) begin

            $finish();
        end
    end

    final begin
            $display("Final results:");
            for(itr_m = 0; itr_m < M; itr_m = itr_m + 1) begin
                for(itr_n = 0; itr_n < N; itr_n = itr_n + 1) begin
                    $write("%d ",dut.result[(itr_m * N + itr_n) * 2 * DATA_WIDTH +: 2 * DATA_WIDTH]);
                end
                $display("");
            end
    end

endmodule
module tb;


localparam DATA_WIDTH = 16;
localparam K = 21;
localparam M = 21;
localparam N = 21;

localparam K_BLOCK_SIZE = 3;
localparam M_BLOCK_SIZE = 3;
localparam N_BLOCK_SIZE = 1;

reg clk;
reg rst;

top #(
    .DATA_WIDTH(DATA_WIDTH),
    .K(K),
    .M(M),
    .N(N),
    .K_BLOCK_SIZE(K_BLOCK_SIZE),
    .M_BLOCK_SIZE(M_BLOCK_SIZE),
    .N_BLOCK_SIZE(N_BLOCK_SIZE)
) dut (
    .clk(clk),
    .rst(rst)
);

    integer itr_n, itr_m, itr_k;
    initial begin
        for(itr_m = 0; itr_m < M; itr_m = itr_m + 1) begin
            for(itr_n = 0; itr_n < N; itr_n = itr_n + 1) begin
                for(itr_k = 0; itr_k < K; itr_k = itr_k + 1) begin
                    dut.A[itr_m][itr_k] = itr_m * K + itr_k;
                    dut.B[itr_k][itr_n] = itr_k * N + itr_n;
                end
            end
        end

        $display("A:");
        for(itr_m = 0; itr_m < M; itr_m = itr_m + 1) begin
            for(itr_k = 0; itr_k < K; itr_k = itr_k + 1) begin
                $write("%d ",dut.A[itr_m][itr_k]);
            end
            $display("");
        end

        $display("B:");
        for(itr_k = 0; itr_k < K; itr_k = itr_k + 1) begin
            for(itr_n = 0; itr_n < N; itr_n = itr_n + 1) begin
                $write("%d ",dut.B[itr_k][itr_n]);
            end
            $display("");
        end
    end

    integer i;
    initial begin
        clk = 0;
        rst = 1;
        for(i = 0; i <= 1000; i = i+1) begin
            #5; clk = ~clk;
            #5; clk = ~clk;
        end
    end
    integer j;
    initial begin
        #12; rst = 0; #12; rst = 1;



    end
    initial begin
        $dumpfile("data/dumpfile.vcd");
        $dumpvars(0, tb);
    end

    integer x, y;
    always @(negedge dut.done_pipe) begin
        if(rst) begin

            $finish();
        end
    end

    final begin
            $display("Final results:");
            for(itr_m = 0; itr_m < M; itr_m = itr_m + 1) begin
                for(itr_n = 0; itr_n < N; itr_n = itr_n + 1) begin
                    $write("%d ",dut.result[(itr_m * N + itr_n) * 2 * DATA_WIDTH +: 2 * DATA_WIDTH]);
                end
                $display("");
            end
    end

endmodule