data/full_repos/permissive/429737743/sources_1/new/ID.v
1: b'%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:21: Cannot find include file: cpu_constant.v\n`include "cpu_constant.v" \n         ^~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/429737743/sources_1/new,data/full_repos/permissive/429737743/cpu_constant.v\n             data/full_repos/permissive/429737743/sources_1/new,data/full_repos/permissive/429737743/cpu_constant.v.v\n             data/full_repos/permissive/429737743/sources_1/new,data/full_repos/permissive/429737743/cpu_constant.v.sv\n             cpu_constant.v\n             cpu_constant.v.v\n             cpu_constant.v.sv\n             obj_dir/cpu_constant.v\n             obj_dir/cpu_constant.v.v\n             obj_dir/cpu_constant.v.sv\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:36: Define or directive not defined: \'`RType\'\n                `RType : begin\n                ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:36: syntax error, unexpected \':\', expecting endcase\n                `RType : begin\n                       ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:41: Define or directive not defined: \'`add_\'\n                        {3\'b000, 7\'b0000000} : iout = `add_;\n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:41: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b000, 7\'b0000000} : iout = `add_;\n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:42: Define or directive not defined: \'`sub_\'\n                        {3\'b000, 7\'b0100000} : iout = `sub_;\n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:42: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b000, 7\'b0100000} : iout = `sub_;\n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:43: Define or directive not defined: \'`xor_\'\n                        {3\'b100, 7\'b0000000} : iout = `xor_;\n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:43: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b100, 7\'b0000000} : iout = `xor_;\n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:44: Define or directive not defined: \'`or_\'\n                        {3\'b110, 7\'b0000000} : iout = `or_;\n                                                      ^~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:44: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b110, 7\'b0000000} : iout = `or_;\n                                                          ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:45: Define or directive not defined: \'`and_\'\n                        {3\'b111, 7\'b0000000} : iout = `and_;\n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:45: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b111, 7\'b0000000} : iout = `and_;\n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:46: Define or directive not defined: \'`sll_\'\n                        {3\'b001, 7\'b0000000} : iout = `sll_;\n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:46: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b001, 7\'b0000000} : iout = `sll_;\n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:47: Define or directive not defined: \'`srl_\'\n                        {3\'b101, 7\'b0000000} : iout = `srl_;  \n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:47: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b101, 7\'b0000000} : iout = `srl_;  \n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:48: Define or directive not defined: \'`sra_\'\n                        {3\'b101, 7\'b0100000} : iout = `sra_;  \n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:48: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b101, 7\'b0100000} : iout = `sra_;  \n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:49: Define or directive not defined: \'`slt_\'\n                        {3\'b010, 7\'b0000000} : iout = `slt_;\n                                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:49: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b010, 7\'b0000000} : iout = `slt_;\n                                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:50: Define or directive not defined: \'`sltu_\'\n                        {3\'b011, 7\'b0000000} : iout = `sltu_;\n                                                      ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:50: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        {3\'b011, 7\'b0000000} : iout = `sltu_;\n                                                            ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:51: Define or directive not defined: \'`NULL_\'\n                        default : iout = `NULL_;\n                                         ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:51: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        default : iout = `NULL_;\n                                               ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:54: Define or directive not defined: \'`IType\'\n                `IType : begin\n                ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:54: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n                `IType : begin\n                         ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:60: Define or directive not defined: \'`addi_\'\n                        4\'h0 : iout = `addi_;\n                                      ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:60: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        4\'h0 : iout = `addi_;\n                                            ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:61: Define or directive not defined: \'`xori_\'\n                        4\'h4 : iout = `xori_;\n                                      ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:61: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        4\'h4 : iout = `xori_;\n                                            ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:62: Define or directive not defined: \'`ori_\'\n                        4\'h6 : iout = `ori_;\n                                      ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:62: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        4\'h6 : iout = `ori_;\n                                           ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:63: Define or directive not defined: \'`andi_\'\n                                                                  : ... Suggested alternative: \'`endif\'\n                        4\'h7 : iout = `andi_;\n                                      ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:63: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        4\'h7 : iout = `andi_;\n                                            ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:65: Define or directive not defined: \'`slli_\'\n                            iout = `slli_;\n                                   ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:65: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                            iout = `slli_;\n                                         ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:69: Define or directive not defined: \'`srli_\'\n                            iout = `srli_;  \n                                   ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:69: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                            iout = `srli_;  \n                                         ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:73: Define or directive not defined: \'`slti_\'\n                            iout = `slti_;\n                                   ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:73: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                            iout = `slti_;\n                                         ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:76: Define or directive not defined: \'`sltiu_\'\n                            iout = `sltiu_;\n                                   ^~~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:76: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                            iout = `sltiu_;\n                                          ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:78: Define or directive not defined: \'`NULL_\'\n                        default : iout = `NULL_;\n                                         ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:78: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        default : iout = `NULL_;\n                                               ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:81: Define or directive not defined: \'`LType\'\n                `LType : begin\n                ^~~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:81: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n                `LType : begin\n                         ^~~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:87: Define or directive not defined: \'`lb_\'\n                        4\'h0 : iout = `lb_;\n                                      ^~~~\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:87: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n                        4\'h0 : iout = `lb_;\n                                          ^\n%Error: data/full_repos/permissive/429737743/sources_1/new/ID.v:88: Define or directive not defined: \'`lh_\'\n                        4\'h1 : iout = `lh_;\n                                      ^~~~\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module ID(Imm, rs2, rs1, rd, iout, op,
    ins, enable
);
    output [6 : 0] iout;reg [6 : 0] iout;
    output [4 : 0] rd, rs1, rs2;reg [4 : 0] rd, rs1, rs2;
    output [19 : 0] Imm;reg [19 : 0] Imm;
    output [6 : 0] op; reg [6 : 0] op;
    input [31 : 0] ins;
    input enable;
    always@(*) begin
        if (enable) begin
            op = ins[6 : 0];
            case (ins[6 : 0])
                `RType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = ins[24 : 20];
                    case ({ins[14 : 12], ins[31 : 25]})
                        {3'b000, 7'b0000000} : iout = `add_;
                        {3'b000, 7'b0100000} : iout = `sub_;
                        {3'b100, 7'b0000000} : iout = `xor_;
                        {3'b110, 7'b0000000} : iout = `or_;
                        {3'b111, 7'b0000000} : iout = `and_;
                        {3'b001, 7'b0000000} : iout = `sll_;
                        {3'b101, 7'b0000000} : iout = `srl_;
                        {3'b101, 7'b0100000} : iout = `sra_;
                        {3'b010, 7'b0000000} : iout = `slt_;
                        {3'b011, 7'b0000000} : iout = `sltu_;
                        default : iout = `NULL_;
                    endcase
                end
                `IType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = 0;
                    Imm = {8'h00, ins[31 : 20]};
                    case (ins[14 : 12])
                        4'h0 : iout = `addi_;
                        4'h4 : iout = `xori_;
                        4'h6 : iout = `ori_;
                        4'h7 : iout = `andi_;
                        4'h1 : begin
                            iout = `slli_;
                            Imm = {15'h0, ins[24 : 20]};
                        end
                        4'h5 : begin
                            iout = `srli_;
                            Imm = {15'h0, ins[24 : 20]};
                        end
                        4'h2 : begin
                            iout = `slti_;
                        end
                        4'h3 : begin
                            iout = `sltiu_;
                        end
                        default : iout = `NULL_;
                    endcase
                end
                `LType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = 0;
                    Imm = {8'h00, ins[31 : 20]};
                    case (ins[14 : 12])
                        4'h0 : iout = `lb_;
                        4'h1 : iout = `lh_;
                        4'h2 : iout = `lw_;
                        4'h4 : iout = `lbu_;
                        4'h5 : iout = `lhu_;
                        default: iout = `NULL_;
                    endcase
                end
                `SType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = ins[24 : 20];
                    Imm = {8'h00, ins[31 : 25], ins[11 : 7]};
                    case (ins[14 : 12])
                        4'h0 : iout = `sb_;
                        4'h1 : iout = `sh_;
                        4'h2 : iout = `sw_;
                        default: iout = `NULL_;
                    endcase
                end
                `BType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = ins[24 : 20];
                    Imm = {8'h00, ins[31 : 31], ins[7 : 7], ins[30 : 25], ins[11 : 8]};
                    case (ins[14 : 12])
                        4'h0 : iout = `beq_;
                        4'h1 : iout = `bne_;
                        4'h4 : iout = `blt_;
                        4'h5 : iout = `bge_;
                        4'h6 : iout = `bltu_;
                        4'h7 : iout = `bgeu_;
                        default: iout = `NULL_;
                    endcase
                end
                `jalType : begin
                    iout = `jal_;
                    rd = ins[11 : 7];
                    Imm = {ins[31 : 31], ins[21 : 12], ins[22 : 22], ins[30 : 23]};
                end
                `jalrType : begin
                    iout = `jalr_;
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    Imm = {{8{ins[31 : 31]}}, ins[31 : 20]};
                end
                `luiType : begin
                    iout = `lui_;
                    rd = ins[11 : 7];
                    Imm = ins[31 : 24];
                end
                `auipcType: begin
                    iout = `auipc_;
                    rd = ins[11 : 7];
                    Imm = ins[31 : 24];
                end
                `ecall_ : ;
                `ebreak_ : ;
                default : iout = -1;
            endcase
        end
    end
endmodule
module ID(Imm, rs2, rs1, rd, iout, op,
    ins, enable
);

    output [6 : 0] iout;reg [6 : 0] iout;
    output [4 : 0] rd, rs1, rs2;reg [4 : 0] rd, rs1, rs2;
    output [19 : 0] Imm;reg [19 : 0] Imm;
    output [6 : 0] op; reg [6 : 0] op;
    input [31 : 0] ins;
    input enable;
    always@(*) begin
        if (enable) begin
            op = ins[6 : 0];
            case (ins[6 : 0])
                `RType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = ins[24 : 20];
                    case ({ins[14 : 12], ins[31 : 25]})
                        {3'b000, 7'b0000000} : iout = `add_;
                        {3'b000, 7'b0100000} : iout = `sub_;
                        {3'b100, 7'b0000000} : iout = `xor_;
                        {3'b110, 7'b0000000} : iout = `or_;
                        {3'b111, 7'b0000000} : iout = `and_;
                        {3'b001, 7'b0000000} : iout = `sll_;
                        {3'b101, 7'b0000000} : iout = `srl_;
                        {3'b101, 7'b0100000} : iout = `sra_;
                        {3'b010, 7'b0000000} : iout = `slt_;
                        {3'b011, 7'b0000000} : iout = `sltu_;
                        default : iout = `NULL_;
                    endcase
                end
                `IType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = 0;
                    Imm = {8'h00, ins[31 : 20]};
                    case (ins[14 : 12])
                        4'h0 : iout = `addi_;
                        4'h4 : iout = `xori_;
                        4'h6 : iout = `ori_;
                        4'h7 : iout = `andi_;
                        4'h1 : begin
                            iout = `slli_;
                            Imm = {15'h0, ins[24 : 20]};
                        end
                        4'h5 : begin
                            iout = `srli_;
                            Imm = {15'h0, ins[24 : 20]};
                        end
                        4'h2 : begin
                            iout = `slti_;
                        end
                        4'h3 : begin
                            iout = `sltiu_;
                        end
                        default : iout = `NULL_;
                    endcase
                end
                `LType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = 0;
                    Imm = {8'h00, ins[31 : 20]};
                    case (ins[14 : 12])
                        4'h0 : iout = `lb_;
                        4'h1 : iout = `lh_;
                        4'h2 : iout = `lw_;
                        4'h4 : iout = `lbu_;
                        4'h5 : iout = `lhu_;
                        default: iout = `NULL_;
                    endcase
                end
                `SType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = ins[24 : 20];
                    Imm = {8'h00, ins[31 : 25], ins[11 : 7]};
                    case (ins[14 : 12])
                        4'h0 : iout = `sb_;
                        4'h1 : iout = `sh_;
                        4'h2 : iout = `sw_;
                        default: iout = `NULL_;
                    endcase
                end
                `BType : begin
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    rs2 = ins[24 : 20];
                    Imm = {8'h00, ins[31 : 31], ins[7 : 7], ins[30 : 25], ins[11 : 8]};
                    case (ins[14 : 12])
                        4'h0 : iout = `beq_;
                        4'h1 : iout = `bne_;
                        4'h4 : iout = `blt_;
                        4'h5 : iout = `bge_;
                        4'h6 : iout = `bltu_;
                        4'h7 : iout = `bgeu_;
                        default: iout = `NULL_;
                    endcase
                end
                `jalType : begin
                    iout = `jal_;
                    rd = ins[11 : 7];
                    Imm = {ins[31 : 31], ins[21 : 12], ins[22 : 22], ins[30 : 23]};
                end
                `jalrType : begin
                    iout = `jalr_;
                    rd = ins[11 : 7];
                    rs1 = ins[19 : 15];
                    Imm = {{8{ins[31 : 31]}}, ins[31 : 20]};
                end
                `luiType : begin
                    iout = `lui_;
                    rd = ins[11 : 7];
                    Imm = ins[31 : 24];
                end
                `auipcType: begin
                    iout = `auipc_;
                    rd = ins[11 : 7];
                    Imm = ins[31 : 24];
                end
                `ecall_ : ;
                `ebreak_ : ;
                default : iout = -1;
            endcase
        end
    end
endmodule