data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv
1: b'%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:3: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING\nimport mult_types::*;\n       ^~~~~~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:8: syntax error, unexpected \'@\', expecting \';\'\ndefault clocking scb_clk @(negedge itf.scbclk); endclocking\n                         ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:11: syntax error, unexpected \'=\', expecting \',\' or \';\'\n    error_e error = NOT_READY;\n                  ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:13: syntax error, unexpected \'.\', expecting IDENTIFIER\n    itf.grader_errors.nr[itf.timestamp] = 1\'b1;\n                     ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:17: syntax error, unexpected \'=\', expecting \',\' or \';\'\n    error_e error = BAD_PRODUCT;\n                  ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:21: syntax error, unexpected \'.\', expecting IDENTIFIER\n    itf.grader_errors.bp[itf.timestamp] = 1\'b1;\n                     ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:26: syntax error, unexpected ::, expecting \',\' or \':\'\n        mult_types::ADD: itf.covers.reset_add = 1\'b1; \n                  ^~\n                                                                                                : ... Perhaps \'mult_types\' is a package which needs to be predeclared? (IEEE 1800-2017 26.3)\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:33: syntax error, unexpected \'=\', expecting IDENTIFIER\n            itf.grader_errno = ILLEGAL_STATE;\n                             ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:42: syntax error, unexpected ::, expecting \',\' or \':\'\n        mult_types::ADD: itf.covers.start_add = 1\'b1; \n                  ^~\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:49: syntax error, unexpected \'=\', expecting IDENTIFIER\n            itf.grader_errno = ILLEGAL_STATE;\n                             ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:57: syntax error, unexpected IDENTIFIER, expecting TYPE-IDENTIFIER\n    automatic trans_t tr;\n              ^~~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:59: Unsupported: fork statements\n    fork  \n    ^~~~\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:73: syntax error, unexpected \'@\'\n                @(scb_clk);\n                ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:87: Unsupported: fork statements\n                    fork : mult_fork\n                    ^~~~\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:90: syntax error, unexpected \'@\'\n                            @(scb_clk iff mitf.done);\n                            ^\n%Error: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:103: syntax error, unexpected \'@\'\n                            @(scb_clk iff !mitf.reset_n && !mitf.done);\n                            ^\n%Warning-STMTDLY: data/full_repos/permissive/444559342/mp1/multiplier/grading/transaction_scoreboard.sv:108: Unsupported: Ignoring delay on this delayed statement.\n                            #2000;\n                            ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: Exiting due to 16 error(s), 1 warning(s)\n'
module transaction_scoreboard(grader_itf itf, multiplier_itf mitf);

default clocking scb_clk @(negedge itf.scbclk); endclocking

task automatic nr_error;
    error_e error = NOT_READY;
    $info("SCB: Detected %s error at time %0t", error.name, $time);
    itf.grader_errors.nr[itf.timestamp] = 1'b1;
endtask

task automatic prod_error(trans_t tr);
    error_e error = BAD_PRODUCT;
    $info("SCB: Detected %s error at time%0t", error.name, $time);
    $info("SCB: %0d != %0d * %0d", mitf.product, tr.op1, tr.op2);
    $info("SCB: tr timestamp: %0t cur timesamp: %0t", tr.tr_time, itf.timestamp);
    itf.grader_errors.bp[itf.timestamp] = 1'b1;
endtask

function automatic void handle_reset_coverage(op_e op);
    case (op)
        mult_types::ADD: itf.covers.reset_add = 1'b1; 
        mult_types::SHIFT: itf.covers.reset_shift = 1'b1;
        mult_types::DONE, 
        mult_types::NONE: ;
        default: begin
            $error("%s %0d: Handling reset coverage from unkown operation",
                    `__FILE__, `__LINE__);
            itf.grader_errno = ILLEGAL_STATE;
            $finish;
        end
    endcase
    $display("SCB: Multiplier in state %s", op.name);
endfunction

function automatic void handle_start_coverage(op_e op);
    case (op)
        mult_types::ADD: itf.covers.start_add = 1'b1; 
        mult_types::SHIFT: itf.covers.start_shift = 1'b1;
        mult_types::DONE, 
        mult_types::NONE: ;
        default: begin
            $error("%s %0d: Handling reset coverage from unkown operation",
                    `__FILE__, `__LINE__);
            itf.grader_errno = ILLEGAL_STATE;
            $finish;
        end
    endcase
endfunction

semaphore mult_lock = new(1);
initial forever begin
    automatic trans_t tr;
    itf.transbox.get(tr);
    fork
        case (tr.tr_type)
            RESET: begin


                $display("SCB: Received reset at time %0t", $time);
                handle_reset_coverage(mitf.mult_op);
                assert(tr.tr_time == itf.timestamp) else begin
                    $error("%s %0d: RESET at timestamp %0t not handled until timestamp %0t",
                            `__FILE__, `__LINE__, tr.tr_time, itf.timestamp);
                    itf.grader_errno = TIME_DESYNC;
                    $finish;
                end

                @(scb_clk);
                if (!mitf.rdy) begin
                    $display("%1b", mitf.rdy);
                    nr_error();
                end
            end
            MULT_START: begin
                if (!mult_lock.try_get()) begin


                    $display("SCB: %0t: Detected inflight start", $time);
                    handle_start_coverage(mitf.mult_op);
                end
                else begin
                    fork : mult_fork
                        $display("SCB: Received MULT_START at time %0t", $time);
                        begin
                            @(scb_clk iff mitf.done);

                            if (mitf.product != tr.op1 * tr.op2) begin
                                prod_error(tr);
                            end

                            itf.covers.mults[tr.op1][tr.op2] = 1'b1;



                            disable mult_fork;
                        end
                        begin
                            @(scb_clk iff !mitf.reset_n && !mitf.done);
                            $display("SCB: MULT Reset at time %0t", $time);
                            disable mult_fork;
                        end
                        begin
                            #2000;
                            $display("SCB: MULT T/O at time %0t", $time);
                            disable mult_fork;
                        end
                    join
                    mult_lock.put();
                end
            end
            default: begin
                $error("%s %d: Illegal transaction recorded",
                        `__FILE__, `__LINE__);
                itf.grader_errno = ILLEGAL_TRANSACTION;
                $finish;
            end
        endcase
    join_none
end

endmodule
module transaction_scoreboard(grader_itf itf, multiplier_itf mitf);


default clocking scb_clk @(negedge itf.scbclk); endclocking

task automatic nr_error;
    error_e error = NOT_READY;
    $info("SCB: Detected %s error at time %0t", error.name, $time);
    itf.grader_errors.nr[itf.timestamp] = 1'b1;
endtask

task automatic prod_error(trans_t tr);
    error_e error = BAD_PRODUCT;
    $info("SCB: Detected %s error at time%0t", error.name, $time);
    $info("SCB: %0d != %0d * %0d", mitf.product, tr.op1, tr.op2);
    $info("SCB: tr timestamp: %0t cur timesamp: %0t", tr.tr_time, itf.timestamp);
    itf.grader_errors.bp[itf.timestamp] = 1'b1;
endtask

function automatic void handle_reset_coverage(op_e op);
    case (op)
        mult_types::ADD: itf.covers.reset_add = 1'b1; 
        mult_types::SHIFT: itf.covers.reset_shift = 1'b1;
        mult_types::DONE, 
        mult_types::NONE: ;
        default: begin
            $error("%s %0d: Handling reset coverage from unkown operation",
                    `__FILE__, `__LINE__);
            itf.grader_errno = ILLEGAL_STATE;
            $finish;
        end
    endcase
    $display("SCB: Multiplier in state %s", op.name);
endfunction

function automatic void handle_start_coverage(op_e op);
    case (op)
        mult_types::ADD: itf.covers.start_add = 1'b1; 
        mult_types::SHIFT: itf.covers.start_shift = 1'b1;
        mult_types::DONE, 
        mult_types::NONE: ;
        default: begin
            $error("%s %0d: Handling reset coverage from unkown operation",
                    `__FILE__, `__LINE__);
            itf.grader_errno = ILLEGAL_STATE;
            $finish;
        end
    endcase
endfunction

semaphore mult_lock = new(1);
initial forever begin
    automatic trans_t tr;
    itf.transbox.get(tr);
    fork
        case (tr.tr_type)
            RESET: begin


                $display("SCB: Received reset at time %0t", $time);
                handle_reset_coverage(mitf.mult_op);
                assert(tr.tr_time == itf.timestamp) else begin
                    $error("%s %0d: RESET at timestamp %0t not handled until timestamp %0t",
                            `__FILE__, `__LINE__, tr.tr_time, itf.timestamp);
                    itf.grader_errno = TIME_DESYNC;
                    $finish;
                end

                @(scb_clk);
                if (!mitf.rdy) begin
                    $display("%1b", mitf.rdy);
                    nr_error();
                end
            end
            MULT_START: begin
                if (!mult_lock.try_get()) begin


                    $display("SCB: %0t: Detected inflight start", $time);
                    handle_start_coverage(mitf.mult_op);
                end
                else begin
                    fork : mult_fork
                        $display("SCB: Received MULT_START at time %0t", $time);
                        begin
                            @(scb_clk iff mitf.done);

                            if (mitf.product != tr.op1 * tr.op2) begin
                                prod_error(tr);
                            end

                            itf.covers.mults[tr.op1][tr.op2] = 1'b1;



                            disable mult_fork;
                        end
                        begin
                            @(scb_clk iff !mitf.reset_n && !mitf.done);
                            $display("SCB: MULT Reset at time %0t", $time);
                            disable mult_fork;
                        end
                        begin
                            #2000;
                            $display("SCB: MULT T/O at time %0t", $time);
                            disable mult_fork;
                        end
                    join
                    mult_lock.put();
                end
            end
            default: begin
                $error("%s %d: Illegal transaction recorded",
                        `__FILE__, `__LINE__);
                itf.grader_errno = ILLEGAL_TRANSACTION;
                $finish;
            end
        endcase
    join_none
end

endmodule