Line 286... |
Line 286... |
wire [4:0] mtrans_num_registers;
|
wire [4:0] mtrans_num_registers;
|
wire use_saved_current_instruction;
|
wire use_saved_current_instruction;
|
wire use_hold_instruction;
|
wire use_hold_instruction;
|
wire use_pre_fetch_instruction;
|
wire use_pre_fetch_instruction;
|
wire interrupt;
|
wire interrupt;
|
|
wire interrupt_or_conflict;
|
wire [1:0] interrupt_mode;
|
wire [1:0] interrupt_mode;
|
wire [2:0] next_interrupt;
|
wire [2:0] next_interrupt;
|
reg irq = 'd0;
|
reg irq = 'd0;
|
reg firq = 'd0;
|
reg firq = 'd0;
|
wire firq_request;
|
wire firq_request;
|
Line 455... |
Line 456... |
assign immediate_shift_op = instruction[25];
|
assign immediate_shift_op = instruction[25];
|
assign rds_use_rs = (type == REGOP && !instruction[25] && instruction[4]) ||
|
assign rds_use_rs = (type == REGOP && !instruction[25] && instruction[4]) ||
|
(type == MULT &&
|
(type == MULT &&
|
(control_state == MULT_PROC1 ||
|
(control_state == MULT_PROC1 ||
|
control_state == MULT_PROC2 ||
|
control_state == MULT_PROC2 ||
|
instruction_valid && !interrupt )) ;
|
// instruction_valid && !interrupt )) ;
|
|
// remove the '!conflict' term from the interrupt logic used here
|
|
// to break a combinational loop
|
|
(instruction_valid && !interrupt_or_conflict))) ;
|
|
|
|
|
assign branch = type == BRANCH;
|
assign branch = type == BRANCH;
|
assign opcode_compare = opcode == CMP || opcode == CMN || opcode == TEQ || opcode == TST ;
|
assign opcode_compare = opcode == CMP || opcode == CMN || opcode == TEQ || opcode == TST ;
|
assign mem_op = type == TRANS;
|
assign mem_op = type == TRANS;
|
assign load_op = mem_op && instruction[20];
|
assign load_op = mem_op && instruction[20];
|
assign store_op = mem_op && !instruction[20];
|
assign store_op = mem_op && !instruction[20];
|
Line 685... |
Line 691... |
// if the instruction is used
|
// if the instruction is used
|
und_request ? 3'd6 : // Undefined Instruction
|
und_request ? 3'd6 : // Undefined Instruction
|
swi_request ? 3'd7 : // SWI
|
swi_request ? 3'd7 : // SWI
|
3'd0 ; // none
|
3'd0 ; // none
|
|
|
|
|
// SWI and undefined instructions do not cause an interrupt in the decode
|
// SWI and undefined instructions do not cause an interrupt in the decode
|
// stage. They only trigger interrupts if they arfe executed, so the
|
// stage. They only trigger interrupts if they arfe executed, so the
|
// interrupt is triggered if the execute condition is met in the execute stage
|
// interrupt is triggered if the execute condition is met in the execute stage
|
assign interrupt = next_interrupt != 3'd0 &&
|
assign interrupt = next_interrupt != 3'd0 &&
|
next_interrupt != 3'd7 && // SWI
|
next_interrupt != 3'd7 && // SWI
|
next_interrupt != 3'd6 && // undefined interrupt
|
next_interrupt != 3'd6 && // undefined interrupt
|
!conflict ; // Wait for conflicts to resolve before
|
!conflict ; // Wait for conflicts to resolve before
|
// triggering int
|
// triggering int
|
|
|
|
|
|
// Added to use in rds_use_rs logic to break a combinational loop invloving
|
|
// the conflict signal
|
|
assign interrupt_or_conflict
|
|
= next_interrupt != 3'd0 &&
|
|
next_interrupt != 3'd7 && // SWI
|
|
next_interrupt != 3'd6 ; // undefined interrupt
|
|
|
assign interrupt_mode = next_interrupt == 3'd2 ? FIRQ :
|
assign interrupt_mode = next_interrupt == 3'd2 ? FIRQ :
|
next_interrupt == 3'd3 ? IRQ :
|
next_interrupt == 3'd3 ? IRQ :
|
next_interrupt == 3'd4 ? SVC :
|
next_interrupt == 3'd4 ? SVC :
|
next_interrupt == 3'd5 ? SVC :
|
next_interrupt == 3'd5 ? SVC :
|
next_interrupt == 3'd6 ? SVC :
|
next_interrupt == 3'd6 ? SVC :
|
next_interrupt == 3'd7 ? SVC :
|
next_interrupt == 3'd7 ? SVC :
|
next_interrupt == 3'd1 ? SVC :
|
next_interrupt == 3'd1 ? SVC :
|
USR ;
|
USR ;
|
|
|
|
|
|
|
|
|
// ========================================================
|
// ========================================================
|
// Generate control signals
|
// Generate control signals
|
// ========================================================
|
// ========================================================
|
always @*
|
always @*
|
begin
|
begin
|