library IEEE;
|
library IEEE;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_1164.ALL;
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
|
|
-- Uncomment the following lines to use the declarations that are
|
-- Uncomment the following lines to use the declarations that are
|
-- provided for instantiating Xilinx primitive components.
|
-- provided for instantiating Xilinx primitive components.
|
--library UNISIM;
|
--library UNISIM;
|
--use UNISIM.VComponents.all;
|
--use UNISIM.VComponents.all;
|
|
|
entity txrx is
|
entity txrx is
|
Port ( clk : in std_logic;
|
Port ( clk : in std_logic;
|
rst : in std_logic;
|
rst : in std_logic;
|
Output_enable : in std_logic;
|
Output_enable : in std_logic;
|
mem_block : in std_logic;
|
mem_block : in std_logic;
|
--mem_ready : out std_logic;
|
--mem_ready : out std_logic;
|
wen : out std_logic;
|
wen : out std_logic;
|
address : out std_logic_vector(6 downto 0)
|
address : out std_logic_vector(6 downto 0)
|
);
|
);
|
end txrx;
|
end txrx;
|
|
|
architecture interface of txrx is
|
architecture interface of txrx is
|
|
|
signal ifsel: boolean;
|
signal ifsel: boolean;
|
signal add : std_logic_vector(6 downto 0);
|
signal add : std_logic_vector(6 downto 0);
|
signal wen_aux : std_logic;
|
signal wen_aux : std_logic;
|
begin
|
begin
|
|
|
wen <= wen_aux;
|
wen <= wen_aux;
|
address <= add;
|
address <= add;
|
process (clk,rst)
|
process (clk,rst)
|
begin
|
begin
|
if rst = '1' then
|
if rst = '1' then
|
add <= (others => '0');
|
add <= (others => '0');
|
wen_aux <= '0';
|
wen_aux <= '0';
|
elsif clk'event and clk='1' then
|
elsif clk'event and clk='1' then
|
if Output_enable = '1' then
|
if Output_enable = '1' then
|
wen_aux <= '1';
|
wen_aux <= '1';
|
if mem_block = '0' then
|
if mem_block = '0' then
|
add <= (others => '0');
|
add <= (others => '0');
|
else
|
else
|
add <= conv_std_logic_vector(64,7);
|
add <= conv_std_logic_vector(64,7);
|
end if;
|
end if;
|
elsif wen_aux = '1' then
|
elsif wen_aux = '1' then
|
if (add(5 downto 0) /= 63) then
|
if (add(5 downto 0) /= 63) then
|
add <= add + 1;
|
add <= add + 1;
|
else
|
else
|
wen_aux <= '0';
|
wen_aux <= '0';
|
add <= add;
|
add <= add;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|
|
|
|
|