data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv
1: b'%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:5: Cannot find include file: grading/cam_model.sv\n`include "grading/cam_model.sv" \n         ^~~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/444559342/mp1/cam/grading,data/full_repos/permissive/444559342/grading/cam_model.sv\n             data/full_repos/permissive/444559342/mp1/cam/grading,data/full_repos/permissive/444559342/grading/cam_model.sv.v\n             data/full_repos/permissive/444559342/mp1/cam/grading,data/full_repos/permissive/444559342/grading/cam_model.sv.sv\n             grading/cam_model.sv\n             grading/cam_model.sv.v\n             grading/cam_model.sv.sv\n             obj_dir/grading/cam_model.sv\n             obj_dir/grading/cam_model.sv.v\n             obj_dir/grading/cam_model.sv.sv\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:3: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING\nimport cam_types::*;\n       ^~~~~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:9: syntax error, unexpected \'=\', expecting \',\' or \';\'\nCAMModel model = new();\n               ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:11: syntax error, unexpected IDENTIFIER, expecting \')\'\ntask log_tr(trans_t tr);\n                    ^~\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:12: Unsupported: Static in this context\n    static trans_t last_tr = \'0;\n    ^~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:13: Unsupported: Static in this context\n    static int valid = 0;\n    ^~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:15: syntax error, unexpected \'=\', expecting IDENTIFIER\n        valid = 1;\n              ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:21: syntax error, unexpected \'.\', expecting IDENTIFIER\n            gitf.covers.ww_tag = 1\'b1;\n                       ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:25: syntax error, unexpected \'.\', expecting IDENTIFIER\n            gitf.covers.wr_tag = 1\'b1;\n                       ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:29: syntax error, unexpected \'=\', expecting IDENTIFIER\n    last_tr = tr;\n            ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:34: syntax error, unexpected \'.\', expecting IDENTIFIER\n        gitf.covers.hits[rs.index] = 1\'b1;\n                   ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:40: syntax error, unexpected \'.\', expecting IDENTIFIER\n        gitf.covers.evicts[ws.index] = 1\'b1;\n                   ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:48: syntax error, unexpected \'.\', expecting IDENTIFIER\n    gitf.transbox.get(tr);\n                 ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:53: syntax error, unexpected \'=\', expecting IDENTIFIER\n            ws = model.write(tr.key, tr.wdata);\n               ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:58: syntax error, unexpected \'=\', expecting IDENTIFIER\n            rs = model.read(tr.key);\n               ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:64: syntax error, unexpected \'(\', expecting IDENTIFIER\n                    gitf.grd_report_dut_error(READ_ERROR, itf.timestamp);\n                                              ^~~~~~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:69: syntax error, unexpected \'(\', expecting IDENTIFIER\n                    gitf.grd_report_dut_error(READ_ERROR, itf.timestamp);\n                                              ^~~~~~~~~~\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:72: syntax error, unexpected \'(\', expecting IDENTIFIER\n        TR_RESET: model.reset();\n                              ^\n%Error: data/full_repos/permissive/444559342/mp1/cam/grading/transaction_scoreboard.sv:77: syntax error, unexpected end\nend\n^~~\n%Error: Cannot continue\n'
module transaction_scoreboard(cam_itf itf, grader_itf gitf);

CAMModel model = new();

task log_tr(trans_t tr);
    static trans_t last_tr = '0;
    static int valid = 0;
    if (valid == 0) begin
        valid = 1;
    end
    else if ((last_tr.ltime + 1 == tr.ltime) &&
                                        last_tr.tr_type == TR_WRITE) begin
        if ((tr.tr_type == TR_WRITE) && (tr.key == last_tr.key)
            && (tr.wdata != last_tr.wdata)) begin
            gitf.covers.ww_tag = 1'b1;
            $display("%0t: SCB: HIT WW Coverage", $time);
        end
        if ((tr.tr_type == TR_READ) && (tr.key == last_tr.key)) begin
            gitf.covers.wr_tag = 1'b1;
            $display("%0t: SCB: HIT WR Coverage", $time);
        end
    end
    last_tr = tr;
endtask

task log_read(read_s rs);
    if (rs.valid) begin
        gitf.covers.hits[rs.index] = 1'b1;
    end
endtask

task log_write(write_s ws);
    if (ws.lru_evict) begin
        gitf.covers.evicts[ws.index] = 1'b1;
    end
endtask

initial forever begin
    trans_t tr;
    read_s rs;
    write_s ws;
    gitf.transbox.get(tr);
    $display("%0t: SCB: Received %s", $time, tr.tr_type.name);
    log_tr(tr);
    case (tr.tr_type)
        TR_WRITE: begin
            ws = model.write(tr.key, tr.wdata);

            log_write(ws);
        end
        TR_READ: begin
            rs = model.read(tr.key);

            log_read(rs);

            if (rs.valid) begin
                if ((!tr.valid_o)  || (tr.rdata != rs.value)) begin
                    gitf.grd_report_dut_error(READ_ERROR, itf.timestamp);
                end
            end
            if (!rs.valid) begin
                if (tr.valid_o)
                    gitf.grd_report_dut_error(READ_ERROR, itf.timestamp);
            end
        end
        TR_RESET: model.reset();
        default: begin
            $fatal("%0t SCB: Received Illegal Transaction Type");
        end
    endcase
end

endmodule
module transaction_scoreboard(cam_itf itf, grader_itf gitf);


CAMModel model = new();

task log_tr(trans_t tr);
    static trans_t last_tr = '0;
    static int valid = 0;
    if (valid == 0) begin
        valid = 1;
    end
    else if ((last_tr.ltime + 1 == tr.ltime) &&
                                        last_tr.tr_type == TR_WRITE) begin
        if ((tr.tr_type == TR_WRITE) && (tr.key == last_tr.key)
            && (tr.wdata != last_tr.wdata)) begin
            gitf.covers.ww_tag = 1'b1;
            $display("%0t: SCB: HIT WW Coverage", $time);
        end
        if ((tr.tr_type == TR_READ) && (tr.key == last_tr.key)) begin
            gitf.covers.wr_tag = 1'b1;
            $display("%0t: SCB: HIT WR Coverage", $time);
        end
    end
    last_tr = tr;
endtask

task log_read(read_s rs);
    if (rs.valid) begin
        gitf.covers.hits[rs.index] = 1'b1;
    end
endtask

task log_write(write_s ws);
    if (ws.lru_evict) begin
        gitf.covers.evicts[ws.index] = 1'b1;
    end
endtask

initial forever begin
    trans_t tr;
    read_s rs;
    write_s ws;
    gitf.transbox.get(tr);
    $display("%0t: SCB: Received %s", $time, tr.tr_type.name);
    log_tr(tr);
    case (tr.tr_type)
        TR_WRITE: begin
            ws = model.write(tr.key, tr.wdata);

            log_write(ws);
        end
        TR_READ: begin
            rs = model.read(tr.key);

            log_read(rs);

            if (rs.valid) begin
                if ((!tr.valid_o)  || (tr.rdata != rs.value)) begin
                    gitf.grd_report_dut_error(READ_ERROR, itf.timestamp);
                end
            end
            if (!rs.valid) begin
                if (tr.valid_o)
                    gitf.grd_report_dut_error(READ_ERROR, itf.timestamp);
            end
        end
        TR_RESET: model.reset();
        default: begin
            $fatal("%0t SCB: Received Illegal Transaction Type");
        end
    endcase
end

endmodule