port(
CLK_SYS : in std_logic;
CLK : in std_logic;
+ CLK_80 : in std_logic;
RESET : in std_logic;
BUS_RX : in CTRLBUS_RX;
begin
+ gbtsc_tx_clk_en <= '1';
+ gbtsc_rx_clk_en <= '1';
+
THE_GBTSC_TOP : entity work.gbtsc_top
generic map(
-- IC configuration
-- shift signals to the next high enable
PROC_SHIFT_TX_EN : process
- variable reg_res : std_logic_vector(1 downto 0) := "00";
- variable reg_con : std_logic_vector(1 downto 0) := "00";
- variable reg_cmd : std_logic_vector(1 downto 0) := "00";
- begin
- wait until rising_edge(CLK);
- reg_res := reg_res(0) & gbtsc_start_reset_cmd_raw;
- reg_con := reg_con(0) & gbtsc_start_connect_cmd_raw;
- reg_cmd := reg_cmd(0) & gbtsc_start_command_raw;
- gbtsc_start_reset_cmd_i <= (reg_res(0) and not gbtsc_tx_clk_en ) or (reg_res(1) and not gbtsc_tx_clk_en);
- gbtsc_start_connect_cmd_i <= (reg_con(0) and not gbtsc_tx_clk_en ) or (reg_con(1) and not gbtsc_tx_clk_en);
- gbtsc_start_command_i <= (reg_cmd(0) and not gbtsc_tx_clk_en ) or (reg_cmd(1) and not gbtsc_tx_clk_en);
- end process;
+ variable reg_res : std_logic_vector(1 downto 0) := "00";
+ variable reg_con : std_logic_vector(1 downto 0) := "00";
+ variable reg_cmd : std_logic_vector(1 downto 0) := "00";
+ begin
+ wait until rising_edge(CLK);
+ reg_res := reg_res(0) & gbtsc_start_reset_cmd_raw;
+ reg_con := reg_con(0) & gbtsc_start_connect_cmd_raw;
+ reg_cmd := reg_cmd(0) & gbtsc_start_command_raw;
+ gbtsc_start_reset_cmd_i <= (reg_res(0) and not gbtsc_tx_clk_en ) or (reg_res(1) and not gbtsc_tx_clk_en);
+ gbtsc_start_connect_cmd_i <= (reg_con(0) and not gbtsc_tx_clk_en ) or (reg_con(1) and not gbtsc_tx_clk_en);
+ gbtsc_start_command_i <= (reg_cmd(0) and not gbtsc_tx_clk_en ) or (reg_cmd(1) and not gbtsc_tx_clk_en);
+ end process;
PROC_SYNC_REG : process
end process;
+ -- -- HDLC serializer
+ -- hdlcser_proc: process(CLK_80)
+ -- begin
+ -- if rising_edge(CLK_80) then
+ -- gbtsc_tx_clk_en <= gbtsc_tx_clk_en xor '1';
+ -- if gbtsc_tx_clk_en = '1' then
+ -- ELINK_TX <= hdlc_from_gbtsc(0);
+ -- elsif gbtsc_tx_clk_en = '0' then
+ -- ELINK_TX <= hdlc_from_gbtsc(1);
+ -- end if;
+ -- end if;
+ -- end process;
+
-- HDLC serializer
- hdlcser_proc: process(CLK)
+ hdlcser_proc: process(CLK_80)
begin
- if rising_edge(CLK) then
- gbtsc_tx_clk_en <= gbtsc_tx_clk_en xor '1';
- if gbtsc_tx_clk_en = '1' then
+ if rising_edge(CLK_80) then
+ if CLK = '1' then
ELINK_TX <= hdlc_from_gbtsc(0);
- elsif gbtsc_tx_clk_en = '0' then
+ elsif CLK = '0' then
ELINK_TX <= hdlc_from_gbtsc(1);
end if;
end if;
end process;
+ -- -- HDLC deserializer
+ -- hdlcdes_proc: process(CLK)
+ -- variable hdlc_des: std_logic_vector(1 downto 0);
+ -- begin
+ -- if rising_edge(CLK) then
+ -- gbtsc_rx_clk_en <= gbtsc_rx_clk_en xor '1';
+ -- hdlc_des := hdlc_des(0) & ELINK_RX;
+ -- if gbtsc_rx_clk_en = '1' then
+ -- hdlc_to_gbtsc <= hdlc_des;
+ -- end if;
+ -- end if;
+ -- end process;
+
-- HDLC deserializer
- hdlcdes_proc: process(CLK)
+ hdlcdes_proc: process(CLK_80)
+ variable hdlc_des: std_logic_vector(1 downto 0);
begin
- if rising_edge(CLK) then
- gbtsc_rx_clk_en <= gbtsc_rx_clk_en xor '1';
- if gbtsc_rx_clk_en = '1' then
- hdlc_to_gbtsc(1) <= ELINK_RX;
- elsif gbtsc_rx_clk_en = '0' then
- hdlc_to_gbtsc(0) <= ELINK_RX;
+ if rising_edge(CLK_80) then
+ hdlc_des := hdlc_des(0) & ELINK_RX;
+ if CLK = '1' then
+ hdlc_to_gbtsc <= hdlc_des;
end if;
end if;
end process;
+
PROC_GBTSCA_REG_CMDS : process
begin
wait until rising_edge(CLK_SYS);