data/full_repos/permissive/527249789/src/ctrl.v
1: b'%Error: data/full_repos/permissive/527249789/src/ctrl.v:1: Cannot find include file: defines.v\n`include "defines.v" \n         ^~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/527249789/src,data/full_repos/permissive/527249789/defines.v\n             data/full_repos/permissive/527249789/src,data/full_repos/permissive/527249789/defines.v.v\n             data/full_repos/permissive/527249789/src,data/full_repos/permissive/527249789/defines.v.sv\n             defines.v\n             defines.v.v\n             defines.v.sv\n             obj_dir/defines.v\n             obj_dir/defines.v.v\n             obj_dir/defines.v.sv\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:7: Define or directive not defined: \'`RegBus\'\n    input   [`RegBus]               exception_type_i,\n             ^~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:7: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n    input   [`RegBus]               exception_type_i,\n                    ^\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:8: Define or directive not defined: \'`RegBus\'\n    input   [`RegBus]               latest_cp0_reg_epc,\n             ^~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:9: Define or directive not defined: \'`RegBus\'\n    input   [`RegBus]               latest_cp0_reg_ebase,\n             ^~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:11: Define or directive not defined: \'`RegBus\'\n    output  reg[`RegBus]            epc,\n                ^~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:13: syntax error, unexpected output, expecting IDENTIFIER or \'=\' or do or final\n    output  reg[3:0]                stall\n    ^~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:14: syntax error, unexpected \')\', expecting \',\' or \';\'\n);\n^\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:21: Define or directive not defined: \'`RstEnable\'\n    if (resetn == `RstEnable) begin\n                  ^~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:23: Define or directive not defined: \'`FlushDisable\'\n        flush = `FlushDisable;\n                ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:24: Define or directive not defined: \'`ZeroWord\'\n        epc = `ZeroWord;\n              ^~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:25: Define or directive not defined: \'`ZeroWord\'\n    end else if (exception_type_i != `ZeroWord) begin\n                                     ^~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:27: Define or directive not defined: \'`FlushEnable\'\n        flush = `FlushEnable;\n                ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:29: Define or directive not defined: \'`EXECEPTION_INT\'\n            `EXECEPTION_INT, `EXECEPTION_ADEL, `EXECEPTION_ADES, `EXECEPTION_SYS,\n            ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:29: Define or directive not defined: \'`EXECEPTION_ADEL\'\n            `EXECEPTION_INT, `EXECEPTION_ADEL, `EXECEPTION_ADES, `EXECEPTION_SYS,\n                             ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:29: Define or directive not defined: \'`EXECEPTION_ADES\'\n            `EXECEPTION_INT, `EXECEPTION_ADEL, `EXECEPTION_ADES, `EXECEPTION_SYS,\n                                               ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:29: Define or directive not defined: \'`EXECEPTION_SYS\'\n            `EXECEPTION_INT, `EXECEPTION_ADEL, `EXECEPTION_ADES, `EXECEPTION_SYS,\n                                                                 ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:30: Define or directive not defined: \'`EXECEPTION_BREAK\'\n            `EXECEPTION_BREAK, `EXECEPTION_INSTVALID, `EXECEPTION_OV: epc = latest_cp0_reg_ebase;\n            ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:30: Define or directive not defined: \'`EXECEPTION_INSTVALID\'\n            `EXECEPTION_BREAK, `EXECEPTION_INSTVALID, `EXECEPTION_OV: epc = latest_cp0_reg_ebase;\n                               ^~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:30: Define or directive not defined: \'`EXECEPTION_OV\'\n            `EXECEPTION_BREAK, `EXECEPTION_INSTVALID, `EXECEPTION_OV: epc = latest_cp0_reg_ebase;\n                                                      ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:31: Define or directive not defined: \'`EXECEPTION_ERET\'\n            `EXECEPTION_ERET: epc = latest_cp0_reg_epc;\n            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:32: Define or directive not defined: \'`ZeroWord\'\n            default: epc = `ZeroWord;\n                           ^~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:34: Define or directive not defined: \'`Stop\'\n    end else if (stall_req_from_ex == `Stop) begin\n                                      ^~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:36: Define or directive not defined: \'`FlushDisable\'\n        flush = `FlushDisable;\n                ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:37: Define or directive not defined: \'`ZeroWord\'\n        epc = `ZeroWord;\n              ^~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:38: Define or directive not defined: \'`Stop\'\n    end else if (stall_req_from_id == `Stop) begin\n                                      ^~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:40: Define or directive not defined: \'`FlushDisable\'\n        flush = `FlushDisable;\n                ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:41: Define or directive not defined: \'`ZeroWord\'\n        epc = `ZeroWord;\n              ^~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:44: Define or directive not defined: \'`FlushDisable\'\n        flush = `FlushDisable;\n                ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/527249789/src/ctrl.v:45: Define or directive not defined: \'`ZeroWord\'\n        epc = `ZeroWord;\n              ^~~~~~~~~\n%Error: Exiting due to 30 error(s)\n'
module ctrl(
    input                           resetn,
    input                           stall_req_from_ex,
    input                           stall_req_from_id,
    input   [`RegBus]               exception_type_i,
    input   [`RegBus]               latest_cp0_reg_epc,
    input   [`RegBus]               latest_cp0_reg_ebase,

    output  reg[`RegBus]            epc,
    output  reg                     flush,
    output  reg[3:0]                stall
);





always @(*) begin
    if (resetn == `RstEnable) begin
        stall = 4'b0000;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end else if (exception_type_i != `ZeroWord) begin
        stall = 4'b0000;
        flush = `FlushEnable;
        case (exception_type_i)
            `EXECEPTION_INT, `EXECEPTION_ADEL, `EXECEPTION_ADES, `EXECEPTION_SYS,
            `EXECEPTION_BREAK, `EXECEPTION_INSTVALID, `EXECEPTION_OV: epc = latest_cp0_reg_ebase;
            `EXECEPTION_ERET: epc = latest_cp0_reg_epc;
            default: epc = `ZeroWord;
        endcase
    end else if (stall_req_from_ex == `Stop) begin
        stall = 4'b0111;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end else if (stall_req_from_id == `Stop) begin
        stall = 4'b0011;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end else begin
        stall = 4'b0000;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end
end

endmodule
module ctrl(
    input                           resetn,
    input                           stall_req_from_ex,
    input                           stall_req_from_id,
    input   [`RegBus]               exception_type_i,
    input   [`RegBus]               latest_cp0_reg_epc,
    input   [`RegBus]               latest_cp0_reg_ebase,

    output  reg[`RegBus]            epc,
    output  reg                     flush,
    output  reg[3:0]                stall
);






always @(*) begin
    if (resetn == `RstEnable) begin
        stall = 4'b0000;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end else if (exception_type_i != `ZeroWord) begin
        stall = 4'b0000;
        flush = `FlushEnable;
        case (exception_type_i)
            `EXECEPTION_INT, `EXECEPTION_ADEL, `EXECEPTION_ADES, `EXECEPTION_SYS,
            `EXECEPTION_BREAK, `EXECEPTION_INSTVALID, `EXECEPTION_OV: epc = latest_cp0_reg_ebase;
            `EXECEPTION_ERET: epc = latest_cp0_reg_epc;
            default: epc = `ZeroWord;
        endcase
    end else if (stall_req_from_ex == `Stop) begin
        stall = 4'b0111;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end else if (stall_req_from_id == `Stop) begin
        stall = 4'b0011;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end else begin
        stall = 4'b0000;
        flush = `FlushDisable;
        epc = `ZeroWord;
    end
end

endmodule