Skip to content

Commit

Permalink
fix exc cause
Browse files Browse the repository at this point in the history
  • Loading branch information
davideschiavone committed Aug 16, 2023
1 parent c4e9e51 commit 538f406
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rtl/cve2_controller.sv
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,10 @@ module cve2_controller #(
end else if (irqs_i.irq_fast != 16'b0) begin
// generate exception cause ID from fast interrupt ID:
// - first bit distinguishes interrupts from exceptions,
// - second bit adds 16 to fast interrupt ID
// - third bit adds 16 to fast interrupt ID so that the interrup 0 becomes 16 and the interrupt 15 becomes 31 (hence 5bits)
// - second bit is always 0 as the FAST interrupts are represented in the first 5bits, the 6th is always 0 cause is used by the NMI (in that case is 1 as represented by the number 32)
// for example EXC_CAUSE_IRQ_FAST_0 = {1'b1, 6'd16}
exc_cause_o = exc_cause_e'({2'b11, mfip_id});
exc_cause_o = exc_cause_e'({3'b101, mfip_id});
end else if (irqs_i.irq_external) begin
exc_cause_o = EXC_CAUSE_IRQ_EXTERNAL_M;
end else if (irqs_i.irq_software) begin
Expand Down

0 comments on commit 538f406

Please sign in to comment.