From 9c0aa697839ba3a76c774476f9f56f9b879c4c41 Mon Sep 17 00:00:00 2001
From: Grzegorz Daniluk <grzegorz.daniluk@cern.ch>
Date: Mon, 9 Sep 2013 14:30:43 +0200
Subject: [PATCH] [switch-optimization]: reduced number of IRQs to those
 actually used

---
 top/bare_top/scb_top_bare.vhd | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/top/bare_top/scb_top_bare.vhd b/top/bare_top/scb_top_bare.vhd
index f2f7f85d..0e4e541f 100644
--- a/top/bare_top/scb_top_bare.vhd
+++ b/top/bare_top/scb_top_bare.vhd
@@ -153,6 +153,7 @@ architecture rtl of scb_top_bare is
   constant c_ALL_EVENTS    : integer := c_TRU_EVENTS + c_RTU_EVENTS + c_epevents_sz;
   constant c_DUMMY_RMON    : boolean := false; -- define TRUE to enable dummy_rmon module for debugging PSTAT
   constant c_NUM_GPIO_PINS : integer := 1;
+  constant c_NUM_IRQS      : integer := 4;
 --   constant c_epevents_sz   : integer := 15;
 -------------------------------------------------------------------------------
 -- Interconnect & memory layout
@@ -297,7 +298,7 @@ architecture rtl of scb_top_bare is
   -- Component declarations
   -----------------------------------------------------------------------------
 
-  signal vic_irqs : std_logic_vector(31 downto 0);
+  signal vic_irqs : std_logic_vector(c_NUM_IRQS-1 downto 0);
   type t_trig is array(integer range <>) of std_logic_vector(31 downto 0);
 
   signal control0                   : std_logic_vector(35 downto 0);
@@ -526,7 +527,7 @@ begin
     generic map (
       g_interface_mode      => PIPELINED,
       g_address_granularity => BYTE,
-      g_num_interrupts      => 32)
+      g_num_interrupts      => c_NUM_IRQS)
     port map (
       clk_sys_i    => clk_sys,
       rst_n_i      => rst_n_sys,
@@ -1054,7 +1055,6 @@ begin
   vic_irqs(1)           <= cnx_master_in(c_SLAVE_TXTSU).int;
   vic_irqs(2)           <= cnx_master_in(c_SLAVE_RTU).int;
   vic_irqs(3)           <= cnx_master_in(c_SLAVE_PSTATS).int;
-  vic_irqs(31 downto 4) <= (others => '0');
 
 -------------------------------------------------------------------------------
 -- Various constant-driven I/Os
-- 
GitLab