From 2a1934018050c6fccac27ae65c931824d79b7da9 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Fri, 29 Apr 2022 11:06:45 +0200 Subject: [PATCH] Combine interrupt vector assignments CV32E40P now uses the same interrupt lines as ibex, no longer the pulp interrupt_cntrl format. Reduces duplicate code, --- rtl/fc/fc_subsystem.sv | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/rtl/fc/fc_subsystem.sv b/rtl/fc/fc_subsystem.sv index 7d80a1a4..181103ff 100644 --- a/rtl/fc/fc_subsystem.sv +++ b/rtl/fc/fc_subsystem.sv @@ -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 @@ -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 ), @@ -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 @@ -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 #(