Skip to content
Snippets Groups Projects
Commit 5e83b3e9 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

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
parent 31f64b66
No related merge requests found
...@@ -49,7 +49,7 @@ architecture rtl of sdb_rom is ...@@ -49,7 +49,7 @@ architecture rtl of sdb_rom is
end loop; end loop;
if master = 0 then if master = 0 then
result := (others => g_masters); result := (others => 0);
else else
assert master = g_masters assert master = g_masters
report "Insufficient msi records found (" & Integer'image(master) & "/" & Integer'image(g_masters) & ")" report "Insufficient msi records found (" & Integer'image(master) & "/" & Integer'image(g_masters) & ")"
...@@ -59,7 +59,7 @@ architecture rtl of sdb_rom is ...@@ -59,7 +59,7 @@ architecture rtl of sdb_rom is
end f_master_positions; end f_master_positions;
constant c_master_positions : t_nat_array := 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 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'); variable offset : unsigned(c_rom_depth-1 downto 0) := (others => '0');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment