input clk_i; // Clock
input rst_i; // Reset
-input [interrupts-1:0] interrupt; // Interrupt pins, active-low
+input [interrupts-1:0] interrupt; // Interrupt pins
input stall_x; // Stall X pipeline stage
// Internal nets and registers
/////////////////////////////////////////////////////
-wire [interrupts-1:0] asserted; // Which interrupts are currently being asserted
-//pragma attribute asserted preserve_signal true
wire [interrupts-1:0] interrupt_n_exception;
// Interrupt CSRs
// Determine if any unmasked interrupts have occured
assign interrupt_exception = (|interrupt_n_exception) & ie;
-
-// Determine which interrupts are currently being asserted (active-low) or are already pending
-assign asserted = ip | interrupt;
assign ie_csr_read_data = {{`LM32_WORD_WIDTH-3{1'b0}},
`ifdef CFG_DEBUG_ENABLED
else
begin
// Set IP bit when interrupt line is asserted
- ip <= asserted;
+ ip <= interrupt;
`ifdef CFG_DEBUG_ENABLED
if (non_debug_exception == `TRUE)
begin
end
if (csr == `LM32_CSR_IM)
im <= csr_write_data[interrupts-1:0];
- if (csr == `LM32_CSR_IP)
- ip <= asserted & ~csr_write_data[interrupts-1:0];
end
end
end
else
begin
// Set IP bit when interrupt line is asserted
- ip <= asserted;
+ ip <= interrupt;
`ifdef CFG_DEBUG_ENABLED
if (non_debug_exception == `TRUE)
begin
bie <= csr_write_data[2];
`endif
end
- if (csr == `LM32_CSR_IP)
- ip <= asserted & ~csr_write_data[interrupts-1:0];
end
end
end