Browse Source

Guard test for value with to_ux01() function

pull/1/head
T. Meissner 8 years ago
parent
commit
cf1798b576
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      common/UtilsP.vhd

+ 4
- 2
common/UtilsP.vhd View File

@ -102,7 +102,9 @@ package body UtilsP is
variable v_return : natural := 0; variable v_return : natural := 0;
begin begin
for i in data'range loop for i in data'range loop
v_return := v_return + 1;
if (to_ux01(data(i)) = '1') then
v_return := v_return + 1;
end if;
end loop; end loop;
return v_return; return v_return;
end function count_ones; end function count_ones;
@ -117,7 +119,7 @@ package body UtilsP is
function is_unknown (data : in std_logic_vector) return boolean is function is_unknown (data : in std_logic_vector) return boolean is
begin begin
for i in data'range loop for i in data'range loop
if (data(i) = 'U') then
if (to_ux01(data(i)) = 'U') then
return true; return true;
end if; end if;
end loop; end loop;


Loading…
Cancel
Save