Skip to content

Commit

Permalink
Combine interrupt vector assignments
Browse files Browse the repository at this point in the history
CV32E40P now uses the same interrupt lines as ibex, no longer the pulp
interrupt_cntrl format. Reduces duplicate code,
  • Loading branch information
micprog committed Apr 29, 2022
1 parent bd5f5b7 commit 2a19340
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions rtl/fc/fc_subsystem.sv
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,6 @@ module fc_subsystem import cv32e40p_apu_core_pkg::*; #(

assign supervisor_mode_o = 1'b1;

always_comb begin : gen_core_irq_x
core_irq_x = '0;
if (core_irq_req) begin
core_irq_x[core_irq_id] = 1'b1;
end
end

end else begin: FC_CORE
assign boot_addr = boot_addr_i & 32'hFFFFFF00; // RI5CY expects 0x80 offset, Ibex expects 0x00 offset (adds reset offset 0x80 internally)
`ifdef VERILATOR
Expand Down Expand Up @@ -313,6 +306,7 @@ module fc_subsystem import cv32e40p_apu_core_pkg::*; #(
.irq_fast_i ( 15'b0 ),
.irq_nm_i ( 1'b0 ),

// Ibex supports 32 additional fast interrupts and reads the interrupt lines directly.
.irq_x_i ( core_irq_x ),
.irq_x_ack_o ( core_irq_ack ),
.irq_x_ack_id_o ( core_irq_ack_id ),
Expand All @@ -328,15 +322,7 @@ module fc_subsystem import cv32e40p_apu_core_pkg::*; #(
);

assign supervisor_mode_o = 1'b1;
// Ibex supports 32 additional fast interrupts and reads the interrupt lines directly.
// Convert ID back to interrupt lines
always_comb begin : gen_core_irq_x
core_irq_x = '0;
if (core_irq_req) begin
core_irq_x[core_irq_id] = 1'b1;
end
end


end
endgenerate

Expand All @@ -359,6 +345,14 @@ module fc_subsystem import cv32e40p_apu_core_pkg::*; #(
.apb_slave ( apb_slave_eu )
);

// Convert ID back to interrupt lines
always_comb begin : gen_core_irq_x
core_irq_x = '0;
if (core_irq_req) begin
core_irq_x[core_irq_id] = 1'b1;
end
end


if(USE_HWPE) begin : fc_hwpe_gen
fc_hwpe #(
Expand Down

0 comments on commit 2a19340

Please sign in to comment.