Line 39... |
Line 39... |
// Public License along with this source; if not, download it //
|
// Public License along with this source; if not, download it //
|
// from http://www.opencores.org/lgpl.shtml //
|
// from http://www.opencores.org/lgpl.shtml //
|
// //
|
// //
|
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
|
|
`include "a23_config_defines.v"
|
`include "a23_config_defines.vh"
|
|
|
module a23_execute (
|
module a23_execute (
|
|
|
input i_clk,
|
input i_clk,
|
input [31:0] i_read_data,
|
input [31:0] i_read_data,
|
Line 104... |
Line 104... |
input [2:0] i_status_bits_sel,
|
input [2:0] i_status_bits_sel,
|
input [2:0] i_reg_write_sel,
|
input [2:0] i_reg_write_sel,
|
input i_user_mode_regs_load,
|
input i_user_mode_regs_load,
|
input i_user_mode_regs_store_nxt,
|
input i_user_mode_regs_store_nxt,
|
input i_firq_not_user_mode,
|
input i_firq_not_user_mode,
|
input i_firq_not_user_mode_nxt,
|
|
|
|
input i_write_data_wen,
|
input i_write_data_wen,
|
input i_base_address_wen, // save LDM base address register,
|
input i_base_address_wen, // save LDM base address register,
|
// in case of data abort
|
// in case of data abort
|
input i_pc_wen,
|
input i_pc_wen,
|
Line 120... |
Line 119... |
input i_status_bits_firq_mask_wen,
|
input i_status_bits_firq_mask_wen,
|
input i_copro_write_data_wen
|
input i_copro_write_data_wen
|
|
|
);
|
);
|
|
|
`include "a23_localparams.v"
|
`include "a23_localparams.vh"
|
`include "a23_functions.v"
|
`include "a23_functions.vh"
|
|
|
// ========================================================
|
// ========================================================
|
// Internal signals
|
// Internal signals
|
// ========================================================
|
// ========================================================
|
wire [31:0] write_data_nxt;
|
wire [31:0] write_data_nxt;
|
Line 190... |
Line 189... |
wire exclusive_update;
|
wire exclusive_update;
|
wire status_bits_flags_update;
|
wire status_bits_flags_update;
|
wire status_bits_mode_update;
|
wire status_bits_mode_update;
|
wire status_bits_irq_mask_update;
|
wire status_bits_irq_mask_update;
|
wire status_bits_firq_mask_update;
|
wire status_bits_firq_mask_update;
|
|
wire [1:0] status_bits_out;
|
|
|
wire [31:0] alu_out_pc_filtered;
|
wire [31:0] alu_out_pc_filtered;
|
wire adex_nxt;
|
wire adex_nxt;
|
|
|
// ========================================================
|
// ========================================================
|
// Status Bits in PC register
|
// Status Bits in PC register
|
// ========================================================
|
// ========================================================
|
wire [1:0] status_bits_out;
|
assign status_bits_out = (i_status_bits_mode_wen && i_status_bits_sel == 3'd1 && execute) ?
|
assign status_bits_out = (i_status_bits_mode_wen && i_status_bits_sel == 3'd1) ?
|
|
alu_out[1:0] : status_bits_mode ;
|
alu_out[1:0] : status_bits_mode ;
|
|
|
|
|
assign o_status_bits = { status_bits_flags, // 31:28
|
assign o_status_bits = { status_bits_flags, // 31:28
|
status_bits_irq_mask, // 7
|
status_bits_irq_mask, // 7
|
Line 214... |
Line 213... |
// Status Bits Select
|
// Status Bits Select
|
// ========================================================
|
// ========================================================
|
assign status_bits_flags_nxt = i_status_bits_sel == 3'd0 ? alu_flags :
|
assign status_bits_flags_nxt = i_status_bits_sel == 3'd0 ? alu_flags :
|
i_status_bits_sel == 3'd1 ? alu_out [31:28] :
|
i_status_bits_sel == 3'd1 ? alu_out [31:28] :
|
i_status_bits_sel == 3'd3 ? i_copro_read_data[31:28] :
|
i_status_bits_sel == 3'd3 ? i_copro_read_data[31:28] :
|
// 4 = update flags after a multiply operation
|
// update flags after a multiply operation
|
{ multiply_flags, status_bits_flags[1:0] } ;
|
i_status_bits_sel == 3'd4 ? { multiply_flags, status_bits_flags[1:0] } :
|
|
// regops that do not change the overflow flag
|
|
i_status_bits_sel == 3'd5 ? { alu_flags[3:1], status_bits_flags[0] } :
|
|
4'b1111 ;
|
|
|
assign status_bits_mode_nxt = i_status_bits_sel == 3'd0 ? i_status_bits_mode :
|
assign status_bits_mode_nxt = i_status_bits_sel == 3'd0 ? i_status_bits_mode :
|
|
i_status_bits_sel == 3'd5 ? i_status_bits_mode :
|
i_status_bits_sel == 3'd1 ? alu_out [1:0] :
|
i_status_bits_sel == 3'd1 ? alu_out [1:0] :
|
i_copro_read_data [1:0] ;
|
i_copro_read_data [1:0] ;
|
|
|
|
|
// Used for the Rds output of register_bank - this special version of
|
// Used for the Rds output of register_bank - this special version of
|
Line 238... |
Line 241... |
|
|
assign status_bits_mode_rds_oh_nxt = oh_status_bits_mode(status_bits_mode_rds_nxt);
|
assign status_bits_mode_rds_oh_nxt = oh_status_bits_mode(status_bits_mode_rds_nxt);
|
|
|
|
|
assign status_bits_irq_mask_nxt = i_status_bits_sel == 3'd0 ? i_status_bits_irq_mask :
|
assign status_bits_irq_mask_nxt = i_status_bits_sel == 3'd0 ? i_status_bits_irq_mask :
|
|
i_status_bits_sel == 3'd5 ? i_status_bits_irq_mask :
|
i_status_bits_sel == 3'd1 ? alu_out [27] :
|
i_status_bits_sel == 3'd1 ? alu_out [27] :
|
i_copro_read_data [27] ;
|
i_copro_read_data [27] ;
|
|
|
assign status_bits_firq_mask_nxt = i_status_bits_sel == 3'd0 ? i_status_bits_firq_mask :
|
assign status_bits_firq_mask_nxt = i_status_bits_sel == 3'd0 ? i_status_bits_firq_mask :
|
|
i_status_bits_sel == 3'd5 ? i_status_bits_firq_mask :
|
i_status_bits_sel == 3'd1 ? alu_out [26] :
|
i_status_bits_sel == 3'd1 ? alu_out [26] :
|
i_copro_read_data [26] ;
|
i_copro_read_data [26] ;
|
|
|
|
|
|
|