signal too_much_data : std_logic;
-signal rx_fifo_data : std_logic_vector(8 downto 0);
-
+signal rx_fifo_data : std_logic_vector(8 downto 0);
+signal tx_fifo_data : std_logic_vector(17 downto 0);
begin
RPReset => RESET,
WrClock => CLK,
RdClock => CLK,
- Data => rx_fifo_data, --PS_DATA_IN,
+ Data => rx_fifo_data,
WrEn => rx_fifo_wr,
RdEn => rx_fifo_rd,
Q => rx_fifo_q,
-- rx_fifo_rd <= '1';
-- else
-- rx_fifo_rd <= '0';
+-- end if;
+
+-- GSC_INIT_DATA_OUT(7 downto 0) <= rx_fifo_q(16 downto 9);
+-- GSC_INIT_DATA_OUT(15 downto 8) <= rx_fifo_q(7 downto 0);
+--
+-- if (GSC_INIT_READ_IN = '1' and dissect_current_state = LOAD_TO_HUB) or (dissect_current_state = WAIT_FOR_HUB) then
+-- gsc_init_dataready <= '1';
+-- else
+-- gsc_init_dataready <= '0';
-- end if;
rx_fifo_data <= PS_DATA_IN;
RPReset => tx_fifo_reset,
WrClock => CLK,
RdClock => CLK,
- Data(7 downto 0) => GSC_REPLY_DATA_IN(15 downto 8),
- Data(8) => '0',
- Data(16 downto 9) => GSC_REPLY_DATA_IN(7 downto 0),
- Data(17) => '0',
+ Data => tx_fifo_data,
WrEn => tx_fifo_wr,
RdEn => tx_fifo_rd,
Q => tx_fifo_q,
Full => tx_full,
Empty => tx_empty
);
+
+tx_fifo_data(7 downto 0) <= GSC_REPLY_DATA_IN(15 downto 8);
+tx_fifo_data(8) <= '0';
+tx_fifo_data(16 downto 9) <= GSC_REPLY_DATA_IN(7 downto 0);
+tx_fifo_data(17) <= '0';
+tx_fifo_wr <= '1' when (GSC_REPLY_DATAREADY_IN = '1' and gsc_reply_read = '1') else '0';
tx_fifo_reset <= '1' when (RESET = '1') or (too_much_data = '1' and dissect_current_state = CLEANUP) else '0';
-tx_fifo_wr <= '1' when GSC_REPLY_DATAREADY_IN = '1' and gsc_reply_read = '1' else '0';
tx_fifo_rd <= '1' when TC_RD_EN_IN = '1' and dissect_current_state = LOAD_FRAME and (tx_frame_loaded /= g_MAX_FRAME_SIZE) else '0';
+--TX_FIFO_SYNC_PROC : process(CLK)
+--begin
+-- if rising_edge(CLK) then
+-- if (GSC_REPLY_DATAREADY_IN = '1' and gsc_reply_read = '1') then
+-- tx_fifo_wr <= '1';
+-- else
+-- tx_fifo_wr <= '0';
+-- end if;
+-- end if;
+--end process TX_FIFO_SYNC_PROC;
+
TC_DATA_PROC : process(dissect_current_state, tx_loaded_ctr, tx_data_ctr, tx_frame_loaded, g_MAX_FRAME_SIZE)
begin
- if (dissect_current_state = LOAD_FRAME) then
-
- TC_DATA_OUT(7 downto 0) <= tx_fifo_q(7 downto 0);
-
- if (tx_loaded_ctr = tx_data_ctr or tx_frame_loaded = g_MAX_FRAME_SIZE - x"1") then
- TC_DATA_OUT(8) <= '1';
- else
- TC_DATA_OUT(8) <= '0';
- end if;
+ if (dissect_current_state = LOAD_FRAME) then
- elsif (dissect_current_state = LOAD_ACK) then
-
- TC_DATA_OUT(7 downto 0) <= tx_loaded_ctr(7 downto 0);
+ TC_DATA_OUT(7 downto 0) <= tx_fifo_q(7 downto 0);
+
+ if (tx_loaded_ctr = tx_data_ctr or tx_frame_loaded = g_MAX_FRAME_SIZE - x"1") then
+ TC_DATA_OUT(8) <= '1';
+ else
+ TC_DATA_OUT(8) <= '0';
+ end if;
+
+ elsif (dissect_current_state = LOAD_ACK) then
- if (tx_loaded_ctr = x"0010" + x"1") then
- TC_DATA_OUT(8) <= '1';
+ TC_DATA_OUT(7 downto 0) <= tx_loaded_ctr(7 downto 0);
+
+ if (tx_loaded_ctr = x"0010" + x"1") then
+ TC_DATA_OUT(8) <= '1';
+ else
+ TC_DATA_OUT(8) <= '0';
+ end if;
else
- TC_DATA_OUT(8) <= '0';
+ TC_DATA_OUT <= (others => '0');
end if;
- else
- TC_DATA_OUT <= (others => '0');
- end if;
end process TC_DATA_PROC;
GSC_REPLY_READ_OUT <= gsc_reply_read;