data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv
1: b'%Warning-STMTDLY: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:10: Unsupported: Ignoring delay on this delayed statement.\n        forever #5 CLOCK_50 = ~CLOCK_50;\n                ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:17: Unsupported: Ignoring delay on this delayed statement.\n        #20;\n        ^\n%Warning-STMTDLY: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:32: Unsupported: Ignoring delay on this delayed statement.\n        #20;\n        ^\n%Warning-STMTDLY: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:42: Unsupported: Ignoring delay on this delayed statement.\n        #20;\n        ^\n%Warning-STMTDLY: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:54: Unsupported: Ignoring delay on this delayed statement.\n        #20;\n        ^\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:26: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n        if (tb_lab0.dut.sum !== 5\'b0) begin\n                        ^~~\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:27: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n            $display("ERROR: Expected sum is %b, actual sum is %b", 5\'b0, tb_lab0.dut.sum);\n                                                                                      ^~~\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:35: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n        if (tb_lab0.dut.sum !== 5\'b1) begin\n                        ^~~\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:36: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n            $display("ERROR: Expected sum is %b, actual sum is %b", 5\'b1, tb_lab0.dut.sum);\n                                                                                      ^~~\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:45: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n        if (tb_lab0.dut.sum !== 5\'b00011) begin\n                        ^~~\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:46: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n            $display("ERROR: Expected sum is %b, actual sum is %b", 5\'b00011, tb_lab0.dut.sum);\n                                                                                          ^~~\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:57: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n        if (tb_lab0.dut.sum !== 5\'b01011) begin\n                        ^~~\n%Error: data/full_repos/permissive/426864978/lab0/lab0/tb_lab0.sv:58: Can\'t find definition of \'sum\' in dotted variable: \'tb_lab0.dut.sum\'\n            $display("ERROR: Expected sum is %b, actual sum is %b", 5\'b01011, tb_lab0.dut.sum);\n                                                                                          ^~~\n%Error: Exiting due to 8 error(s), 5 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module tb_lab0();
    logic CLOCK_50, resetn, loadA, loadB, err;
    logic [3:0] valueA, valueB;
    logic [4:0] sum;

    lab0 dut(.*);

    initial begin
        CLOCK_50 = 0;
        forever #5 CLOCK_50 = ~CLOCK_50;
    end

    initial begin
        err = 1'b0;

        resetn <= 1'b0;
        #20;
        resetn <= 1'b1;

        valueA = 4'b0001;
        valueB = 4'b0010;
        loadA = 1'b0;
        loadB = 1'b0;


        if (tb_lab0.dut.sum !== 5'b0) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b0, tb_lab0.dut.sum);
            err = 1'b1;
        end

        loadA = 1'b1;
        #20;


        if (tb_lab0.dut.sum !== 5'b1) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b1, tb_lab0.dut.sum);
            err = 1'b1;
        end

        loadA = 1'b0;
        loadB = 1'b1;
        #20;


        if (tb_lab0.dut.sum !== 5'b00011) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b00011, tb_lab0.dut.sum);
            err = 1'b1;
        end

        valueA = 4'b0011;
        valueB = 4'b1000;
        loadA = 1'b1;
        loadB = 1'b1;
        #20;


        if (tb_lab0.dut.sum !== 5'b01011) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b01011, tb_lab0.dut.sum);
            err = 1'b1;
        end

        if (~err) begin
            $display("SUCCESS: All tests passed.");
        end
        $stop;

    end
endmodule
module tb_lab0();

    logic CLOCK_50, resetn, loadA, loadB, err;
    logic [3:0] valueA, valueB;
    logic [4:0] sum;

    lab0 dut(.*);

    initial begin
        CLOCK_50 = 0;
        forever #5 CLOCK_50 = ~CLOCK_50;
    end

    initial begin
        err = 1'b0;

        resetn <= 1'b0;
        #20;
        resetn <= 1'b1;

        valueA = 4'b0001;
        valueB = 4'b0010;
        loadA = 1'b0;
        loadB = 1'b0;


        if (tb_lab0.dut.sum !== 5'b0) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b0, tb_lab0.dut.sum);
            err = 1'b1;
        end

        loadA = 1'b1;
        #20;


        if (tb_lab0.dut.sum !== 5'b1) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b1, tb_lab0.dut.sum);
            err = 1'b1;
        end

        loadA = 1'b0;
        loadB = 1'b1;
        #20;


        if (tb_lab0.dut.sum !== 5'b00011) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b00011, tb_lab0.dut.sum);
            err = 1'b1;
        end

        valueA = 4'b0011;
        valueB = 4'b1000;
        loadA = 1'b1;
        loadB = 1'b1;
        #20;


        if (tb_lab0.dut.sum !== 5'b01011) begin
            $display("ERROR: Expected sum is %b, actual sum is %b", 5'b01011, tb_lab0.dut.sum);
            err = 1'b1;
        end

        if (~err) begin
            $display("SUCCESS: All tests passed.");
        end
        $stop;

    end
endmodule