From 5e83b3e9491bdce6d1e5418db7ea5aec23789417 Mon Sep 17 00:00:00 2001
From: "Wesley W. Terpstra" <w.terpstra@gsi.de>
Date: Fri, 22 Apr 2016 18:45:29 +0200
Subject: [PATCH] sdb rom: g_masters is not a good choice for invalid value (it
 can happen)

0 is impossible, since it is the interconnect record
=> use it instead
---
 modules/wishbone/wb_crossbar/sdb_rom.vhd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/wishbone/wb_crossbar/sdb_rom.vhd b/modules/wishbone/wb_crossbar/sdb_rom.vhd
index aa09950f..a23e424b 100644
--- a/modules/wishbone/wb_crossbar/sdb_rom.vhd
+++ b/modules/wishbone/wb_crossbar/sdb_rom.vhd
@@ -49,7 +49,7 @@ architecture rtl of sdb_rom is
     end loop;
     
     if master = 0 then
-      result := (others => g_masters);
+      result := (others => 0);
     else
       assert master = g_masters
       report "Insufficient msi records found (" & Integer'image(master) & "/" & Integer'image(g_masters) & ")"
@@ -59,7 +59,7 @@ architecture rtl of sdb_rom is
   end f_master_positions;
   
   constant c_master_positions : t_nat_array := f_master_positions;
-  constant c_msi              : boolean     := c_master_positions(0) /= g_masters;
+  constant c_msi              : boolean     := c_master_positions(0) /= 0;
   
   function f_msi_flag_index(y : std_logic_vector) return std_logic_vector is
     variable offset : unsigned(c_rom_depth-1 downto 0) := (others => '0');
-- 
GitLab