write_address <= wp ( wp ' high - 1 downto 0 ) ;
process ( write_clock , reset ) is
begin
if reset = '1' then
afull <= '0' ;
full <= '0' ;
wp <= ( others => '0' ) ;
elsif rising_edge ( write_clock ) then
almost_full <= '0' ;
full <= '0' ;
if write_request = '1' then
wp <= wp + 1 ;
end if ;
if
wp ( wp ' high - 1 downto 0 ) = rp_from_read_clock_domain ( rp_from_read_clock_domain ' high - 1 downto 0 ) and
wp ( wp ' high ) /= wp ( wp ' high ) then
full <= '1' ;
else
full <= '0' ;
end if ;
if rp_from_read_clock_domain ( rp_from_read_clock_domain ' high - 1 downto 0 ) - wp ( wp ' high - 1 downto 0 ) <= afull_threshold then
afull <= '1' ;
else
afull <= '0' ;
end if ;
end if ;
end process ;