SCI_WR : out std_logic;
WA_POS_OUT : out std_logic_vector(15 downto 0);
- WA_READ_OUT : out std_logic;
- LINK_RX_READY_IN : in std_logic;
--Slowcontrol
BUS_RX : in CTRLBUS_RX;
signal sci_timer : unsigned(12 downto 0) := (others => '0');
signal wa_position : std_logic_vector(15 downto 0);
signal next_sci_wr : std_logic;
-signal wa_read_i : std_logic;
begin
SCI_RD <= '0';
next_sci_wr <= '0';
sci_timer <= sci_timer + 1;
- wa_read_i <= '0';
if BUS_RX.read = '1' or BUS_RX.write = '1' then
SCI_SEL(0) <= not BUS_RX.addr(6) and not BUS_RX.addr(7) and not BUS_RX.addr(8);
SCI_SEL(1) <= BUS_RX.addr(6) and not BUS_RX.addr(7) and not BUS_RX.addr(8);
SCI_RD <= BUS_RX.read and not (BUS_RX.addr(6) and not BUS_RX.addr(7) and BUS_RX.addr(8));
next_sci_wr <= BUS_RX.write and not (BUS_RX.addr(6) and not BUS_RX.addr(7) and BUS_RX.addr(8));
sci_state <= SCTRL;
- elsif (sci_timer(sci_timer'left) = '1') and (LINK_RX_READY_IN = '0') then
- sci_timer <= (others => '0');
- sci_state <= GET_WA;
- wa_read_i <= '1';
+-- elsif sci_timer(sci_timer'left) = '1' then
+-- sci_timer <= (others => '0');
+-- sci_state <= GET_WA;
end if;
when SCTRL =>
if sci_reg_i = '1' then
sci_state <= IDLE;
else
sci_state <= GET_WA_WAIT;
- wa_read_i <= '1';
if FPGA_TYPE = 3 then
SCI_ADDR <= "100010";--'0' & x"22"; --for ECP3
elsif FPGA_TYPE = 5 then
end if;
when GET_WA_WAIT =>
sci_state <= GET_WA_WAIT2;
- wa_read_i <= '1';
when GET_WA_WAIT2 =>
sci_state <= GET_WA_FINISH;
- wa_read_i <= '1';
when GET_WA_FINISH =>
wa_position(cnt*4+3 downto cnt*4) <= SCI_RDDATA(3 downto 0);
- sci_state <= GET_WA;
- wa_read_i <= '1';
+ sci_state <= GET_WA;
cnt := cnt + 1;
end case;
end process;
-WA_READ_OUT <= wa_read_i;
-
end architecture;