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

sdb rom: skip over unused masters

parent 2cf0213a
Branches
Tags
No related merge requests found
...@@ -29,25 +29,30 @@ architecture rtl of sdb_rom is ...@@ -29,25 +29,30 @@ architecture rtl of sdb_rom is
-- Index of the MSI entry in SDB -- Index of the MSI entry in SDB
type t_nat_array is array(g_masters-1 downto 0) of natural; type t_nat_array is array(g_masters-1 downto 0) of natural;
function f_master_positions return t_nat_array is function f_master_positions return t_nat_array is
variable typ : std_logic_vector(7 downto 0);
variable result : t_nat_array; variable result : t_nat_array;
variable master : natural := 0; variable master : natural := 0;
begin begin
for rec in c_layout'low to c_layout'high loop for rec in c_layout'low to c_layout'high loop
if c_layout(rec)(7 downto 0) = x"03" then typ := c_layout(rec)(7 downto 0);
assert master < g_masters case typ is
report "Too many msi records found" when x"03" | x"f3" =>
severity failure; assert master < g_masters
report "Too many msi records found"
severity failure;
result(master) := rec; result(master) := rec;
master := master + 1; master := master + 1;
end if;
when others => null;
end case;
end loop; end loop;
if master = 0 then if master = 0 then
result := (others => g_masters); result := (others => g_masters);
else else
assert master = g_masters assert master = g_masters
report "Insufficient msi records found" report "Insufficient msi records found (" & Integer'image(master) & "/" & Integer'image(g_masters) & ")"
severity failure; severity failure;
end if; end if;
return result; return result;
......
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