signal cnt5 : integer range 0 to 4 := 4;
+ signal datain_i : std_logic_vector(9 downto 0) := (others => '0');
+ signal empty_i : std_logic := '0';
+ signal data_out_i : std_logic_vector(1 downto 0);
+
type output_fsm_type is (idle, readfifo, sending);
signal output_state : output_fsm_type := idle;
begin -- architecture rtl
+ -- purpose: register input signals to state machine
+ input_register : process (clk) is
+ begin -- process input_register
+ if rising_edge(clk) then -- rising clock edge
+ if reset = '1' then -- synchronous reset (active high)
+ datain_i <= (others => '0');
+ empty_i <= '0';
+ else
+ datain_i <= datain;
+ empty_i <= empty;
+ end if;
+ end if;
+ end process input_register;
+
output_proc : process (clk) is
begin -- process output_proc
if rising_edge(clk) then -- rising clock edge
if reset = '1' then
output_state <= idle;
cnt5 <= 0;
- dataout <= (others => '0');
+ data_out_i <= (others => '0');
else
- dataout <= (others => '0');
- rden <= '0';
+ data_out_i <= (others => '0');
+ rden <= '0';
case output_state is
when idle =>
cnt5 <= 0;
- if empty = '0' then
+ if empty_i = '0' then
output_state <= readfifo;
rden <= '1';
end if;
when readfifo =>
output_state <= sending;
when sending =>
- dataout <= datain((cnt5 + 1)*2 - 1 downto cnt5*2);
+ data_out_i <= datain_i((cnt5 + 1)*2 - 1 downto cnt5*2);
-- counter
if cnt5 < 4 then
cnt5 <= cnt5 + 1;
rden <= '1';
end if;
elsif cnt5 = 4 then
- if empty = '0' then
+ if empty_i = '0' then
output_state <= sending;
else
output_state <= idle;
end if;
end process output_proc;
+ data_output_pipe : process (clk) is
+ begin -- process data_output_pipe
+ if rising_edge(clk) then -- rising clock edge
+ if reset = '1' then -- synchronous reset (active high)
+ dataout <= (others => '0');
+ else
+ dataout <= data_out_i;
+ end if;
+ end if;
+ end process data_output_pipe;
+
end architecture rtl;
rden => fifo_rden_i,
dataout => data_out_i);
- data_output_pipe : process (sim_clk_i) is
- begin -- process data_output_pipe
- if rising_edge(sim_clk_i) then -- rising clock edge
- if reset_reg = '1' then -- synchronous reset (active high)
- data_out_reg <= (others => '0');
- else
- data_out_reg <= data_out_i;
- end if;
- end if;
- end process data_output_pipe;
-
simlink_oddr : ODDRXD1
port map (
SCLK => sim_clk_i,
- DA => data_out_reg(0),
- DB => data_out_reg(1),
+ DA => data_out_i(0),
+ DB => data_out_i(1),
Q => data_out);
dataclk <= data_clk_i;
signal word_cnt_i : unsigned(4 downto 0) := (others => '0');
signal slowdown_cnt_i : unsigned(15 downto 0) := (others => '0');
+ signal wr_en_i : std_logic := '0';
+ signal data_out_i : std_logic_vector(9 downto 0) := (others => '0');
+
begin -- architecture rtl
-- 8b10b encoding of data
begin -- process encoder_falling_to_rise
if rising_edge(clk) then -- rising clock edge
if reset = '1' then -- synchronous reset (active high)
- data_out <= (others => '0');
+ data_out_i <= (others => '0');
else
- data_out <= data_encoded_falling;
+ data_out_i <= data_encoded_falling;
end if;
end if;
end process encoder_falling_to_rise;
if rising_edge(clk) then
if reset = '1' then
wait_after_reset := 0;
- wr_en <= '0';
+ wr_en_i <= '0';
start_i <= '0';
wait_before_start := 0;
else
if wait_after_reset = 3 then
- wr_en <= '1';
+ wr_en_i <= '1';
else
wait_after_reset := wait_after_reset + 1;
end if;
end if;
end process mupix_proc;
+ data_output_pipe : process (clk) is
+ begin -- process data_output_pipe
+ if rising_edge(clk) then -- rising clock edge
+ if reset = '1' then -- synchronous reset (active high)
+ wr_en <= '0';
+ data_out <= (others => '0');
+ else
+ wr_en <= wr_en_i;
+ data_out <= data_out_i;
+ end if;
+ end if;
+ end process data_output_pipe;
+
end architecture rtl;