Remove non-Quartus-supported VHDL 2008 features. Remove inferred Latches. Add test Entities to see resulting hw synthesis of various code segments.
38 lines
885 B
VHDL
38 lines
885 B
VHDL
library ieee;
|
|
use ieee.std_logic_1164.all;
|
|
use ieee.numeric_std.all;
|
|
|
|
use work.math_pkg.all;
|
|
use work.rtps_package.all;
|
|
|
|
-- Test synthesis of SLV bit counter
|
|
|
|
entity test is
|
|
port (
|
|
clk : in std_logic;
|
|
reset : in std_logic;
|
|
input : in std_logic_vector(31 downto 0);
|
|
output : out std_logic_vector(31 downto 0)
|
|
);
|
|
end entity;
|
|
|
|
architecture arch of test is
|
|
|
|
function bitmap_converter(input : std_logic_vector) return natural is
|
|
variable ret : natural := 0;
|
|
begin
|
|
for i in 0 to input'length-1 loop
|
|
ret := ret + 1;
|
|
if (input(i) = '1') then
|
|
exit;
|
|
end if;
|
|
end loop;
|
|
return ret;
|
|
end function;
|
|
|
|
begin
|
|
|
|
output <= std_logic_vector(to_unsigned(bitmap_converter(input), output'length));
|
|
|
|
end architecture;
|