Browse Source

slv versions of or_ and and_ reduce now with looped combinatorals

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

+ 6
- 8
common/UtilsP.vhd View File

@ -38,13 +38,12 @@ package body UtilsP is
function and_reduce (data : in std_logic_vector) return std_logic is function and_reduce (data : in std_logic_vector) return std_logic is
variable v_return : std_logic := '1';
begin begin
for i in data'range loop for i in data'range loop
if data(i) = '0' then
return '0';
end if;
v_return := v_return and data(i);
end loop; end loop;
return '1';
return v_return;
end function and_reduce; end function and_reduce;
function and_reduce (data : in boolean_vector) return boolean is function and_reduce (data : in boolean_vector) return boolean is
@ -59,13 +58,12 @@ package body UtilsP is
function or_reduce (data : in std_logic_vector) return std_logic is function or_reduce (data : in std_logic_vector) return std_logic is
variable v_return : std_logic := '0';
begin begin
for i in data'range loop for i in data'range loop
if data(i) = '1' then
return '1';
end if;
v_return := v_return or data(i);
end loop; end loop;
return '0';
return v_return;
end function or_reduce; end function or_reduce;
function or_reduce (data : in boolean_vector) return boolean is function or_reduce (data : in boolean_vector) return boolean is


Loading…
Cancel
Save