OpenCores
URL https://opencores.org/ocsvn/zap/zap/trunk

Subversion Repositories zap

[/] [zap/] [trunk/] [src/] [rtl/] [cpu/] [zap_issue_main.v] - Diff between revs 41 and 51

Show entire file | Details | Blame | View Log

Rev 41 Rev 51
Line 499... Line 499...
 
 
reg [31:0] get;
reg [31:0] get;
 
 
begin
begin
 
 
`ifdef ISSUE_DEBUG
 
        $display($time, "Received index as %d and rd_port %d", index, rd_port);
 
`endif
 
 
 
        if   ( index[32] )                 // Catch constant here.
        if   ( index[32] )                 // Catch constant here.
        begin
        begin
`ifdef ISSUE_DEBUG
 
                        $display($time, "Constant detect. Returning %x", index[31:0]);
 
`endif
 
 
 
                        get = index[31:0];
                        get = index[31:0];
        end
        end
        else if ( index == PHY_RAZ_REGISTER )   // Catch RAZ here.
        else if ( index == PHY_RAZ_REGISTER )   // Catch RAZ here.
        begin
        begin
               // Return 0. 
               // Return 0. 
`ifdef ISSUE_DEBUG
 
               $display($time, "RAZ returned 0...");
 
`endif
 
                get = 32'd0;
                get = 32'd0;
        end
        end
        else if   ( index == ARCH_PC )  // Catch PC here. ARCH index = PHY index so no problem.
        else if   ( index == ARCH_PC )  // Catch PC here. ARCH index = PHY index so no problem.
        begin
        begin
                 get = i_pc_plus_8_ff;
                 get = i_pc_plus_8_ff;
`ifdef ISSUE_DEBUG
 
                 $display($time, "PC requested... given as %x", get);
 
`endif
 
        end
        end
        else if ( index == PHY_CPSR )   // Catch CPSR here.
        else if ( index == PHY_CPSR )   // Catch CPSR here.
        begin
        begin
                get = i_cpu_mode;
                get = i_cpu_mode;
        end
        end
 
 
        // Match in ALU stage.
        // Match in ALU stage.
        else if   ( index == i_shifter_destination_index_ff && i_alu_dav_nxt  )
        else if   ( index == i_shifter_destination_index_ff && i_alu_dav_nxt  )
        begin   // ALU effectively never changes destination so no need to look at _nxt.
        begin   // ALU effectively never changes destination so no need to look at _nxt.
                        get =  i_alu_destination_value_nxt;
                        get =  i_alu_destination_value_nxt;
`ifdef ISSUE_DEBUG
 
                        $display($time, "Matched shifter destination index %x ... given as %x", i_shifter_destination_index_ff, get);
 
`endif
 
        end
        end
 
 
        // Match in output of ALU stage.
        // Match in output of ALU stage.
        else if   ( index == i_alu_destination_index_ff && i_alu_dav_ff       )
        else if   ( index == i_alu_destination_index_ff && i_alu_dav_ff       )
        begin
        begin
                        get =  i_alu_destination_value_ff;
                        get =  i_alu_destination_value_ff;
`ifdef ISSUE_DEBUG
 
                        $display($time, "Matched ALU destination index %x ... given as %x", i_alu_destination_index_ff, get);
 
`endif
 
        end
        end
 
 
        // Match in output of memory stage.
        // Match in output of memory stage.
        else if   ( index == i_memory_destination_index_ff && i_memory_dav_ff )
        else if   ( index == i_memory_destination_index_ff && i_memory_dav_ff )
        begin
        begin
                        get =  i_memory_destination_value_ff;
                        get =  i_memory_destination_value_ff;
`ifdef ISSUE_DEBUG
 
                        $display($time, "Matched memory destination index %x ... given as %x", i_memory_destination_index_ff, get);
 
`endif
 
        end
        end
        else    // Index not found in the pipeline, fallback to register access.                     
        else    // Index not found in the pipeline, fallback to register access.                     
        begin
        begin
`ifdef ISSUE_DEBUG
 
                $display($time, "Register read on rd_port %x", rd_port );
 
`endif
 
 
 
                case ( rd_port )
                case ( rd_port )
                        0: get = i_rd_data_0;
                        0: get = i_rd_data_0;
                        1: get = i_rd_data_1;
                        1: get = i_rd_data_1;
                        2: get = i_rd_data_2;
                        2: get = i_rd_data_2;
                        3: get = i_rd_data_3;
                        3: get = i_rd_data_3;
                endcase
                endcase
`ifdef ISSUE_DEBUG
 
                $display($time, "Reg read -> Returned value %x", get);
 
`endif
 
        end
        end
 
 
        // The memory accelerator. If the required stuff is present in the memory unit, short circuit.
        // The memory accelerator. If the required stuff is present in the memory unit, short circuit.
        if ( index == i_memory_mem_srcdest_index_ff && i_memory_mem_load_ff && i_memory_dav_ff )
        if ( index == i_memory_mem_srcdest_index_ff && i_memory_mem_load_ff && i_memory_dav_ff )
        begin
        begin
`ifdef ISSUE_DEBUG
 
                $display($time, "Memory accelerator gets value %x", i_memory_mem_srcdest_value_ff);
 
`endif
 
 
 
                get = i_memory_mem_srcdest_value_ff;
                get = i_memory_mem_srcdest_value_ff;
        end
        end
 
 
        get_register_value = get;
        get_register_value = get;
end
end
Line 767... Line 734...
                determine_load_lock = 1'd0;
                determine_load_lock = 1'd0;
end
end
endfunction
endfunction
 
 
endmodule // zap_issue_main.v
endmodule // zap_issue_main.v
 
 
`default_nettype wire
`default_nettype wire
 
 
 No newline at end of file
 No newline at end of file
 
// ----------------------------------------------------------------------------
 
// EOF
 
// ----------------------------------------------------------------------------
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2022 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.