data/full_repos/permissive/216615048/src/compressed.v
1: b'%Error: data/full_repos/permissive/216615048/src/compressed.v:2: Cannot find include file: defines.v\n`include "defines.v" \n         ^~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/216615048/src,data/full_repos/permissive/216615048/defines.v\n             data/full_repos/permissive/216615048/src,data/full_repos/permissive/216615048/defines.v.v\n             data/full_repos/permissive/216615048/src,data/full_repos/permissive/216615048/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/216615048/src/compressed.v:5: Define or directive not defined: \'`IR_funct3\'\n    out[`IR_funct3] = in[15:13];\n        ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:5: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n    out[`IR_funct3] = in[15:13];\n                  ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:9: Define or directive not defined: \'`IR_rs1\'\n            out[`IR_rs1] = in[9:7] + 4\'b1000;\n                ^~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:9: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n            out[`IR_rs1] = in[9:7] + 4\'b1000;\n                       ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:12: Define or directive not defined: \'`IR_funct3\'\n                        out[`IR_funct3] = 3\'b010;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:12: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_funct3] = 3\'b010;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:13: Define or directive not defined: \'`IR_rd\'\n                        out[`IR_rd] = in[4:2] + 4\'b1000;\n                            ^~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:13: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_rd] = in[4:2] + 4\'b1000;\n                                  ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:14: Define or directive not defined: \'`IR_opcode\'\n                        out[`IR_opcode] = `OPCODE_Load;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:14: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_opcode] = `OPCODE_Load;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:14: Define or directive not defined: \'`OPCODE_Load\'\n                        out[`IR_opcode] = `OPCODE_Load;\n                                          ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:15: Define or directive not defined: \'`IR_csr\'\n                        out[`IR_csr] = {in[5], in[12:10], in[6], 2\'b00};\n                            ^~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:15: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_csr] = {in[5], in[12:10], in[6], 2\'b00};\n                                   ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:18: Define or directive not defined: \'`IR_funct3\'\n                        out[`IR_funct3] = 3\'b010;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:18: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_funct3] = 3\'b010;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:19: Define or directive not defined: \'`IR_rs2\'\n                        out[`IR_rs2] = in[4:2] + 4\'b1000;\n                            ^~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:19: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_rs2] = in[4:2] + 4\'b1000;\n                                   ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:20: Define or directive not defined: \'`IR_opcode\'\n                        out[`IR_opcode] = `OPCODE_Store;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:20: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_opcode] = `OPCODE_Store;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:20: Define or directive not defined: \'`OPCODE_Store\'\n                        out[`IR_opcode] = `OPCODE_Store;\n                                          ^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:21: Define or directive not defined: \'`IR_funct7\'\n                        out[`IR_funct7] = in[12];\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:21: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_funct7] = in[12];\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:22: Define or directive not defined: \'`IR_rd\'\n                        out[`IR_rd] = {in[11:10], in[6], 2\'b00};\n                            ^~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:22: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_rd] = {in[11:10], in[6], 2\'b00};\n                                  ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:30: Define or directive not defined: \'`IR_funct3\'\n                        out[`IR_funct3] = 3\'b000;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:30: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_funct3] = 3\'b000;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:31: Define or directive not defined: \'`IR_csr\'\n                        out[`IR_csr] = $signed({in[12], in[6:2]});\n                            ^~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:31: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_csr] = $signed({in[12], in[6:2]});\n                                   ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:32: Define or directive not defined: \'`IR_opcode\'\n                        out[`IR_opcode] = `OPCODE_Arith_I;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:32: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_opcode] = `OPCODE_Arith_I;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:32: Define or directive not defined: \'`OPCODE_Arith_I\'\n                        out[`IR_opcode] = `OPCODE_Arith_I;\n                                          ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:33: Define or directive not defined: \'`IR_rd\'\n                        out[`IR_rd] = in[11:7];\n                            ^~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:33: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_rd] = in[11:7];\n                                  ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:34: Define or directive not defined: \'`IR_rs1\'\n                        out[`IR_rs1] = in[11:7];\n                            ^~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:34: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_rs1] = in[11:7];\n                                   ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:39: Define or directive not defined: \'`IR_rs1\'\n                        out[`IR_rs1] = 5\'b0;\n                            ^~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:39: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_rs1] = 5\'b0;\n                                   ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:40: Define or directive not defined: \'`IR_opcode\'\n                        out[`IR_opcode] = `OPCODE_JAL;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:40: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_opcode] = `OPCODE_JAL;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:40: Define or directive not defined: \'`OPCODE_JAL\'\n                        out[`IR_opcode] = `OPCODE_JAL;\n                                          ^~~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:44: Define or directive not defined: \'`IR_rd\'\n                        out[`IR_rd] = {in[11:7]};\n                            ^~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:44: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_rd] = {in[11:7]};\n                                  ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:45: Define or directive not defined: \'`IR_opcode\'\n                        out[`IR_opcode] = `OPCODE_LUI;\n                            ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:45: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                        out[`IR_opcode] = `OPCODE_LUI;\n                                      ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:45: Define or directive not defined: \'`OPCODE_LUI\'\n                        out[`IR_opcode] = `OPCODE_LUI;\n                                          ^~~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:50: Define or directive not defined: \'`IR_funct3\'\n                                    out[`IR_funct3] = 3\'b101;\n                                        ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:50: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                                    out[`IR_funct3] = 3\'b101;\n                                                  ^\n%Error: data/full_repos/permissive/216615048/src/compressed.v:51: Define or directive not defined: \'`IR_funct7\'\n                                    out[`IR_funct7] = 7\'b0000000;\n                                        ^~~~~~~~~~\n%Error: data/full_repos/permissive/216615048/src/compressed.v:51: syntax error, unexpected \']\', expecting TYPE-IDENTIFIER\n                                    out[`IR_funct7] = 7\'b0000000;\n                                                  ^\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module compressed (input [15:0]in, output reg [31:0]out);
always @(*) begin
    out[`IR_funct3] = in[15:13];
    out[1:0] = 2'b11;
    case (in[1:0])
        2'b00: begin
            out[`IR_rs1] = in[9:7] + 4'b1000;
            case (in[15:13])
                3'b010: begin
                        out[`IR_funct3] = 3'b010;
                        out[`IR_rd] = in[4:2] + 4'b1000;
                        out[`IR_opcode] = `OPCODE_Load;
                        out[`IR_csr] = {in[5], in[12:10], in[6], 2'b00};
                    end
                3'b110: begin
                        out[`IR_funct3] = 3'b010;
                        out[`IR_rs2] = in[4:2] + 4'b1000;
                        out[`IR_opcode] = `OPCODE_Store;
                        out[`IR_funct7] = in[12];
                        out[`IR_rd] = {in[11:10], in[6], 2'b00};
                    end
                default: out = 32'b0;
            endcase
         end
         2'b01: begin
            case (in[15:13])
                3'b000: begin
                        out[`IR_funct3] = 3'b000;
                        out[`IR_csr] = $signed({in[12], in[6:2]});
                        out[`IR_opcode] = `OPCODE_Arith_I;
                        out[`IR_rd] = in[11:7];
                        out[`IR_rs1] = in[11:7];
                    end
                3'b001: begin
                        out[20] = in[12];
                        out[29:21] = {in[10:9], in[6], in[7], in[2], in[11], in[5:3]};
                        out[`IR_rs1] = 5'b0;
                        out[`IR_opcode] = `OPCODE_JAL;
                    end
                3'b010: begin
                        out[31:12] = $signed({in[12], in[6:2]});
                        out[`IR_rd] = {in[11:7]};
                        out[`IR_opcode] = `OPCODE_LUI;
                    end
                3'b100: begin
                        case (in[11:10])
                            2'b00: begin
                                    out[`IR_funct3] = 3'b101;
                                    out[`IR_funct7] = 7'b0000000;
                                    out[`IR_rs2] = {in[12], in[6:2]};
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                end
                            2'b01: begin
                                    out[`IR_funct3] = 3'b101;
                                    out[`IR_funct7] = 7'b0100000;
                                    out[`IR_rs2] = {in[12], in[6:2]};
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                end
                            2'b10: begin
                                    out[`IR_funct3] = 3'b111;
                                    out[`IR_csr] = $signed({in[12], in[6:2]});
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                end
                            2'b11: begin
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_rs2] = in[4:2] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_R;
                                    case (in[6:5])
                                        2'b00: begin
                                                out[`IR_funct3] = 3'b000;
                                                out[`IR_funct7] = 7'b0100000;
                                            end
                                        2'b01: begin
                                                out[`IR_funct3] = 3'b100;
                                                out[`IR_funct7] = 7'b0000000;
                                            end
                                        2'b10: begin
                                                out[`IR_funct3] = 3'b110;
                                                out[`IR_funct7] = 7'b0000000;
                                            end
                                        2'b11: begin
                                                out[`IR_funct3] = 3'b111;
                                                out[`IR_funct7] = 3'b0000000;
                                            end
                                        default: out = 32'b0;
                                    endcase
                                end
                                default: out = 32'b0;
                        endcase
                    end
                3'b110: begin
                        out[`IR_funct3] = 3'b000;
                        out[`IR_rd] = {in[11:10], in[4:3], in[12]};
                        out[31:25] = $signed({in[12], in[6:5], in[2]});
                        out[`IR_rs1] = in[9:7] + 4'b1000;
                        out[`IR_rs2] = 5'b00000;
                        out[`IR_opcode] = `OPCODE_Branch;
                    end
                3'b111: begin
                        out[`IR_funct3] = 001;
                        out[`IR_rd] = {in[11:10], in[4:3], in[12]};
                        out[28:25] = $signed({in[12], in[6:5], in[2]});
                        out[`IR_rs1] = in[9:7] + 4'b1000;
                        out[`IR_rs2] = 5'b00000;
                        out[`IR_opcode] = `OPCODE_Branch;
                    end
                    
                    default: out = 32'b0;

            endcase
            end
            2'b10: begin
                    case(in[15:13])
                        3'b000: begin
                                out[`IR_funct3] = 3'b001;
                                out[`IR_funct7] = 7'b0000000;
                                out[`IR_rs2] = {in[12], in[6:2]};
                                out[`IR_rd] = in[9:7];
                                out[`IR_rs1] = in[9:7];
                                out[`IR_opcode] = `OPCODE_Arith_I;
                            end
                        3'b100: begin
                                if (in[11:7] == 0 && in[6:2] == 0) begin
                                    out[`IR_csr] = 12'b1;
                                    out[`IR_opcode] = `OPCODE_SYSTEM;
                                    out[`IR_funct3] = 3'b0;
                                    out[`IR_rd] = 5'b0;
                                    out[`IR_rs1] = 5'b0;
                                end
                                if (in[11:7] != 0 && in[6:2] == 0) begin
                                    out[`IR_rs1] = in[11:7];
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                    out[`IR_csr] = 12'b0;
                                    out[`IR_rd] = 5'b1;
                                    out[`IR_funct3] = 3'b000;
                                end
                                if (in[11:7] != 0 && in[6:2] != 0) begin
                                    out[`IR_rs1] = in[11:7];
                                    out[`IR_rd] = in[11:7];
                                    out[`IR_rs1] = in[6:2];
                                    out[`IR_opcode] = `OPCODE_Arith_R;
                                    out[`IR_funct3] = 3'b000;
                                    out[`IR_funct7] = 7'b0000000;
                                end
                            end
                        default: out = 32'b0;
                    endcase
                end
                default: out = 32'b0;
    endcase
end
endmodule
module compressed (input [15:0]in, output reg [31:0]out);

always @(*) begin
    out[`IR_funct3] = in[15:13];
    out[1:0] = 2'b11;
    case (in[1:0])
        2'b00: begin
            out[`IR_rs1] = in[9:7] + 4'b1000;
            case (in[15:13])
                3'b010: begin
                        out[`IR_funct3] = 3'b010;
                        out[`IR_rd] = in[4:2] + 4'b1000;
                        out[`IR_opcode] = `OPCODE_Load;
                        out[`IR_csr] = {in[5], in[12:10], in[6], 2'b00};
                    end
                3'b110: begin
                        out[`IR_funct3] = 3'b010;
                        out[`IR_rs2] = in[4:2] + 4'b1000;
                        out[`IR_opcode] = `OPCODE_Store;
                        out[`IR_funct7] = in[12];
                        out[`IR_rd] = {in[11:10], in[6], 2'b00};
                    end
                default: out = 32'b0;
            endcase
         end
         2'b01: begin
            case (in[15:13])
                3'b000: begin
                        out[`IR_funct3] = 3'b000;
                        out[`IR_csr] = $signed({in[12], in[6:2]});
                        out[`IR_opcode] = `OPCODE_Arith_I;
                        out[`IR_rd] = in[11:7];
                        out[`IR_rs1] = in[11:7];
                    end
                3'b001: begin
                        out[20] = in[12];
                        out[29:21] = {in[10:9], in[6], in[7], in[2], in[11], in[5:3]};
                        out[`IR_rs1] = 5'b0;
                        out[`IR_opcode] = `OPCODE_JAL;
                    end
                3'b010: begin
                        out[31:12] = $signed({in[12], in[6:2]});
                        out[`IR_rd] = {in[11:7]};
                        out[`IR_opcode] = `OPCODE_LUI;
                    end
                3'b100: begin
                        case (in[11:10])
                            2'b00: begin
                                    out[`IR_funct3] = 3'b101;
                                    out[`IR_funct7] = 7'b0000000;
                                    out[`IR_rs2] = {in[12], in[6:2]};
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                end
                            2'b01: begin
                                    out[`IR_funct3] = 3'b101;
                                    out[`IR_funct7] = 7'b0100000;
                                    out[`IR_rs2] = {in[12], in[6:2]};
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                end
                            2'b10: begin
                                    out[`IR_funct3] = 3'b111;
                                    out[`IR_csr] = $signed({in[12], in[6:2]});
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                end
                            2'b11: begin
                                    out[`IR_rd] = in[9:7] + 4'b1000;
                                    out[`IR_rs1] = in[9:7] + 4'b1000;
                                    out[`IR_rs2] = in[4:2] + 4'b1000;
                                    out[`IR_opcode] = `OPCODE_Arith_R;
                                    case (in[6:5])
                                        2'b00: begin
                                                out[`IR_funct3] = 3'b000;
                                                out[`IR_funct7] = 7'b0100000;
                                            end
                                        2'b01: begin
                                                out[`IR_funct3] = 3'b100;
                                                out[`IR_funct7] = 7'b0000000;
                                            end
                                        2'b10: begin
                                                out[`IR_funct3] = 3'b110;
                                                out[`IR_funct7] = 7'b0000000;
                                            end
                                        2'b11: begin
                                                out[`IR_funct3] = 3'b111;
                                                out[`IR_funct7] = 3'b0000000;
                                            end
                                        default: out = 32'b0;
                                    endcase
                                end
                                default: out = 32'b0;
                        endcase
                    end
                3'b110: begin
                        out[`IR_funct3] = 3'b000;
                        out[`IR_rd] = {in[11:10], in[4:3], in[12]};
                        out[31:25] = $signed({in[12], in[6:5], in[2]});
                        out[`IR_rs1] = in[9:7] + 4'b1000;
                        out[`IR_rs2] = 5'b00000;
                        out[`IR_opcode] = `OPCODE_Branch;
                    end
                3'b111: begin
                        out[`IR_funct3] = 001;
                        out[`IR_rd] = {in[11:10], in[4:3], in[12]};
                        out[28:25] = $signed({in[12], in[6:5], in[2]});
                        out[`IR_rs1] = in[9:7] + 4'b1000;
                        out[`IR_rs2] = 5'b00000;
                        out[`IR_opcode] = `OPCODE_Branch;
                    end
                    
                    default: out = 32'b0;

            endcase
            end
            2'b10: begin
                    case(in[15:13])
                        3'b000: begin
                                out[`IR_funct3] = 3'b001;
                                out[`IR_funct7] = 7'b0000000;
                                out[`IR_rs2] = {in[12], in[6:2]};
                                out[`IR_rd] = in[9:7];
                                out[`IR_rs1] = in[9:7];
                                out[`IR_opcode] = `OPCODE_Arith_I;
                            end
                        3'b100: begin
                                if (in[11:7] == 0 && in[6:2] == 0) begin
                                    out[`IR_csr] = 12'b1;
                                    out[`IR_opcode] = `OPCODE_SYSTEM;
                                    out[`IR_funct3] = 3'b0;
                                    out[`IR_rd] = 5'b0;
                                    out[`IR_rs1] = 5'b0;
                                end
                                if (in[11:7] != 0 && in[6:2] == 0) begin
                                    out[`IR_rs1] = in[11:7];
                                    out[`IR_opcode] = `OPCODE_Arith_I;
                                    out[`IR_csr] = 12'b0;
                                    out[`IR_rd] = 5'b1;
                                    out[`IR_funct3] = 3'b000;
                                end
                                if (in[11:7] != 0 && in[6:2] != 0) begin
                                    out[`IR_rs1] = in[11:7];
                                    out[`IR_rd] = in[11:7];
                                    out[`IR_rs1] = in[6:2];
                                    out[`IR_opcode] = `OPCODE_Arith_R;
                                    out[`IR_funct3] = 3'b000;
                                    out[`IR_funct7] = 7'b0000000;
                                end
                            end
                        default: out = 32'b0;
                    endcase
                end
                default: out = 32'b0;
    endcase
end
endmodule