data/full_repos/permissive/497530416/pipe/fetch.v
1: b'%Warning-LITENDIAN: data/full_repos/permissive/497530416/pipe/fetch.v:11: Little bit endian vector: MSB < LSB of bit range: 0:7\nreg [0:7] reg_AB;\n    ^\n                    ... Use "/* verilator lint_off LITENDIAN */" and lint_on around source to disable this message.\n%Warning-LITENDIAN: data/full_repos/permissive/497530416/pipe/fetch.v:12: Little bit endian vector: MSB < LSB of bit range: 0:7\nreg [0:7] instruction;\n    ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:238: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n        f_icode = instruction_memory[f_pc][7:4];\n                                    ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:239: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n        f_ifun =  instruction_memory[f_pc][3:0];\n                                    ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:260: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                reg_AB = {instruction_memory[f_pc+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:268: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                reg_AB = {instruction_memory[f_pc+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:271: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                f_valC = { instruction_memory[f_pc+9],\n                                             ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:272: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+8],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:273: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+7],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:274: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+6],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:275: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+5],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:276: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+4],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:277: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+3],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:278: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+2] };\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:284: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                reg_AB = {instruction_memory[f_pc+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:287: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                f_valC = { instruction_memory[f_pc+9],\n                                             ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:288: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+8],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:289: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+7],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:290: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+6],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:291: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+5],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:292: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+4],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:293: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+3],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:294: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+2] };\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:300: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                reg_AB = {instruction_memory[f_pc+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:303: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                f_valC = { instruction_memory[f_pc+9],\n                                             ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:304: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+8],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:305: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+7],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:306: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+6],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:307: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+5],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:308: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+4],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:309: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+3],\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:310: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                                    instruction_memory[f_pc+2] };\n                                                      ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:316: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                reg_AB = {instruction_memory[f_pc+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:324: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                f_valC = { instruction_memory[f_pc+8],\n                                             ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:325: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+7],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:326: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+6],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:327: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+5],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:328: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+4],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:329: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+3],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:330: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+2],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:331: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+1] };\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:337: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                f_valC = { instruction_memory[f_pc+8],\n                                             ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:338: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+7],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:339: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+6],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:340: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+5],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:341: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+4],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:342: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+3],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:343: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+2],\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:344: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                        instruction_memory[f_pc+1] };\n                                          ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:355: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                reg_AB = {instruction_memory[f_pc+1]};\n                                            ^\n%Warning-WIDTH: data/full_repos/permissive/497530416/pipe/fetch.v:363: Bit extraction of array[127:0] requires 7 bit index, not 64 bits.\n                                                                     : ... In instance fetch_pipe\n                reg_AB = {instruction_memory[f_pc+1]};\n                                            ^\n%Warning-UNSIGNED: data/full_repos/permissive/497530416/pipe/fetch.v:243: Comparison is constant due to unsigned arithmetic\n                                                                        : ... In instance fetch_pipe\n        if(f_icode>=4\'b0000 && f_icode<4\'b1100)\n                  ^~\n%Error: Exiting due to 52 warning(s)\n'
module fetch_pipe(clk, f_pc, f_icode, f_ifun, f_rA, f_rB, f_valC, f_valP, predPC,
valid_instruction, memory_error, halt);

input clk;
input [63:0] f_pc;

output reg [3:0] f_icode, f_ifun, f_rA, f_rB;
output reg [63:0] f_valC, f_valP, predPC;
output reg valid_instruction, memory_error, halt;

reg [0:7] reg_AB;
reg [0:7] instruction;
reg [7:0] instruction_memory [0:127];

initial 
    begin
        halt = 0;





















































        







































        
















































































         instruction_memory[0] = 8'b00010000; 

        instruction_memory[1] = 8'b00110000;
        instruction_memory[2] = 8'b11110001;
        instruction_memory[3] = 8'b00000010;
        instruction_memory[4] = 8'b00000000;
        instruction_memory[5] = 8'b00000000;
        instruction_memory[6] = 8'b00000000;
        instruction_memory[7] = 8'b00000000;
        instruction_memory[8] = 8'b00000000;
        instruction_memory[9] = 8'b00000000;
        instruction_memory[10] = 8'b00000000;

        instruction_memory[11] = 8'b00110000;
        instruction_memory[12] = 8'b11110010;
        instruction_memory[13] = 8'b00000011;
        instruction_memory[14] = 8'b00000000;
        instruction_memory[15] = 8'b00000000;
        instruction_memory[16] = 8'b00000000;
        instruction_memory[17] = 8'b00000000;
        instruction_memory[18] = 8'b00000000;
        instruction_memory[19] = 8'b00000000;
        instruction_memory[20] = 8'b00000000;

        instruction_memory[21] = 8'b01100000;
        instruction_memory[22] = 8'b00010010;

        instruction_memory[23] = 8'b00010000;
        instruction_memory[24] = 8'b00010000;
        instruction_memory[25] = 8'b00010000;
        instruction_memory[26] = 8'b00010000;
        instruction_memory[27] = 8'b00010000;

        instruction_memory[28] = 8'b00000000;
    end


always @ (*)
    begin
        memory_error = 0;
        if(f_pc > 127)
        begin
            memory_error = 1;
        end


        f_icode = instruction_memory[f_pc][7:4];
        f_ifun =  instruction_memory[f_pc][3:0];



        if(f_icode>=4'b0000 && f_icode<4'b1100)
        begin
            case(f_icode)

            4'b0000:
            begin
                halt = 1;
                f_valP = f_pc + 64'd1;
            end

            4'b0001:
            begin
                f_valP = f_pc + 64'd1;
            end

            4'b0010:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end

            4'b0011:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valC = { instruction_memory[f_pc+9],
                                    instruction_memory[f_pc+8],
                                    instruction_memory[f_pc+7],
                                    instruction_memory[f_pc+6],
                                    instruction_memory[f_pc+5],
                                    instruction_memory[f_pc+4],
                                    instruction_memory[f_pc+3],
                                    instruction_memory[f_pc+2] };
                f_valP = f_pc + 64'd10;
            end
        
            4'b0100:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valC = { instruction_memory[f_pc+9],
                                    instruction_memory[f_pc+8],
                                    instruction_memory[f_pc+7],
                                    instruction_memory[f_pc+6],
                                    instruction_memory[f_pc+5],
                                    instruction_memory[f_pc+4],
                                    instruction_memory[f_pc+3],
                                    instruction_memory[f_pc+2] };
                f_valP = f_pc + 64'd10;
            end
        
            4'b0101:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valC = { instruction_memory[f_pc+9],
                                    instruction_memory[f_pc+8],
                                    instruction_memory[f_pc+7],
                                    instruction_memory[f_pc+6],
                                    instruction_memory[f_pc+5],
                                    instruction_memory[f_pc+4],
                                    instruction_memory[f_pc+3],
                                    instruction_memory[f_pc+2] };
                f_valP = f_pc + 64'd10;
            end

            4'b0110:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end

            4'b0111:
            begin
                f_valC = { instruction_memory[f_pc+8],
                        instruction_memory[f_pc+7],
                        instruction_memory[f_pc+6],
                        instruction_memory[f_pc+5],
                        instruction_memory[f_pc+4],
                        instruction_memory[f_pc+3],
                        instruction_memory[f_pc+2],
                        instruction_memory[f_pc+1] };
                f_valP = f_pc + 64'd9;
            end

            4'b1000:
            begin
                f_valC = { instruction_memory[f_pc+8],
                        instruction_memory[f_pc+7],
                        instruction_memory[f_pc+6],
                        instruction_memory[f_pc+5],
                        instruction_memory[f_pc+4],
                        instruction_memory[f_pc+3],
                        instruction_memory[f_pc+2],
                        instruction_memory[f_pc+1] };
                f_valP = f_pc + 64'd9;
            end

            4'b1001:
            begin
                f_valP = f_pc + 64'd1;
            end

            4'b1010:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end

            4'b1011:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end
            endcase
        end

    end


always@(f_valP or f_valC or f_icode)
    begin
        if(f_icode == 7 || f_icode == 8)
            begin
                predPC = f_valC;
            end
        else
            begin
                predPC = f_valP;
            end
    end
endmodule
module fetch_pipe(clk, f_pc, f_icode, f_ifun, f_rA, f_rB, f_valC, f_valP, predPC,
valid_instruction, memory_error, halt);


input clk;
input [63:0] f_pc;

output reg [3:0] f_icode, f_ifun, f_rA, f_rB;
output reg [63:0] f_valC, f_valP, predPC;
output reg valid_instruction, memory_error, halt;

reg [0:7] reg_AB;
reg [0:7] instruction;
reg [7:0] instruction_memory [0:127];

initial 
    begin
        halt = 0;





















































        







































        
















































































         instruction_memory[0] = 8'b00010000; 

        instruction_memory[1] = 8'b00110000;
        instruction_memory[2] = 8'b11110001;
        instruction_memory[3] = 8'b00000010;
        instruction_memory[4] = 8'b00000000;
        instruction_memory[5] = 8'b00000000;
        instruction_memory[6] = 8'b00000000;
        instruction_memory[7] = 8'b00000000;
        instruction_memory[8] = 8'b00000000;
        instruction_memory[9] = 8'b00000000;
        instruction_memory[10] = 8'b00000000;

        instruction_memory[11] = 8'b00110000;
        instruction_memory[12] = 8'b11110010;
        instruction_memory[13] = 8'b00000011;
        instruction_memory[14] = 8'b00000000;
        instruction_memory[15] = 8'b00000000;
        instruction_memory[16] = 8'b00000000;
        instruction_memory[17] = 8'b00000000;
        instruction_memory[18] = 8'b00000000;
        instruction_memory[19] = 8'b00000000;
        instruction_memory[20] = 8'b00000000;

        instruction_memory[21] = 8'b01100000;
        instruction_memory[22] = 8'b00010010;

        instruction_memory[23] = 8'b00010000;
        instruction_memory[24] = 8'b00010000;
        instruction_memory[25] = 8'b00010000;
        instruction_memory[26] = 8'b00010000;
        instruction_memory[27] = 8'b00010000;

        instruction_memory[28] = 8'b00000000;
    end


always @ (*)
    begin
        memory_error = 0;
        if(f_pc > 127)
        begin
            memory_error = 1;
        end


        f_icode = instruction_memory[f_pc][7:4];
        f_ifun =  instruction_memory[f_pc][3:0];



        if(f_icode>=4'b0000 && f_icode<4'b1100)
        begin
            case(f_icode)

            4'b0000:
            begin
                halt = 1;
                f_valP = f_pc + 64'd1;
            end

            4'b0001:
            begin
                f_valP = f_pc + 64'd1;
            end

            4'b0010:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end

            4'b0011:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valC = { instruction_memory[f_pc+9],
                                    instruction_memory[f_pc+8],
                                    instruction_memory[f_pc+7],
                                    instruction_memory[f_pc+6],
                                    instruction_memory[f_pc+5],
                                    instruction_memory[f_pc+4],
                                    instruction_memory[f_pc+3],
                                    instruction_memory[f_pc+2] };
                f_valP = f_pc + 64'd10;
            end
        
            4'b0100:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valC = { instruction_memory[f_pc+9],
                                    instruction_memory[f_pc+8],
                                    instruction_memory[f_pc+7],
                                    instruction_memory[f_pc+6],
                                    instruction_memory[f_pc+5],
                                    instruction_memory[f_pc+4],
                                    instruction_memory[f_pc+3],
                                    instruction_memory[f_pc+2] };
                f_valP = f_pc + 64'd10;
            end
        
            4'b0101:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valC = { instruction_memory[f_pc+9],
                                    instruction_memory[f_pc+8],
                                    instruction_memory[f_pc+7],
                                    instruction_memory[f_pc+6],
                                    instruction_memory[f_pc+5],
                                    instruction_memory[f_pc+4],
                                    instruction_memory[f_pc+3],
                                    instruction_memory[f_pc+2] };
                f_valP = f_pc + 64'd10;
            end

            4'b0110:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end

            4'b0111:
            begin
                f_valC = { instruction_memory[f_pc+8],
                        instruction_memory[f_pc+7],
                        instruction_memory[f_pc+6],
                        instruction_memory[f_pc+5],
                        instruction_memory[f_pc+4],
                        instruction_memory[f_pc+3],
                        instruction_memory[f_pc+2],
                        instruction_memory[f_pc+1] };
                f_valP = f_pc + 64'd9;
            end

            4'b1000:
            begin
                f_valC = { instruction_memory[f_pc+8],
                        instruction_memory[f_pc+7],
                        instruction_memory[f_pc+6],
                        instruction_memory[f_pc+5],
                        instruction_memory[f_pc+4],
                        instruction_memory[f_pc+3],
                        instruction_memory[f_pc+2],
                        instruction_memory[f_pc+1] };
                f_valP = f_pc + 64'd9;
            end

            4'b1001:
            begin
                f_valP = f_pc + 64'd1;
            end

            4'b1010:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end

            4'b1011:
            begin
                reg_AB = {instruction_memory[f_pc+1]};
                f_rA = reg_AB[0:3];
                f_rB = reg_AB[4:7];
                f_valP = f_pc + 64'd2;
            end
            endcase
        end

    end


always@(f_valP or f_valC or f_icode)
    begin
        if(f_icode == 7 || f_icode == 8)
            begin
                predPC = f_valC;
            end
        else
            begin
                predPC = f_valP;
            end
    end
endmodule