Line 43... |
Line 43... |
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
--
|
--
|
-- CVS Revision History
|
-- CVS Revision History
|
--
|
--
|
-- $Log: not supported by cvs2svn $
|
-- $Log: not supported by cvs2svn $
|
|
-- Revision 1.2 2004/07/17 17:21:11 gedra
|
|
-- Fixed bug.
|
|
--
|
-- Revision 1.1 2004/07/14 17:58:19 gedra
|
-- Revision 1.1 2004/07/14 17:58:19 gedra
|
-- Transmitter channel status buffer.
|
-- Transmitter channel status buffer.
|
--
|
--
|
--
|
--
|
--
|
--
|
Line 67... |
Line 70... |
buf_data_b: out std_logic_vector(191 downto 0));
|
buf_data_b: out std_logic_vector(191 downto 0));
|
end tx_bitbuf;
|
end tx_bitbuf;
|
|
|
architecture rtl of tx_bitbuf is
|
architecture rtl of tx_bitbuf is
|
|
|
|
type buf_type is array (0 to 23) of std_logic_vector(7 downto 0);
|
|
signal buffer_a, buffer_b: buf_type;
|
|
|
begin
|
begin
|
|
|
-- the byte buffer is 192 bits (24 bytes) for each channel
|
-- the byte buffer is 192 bits (24 bytes) for each channel
|
EB: if ENABLE_BUFFER = 1 generate
|
EB: if ENABLE_BUFFER = 1 generate
|
WBUF: process (wb_clk_i, wb_rst_i)
|
WBUF: process (wb_clk_i, wb_rst_i)
|
begin
|
begin
|
if wb_rst_i = '1' then
|
if wb_rst_i = '1' then
|
buf_data_a(191 downto 0) <= (others => '0');
|
for i in 0 to 23 loop
|
buf_data_b(191 downto 0) <= (others => '0');
|
buffer_a(i) <= (others => '0');
|
|
buffer_b(i) <= (others => '0');
|
|
end loop;
|
elsif rising_edge(wb_clk_i) then
|
elsif rising_edge(wb_clk_i) then
|
if buf_wr = '1' and to_integer(unsigned(wb_adr_i)) < 24 then
|
if buf_wr = '1' and to_integer(unsigned(wb_adr_i)) < 24 then
|
buf_data_a(8*to_integer(unsigned(wb_adr_i)) + 7 downto to
|
buffer_a(to_integer(unsigned(wb_adr_i))) <= wb_dat_i(7 downto 0);
|
8*to_integer(unsigned(wb_adr_i))) <= wb_dat_i(7 downto 0);
|
buffer_b(to_integer(unsigned(wb_adr_i))) <= wb_dat_i(15 downto 8);
|
buf_data_b(8*to_integer(unsigned(wb_adr_i)) + 7 downto
|
|
8*to_integer(unsigned(wb_adr_i))) <= wb_dat_i(15 downto 8);
|
|
end if;
|
end if;
|
end if;
|
end if;
|
end process WBUF;
|
end process WBUF;
|
|
VGEN: for k in 0 to 23 generate
|
|
buf_data_a(8 * k + 7 downto 8 * k) <= buffer_a(k);
|
|
buf_data_b(8 * k + 7 downto 8 * k) <= buffer_b(k);
|
|
end generate VGEN;
|
end generate EB;
|
end generate EB;
|
|
|
-- if the byte buffer is not enabled, set all bits to zero
|
-- if the byte buffer is not enabled, set all bits to zero
|
NEB: if ENABLE_BUFFER = 0 generate
|
NEB: if ENABLE_BUFFER = 0 generate
|
buf_data_a(191 downto 0) <= (others => '0');
|
buf_data_a(191 downto 0) <= (others => '0');
|