end process CLOCK2_GEN_PROC;
-SCTRL_TESTBENCH_PROC : process
-begin
-
-for j in 0 to 5000 loop
-
- reply_dataready <= '0';
- reply_busy <= '0';
- reply_data <= (others => '0');
-
- wait for 76 us;
-
- for i in 0 to 1000 loop
-
- wait until rising_edge(clk);
- reply_dataready <= '1';
- reply_busy <= '1';
- reply_data <= std_logic_vector(to_unsigned(i, 16));
-
- end loop;
- wait until rising_edge(clk);
- reply_dataready <= '0';
- reply_busy <= '0';
-
- wait for 13 us;
-end loop;
-
-end process SCTRL_TESTBENCH_PROC;
+--SCTRL_TESTBENCH_PROC : process
+--begin
+--
+--for j in 0 to 5000 loop
+--
+-- reply_dataready <= '0';
+-- reply_busy <= '0';
+-- reply_data <= (others => '0');
+--
+-- wait for 76 us;
+--
+-- for i in 0 to 1000 loop
+--
+-- wait until rising_edge(clk);
+-- reply_dataready <= '1';
+-- reply_busy <= '1';
+-- reply_data <= std_logic_vector(to_unsigned(i, 16));
+--
+-- end loop;
+-- wait until rising_edge(clk);
+-- reply_dataready <= '0';
+-- reply_busy <= '0';
+--
+-- wait for 13 us;
+--end loop;
+--
+--end process SCTRL_TESTBENCH_PROC;
--ip_cfg_start_in <= '1';
- wait for 500 ns;
+ wait for 700 us;
-------------------------------------------------------------------------------
wait until rising_edge(RX_MAC_CLK);
MAC_RX_EN_IN <= '1';
-- dest mac
- MAC_RXD_IN <= x"02";
+-- MAC_RXD_IN <= x"02";
+-- wait until rising_edge(RX_MAC_CLK);
+-- MAC_RXD_IN <= x"00";
+-- wait until rising_edge(RX_MAC_CLK);
+-- MAC_RXD_IN <= x"be";
+-- wait until rising_edge(RX_MAC_CLK);
+-- MAC_RXD_IN <= x"00";
+-- wait until rising_edge(RX_MAC_CLK);
+-- MAC_RXD_IN <= x"00";
+-- wait until rising_edge(RX_MAC_CLK);
+-- MAC_RXD_IN <= x"00";
+-- wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"ff";
wait until rising_edge(RX_MAC_CLK);
- MAC_RXD_IN <= x"00";
+ MAC_RXD_IN <= x"ff";
wait until rising_edge(RX_MAC_CLK);
- MAC_RXD_IN <= x"be";
+ MAC_RXD_IN <= x"ff";
wait until rising_edge(RX_MAC_CLK);
- MAC_RXD_IN <= x"00";
+ MAC_RXD_IN <= x"ff";
wait until rising_edge(RX_MAC_CLK);
- MAC_RXD_IN <= x"00";
+ MAC_RXD_IN <= x"ff";
wait until rising_edge(RX_MAC_CLK);
- MAC_RXD_IN <= x"00";
+ MAC_RXD_IN <= x"ff";
wait until rising_edge(RX_MAC_CLK);
-- src mac
MAC_RXD_IN <= x"00";
wait until rising_edge(RX_MAC_CLK);
MAC_RXD_IN <= x"00";
wait until rising_edge(RX_MAC_CLK);
- MAC_RXD_IN <= x"de";
+ MAC_RXD_IN <= x"00";
wait until rising_edge(RX_MAC_CLK);
- MAC_RXD_IN <= x"ad";
+ MAC_RXD_IN <= x"00";
wait until rising_edge(RX_MAC_CLK);
MAC_RXD_IN <= x"fa";
wait until rising_edge(RX_MAC_CLK);
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RX_EN_IN <= '1';
+-- dest mac
+ MAC_RXD_IN <= x"02";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"be";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+-- src mac
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"aa";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"bb";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"cc";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"dd";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"ee";
+ wait until rising_edge(RX_MAC_CLK);
+-- frame type
+ MAC_RXD_IN <= x"08";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+-- ip headers
+ MAC_RXD_IN <= x"45";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"10";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"01";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"5a";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"49";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"ff";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"11"; -- udp
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"cc";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"cc";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"c0";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"a8";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"01";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"c0";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"a8";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"02";
+-- udp headers
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"43";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"44";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"02";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"2c";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"aa";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"bb";
+-- dhcp data
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"02";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"01";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"06";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"fa";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"ce";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"c0";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"a8";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"10";
+
+ for i in 0 to 219 loop
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ end loop;
+
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"35";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"01";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"02";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RXD_IN <= x"00";
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RX_EOF_IN <= '1';
+ wait until rising_edge(RX_MAC_CLK);
+ MAC_RX_EN_IN <='0';
+ MAC_RX_EOF_IN <= '0';
signal reset_dhcp : std_logic;
signal dbg_hist, dbg_hist2 : hist_array;
signal soft_gbe_reset, soft_rst, dhcp_done : std_logic;
-signal rst_ctr : std_logic_vector(25 downto 0);
+signal rst_ctr : std_logic_vector(24 downto 0);
+signal mac_reset : std_logic;
+signal global_reset : std_logic;
begin
stage_ctrl_regs <= STAGE_CTRL_REGS_IN;
+global_reset <= not GSR_N;
+
-- gk 23.04.10
LED_PACKET_SENT_OUT <= '0'; --timeout_noticed; --pc_ready;
LED_AN_DONE_N_OUT <= '0'; --not link_ok; --not pcs_an_complete;
--reset_dhcp <= not GSR_N;
-
-process(CLK)
-begin
- if rising_edge(CLK) then
- if (GSR_N = '0') then
- rst_ctr <= (others => '0');
- else
- rst_ctr <= rst_ctr + x"1";
- end if;
- end if;
-end process;
-
-soft_gbe_reset <= '1' when soft_rst = '1' or (dhcp_done = '0' and rst_ctr(25) = '1') else '0';
+--soft_gbe_reset <= '1' when soft_rst = '1' or (dhcp_done = '0' and rst_ctr(24) = '1') else '0';
MAIN_CONTROL : trb_net16_gbe_main_control
port map(
CLK => CLK,
CLK_125 => serdes_clk_125,
- RESET => RESET,
- RESET_FOR_DHCP => soft_gbe_reset, --'0', --reset_dhcp,
+ RESET => global_reset, --RESET,
+ RESET_FOR_DHCP => global_reset, --'0', --soft_gbe_reset, --'0', --reset_dhcp,
MC_LINK_OK_OUT => link_ok,
MC_RESET_LINK_IN => '0',
TRANSMIT_CONTROLLER : trb_net16_gbe_transmit_control2
port map(
CLK => CLK,
- RESET => RESET,
+ RESET => global_reset, --RESET,
-- signal to/from main controller
TC_DATAREADY_IN => mc_transmit_ctrl,
SETUP : gbe_setup
port map(
CLK => CLK,
- RESET => RESET,
+ RESET => global_reset, --RESET,
-- interface to regio bus
BUS_ADDR_IN => BUS_ADDR_IN,
FRAME_CONSTRUCTOR: trb_net16_gbe_frame_constr
port map(
-- ports for user logic
- RESET => RESET,
+ RESET => global_reset, --RESET,
CLK => CLK,
LINK_OK_IN => '1', --link_ok,
--
RECEIVE_CONTROLLER : trb_net16_gbe_receive_control
port map(
CLK => CLK,
- RESET => RESET,
+ RESET => global_reset, --RESET,
-- signals to/from frame_receiver
RC_DATA_IN => fr_q,
FRAME_TRANSMITTER: trb_net16_gbe_frame_trans
port map(
CLK => CLK,
- RESET => RESET,
+ RESET => global_reset, --RESET,
LINK_OK_IN => link_ok, --pcs_an_complete, -- gk 03.08.10 -- gk 30.09.10
TX_MAC_CLK => serdes_clk_125,
TX_EMPTY_IN => ft_tx_empty,
FRAME_RECEIVER : trb_net16_gbe_frame_receiver
port map(
CLK => CLK,
- RESET => RESET,
+ RESET => global_reset, --RESET,
LINK_OK_IN => link_ok,
ALLOW_RX_IN => allow_rx,
RX_MAC_CLK => serdes_rx_clk, --serdes_clk_125,
end if;
end process TIMEOUT_NOTICED_PROC;
+ mac_reset <= not RESET;
-- MAC part
MAC: tsmac35 --tsmac36 --tsmac35
USE_125MHZ_EXTCLK => 0
)
port map(
- RESET => soft_gbe_reset, --RESET,
+ RESET => global_reset, --soft_gbe_reset, --RESET,
GSR_N => GSR_N,
CLK_125_OUT => serdes_clk_125,
CLK_125_RX_OUT => serdes_rx_clk, --open,
USE_125MHZ_EXTCLK => 1
)
port map(
- RESET => soft_gbe_reset, --RESET,
+ RESET => global_reset, --soft_gbe_reset, --RESET,
GSR_N => GSR_N,
CLK_125_OUT => serdes_clk_125,
CLK_125_RX_OUT => serdes_rx_clk,
SFP_TXD_N_OUT <= '0';
SFP_TXDIS_OUT <= '0';
-
+ mac_rxd <= MAC_RXD_IN;
+ mac_rx_eof <= MAC_RX_EOF_IN;
+ mac_rx_en <= MAC_RX_EN_IN;
+
+ serdes_rx_clk <= TEST_CLK;
+
end generate sim_gen;
SAVE_SUB_HDR_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- save_sub_hdr_current_state <= IDLE;
- else
+ if RESET = '1' then
+ save_sub_hdr_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- save_sub_hdr_current_state <= IDLE;
+-- else
save_sub_hdr_current_state <= save_sub_hdr_next_state;
- end if;
+-- end if;
end if;
end process SAVE_SUB_HDR_MACHINE_PROC;
LOAD_MACHINE_PROC : process(CLK) is
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- load_current_state <= IDLE;
- else
+ if RESET = '1' then
+ load_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- load_current_state <= IDLE;
+-- else
load_current_state <= load_next_state;
- end if;
+-- end if;
end if;
end process LOAD_MACHINE_PROC;
\r
constructMachineProc: process( CLK )\r
begin\r
- if( rising_edge(CLK) ) then\r
- if( RESET = '1' ) then\r
- constructCurrentState <= IDLE;\r
- else\r
+ if RESET = '1' then\r
+ constructCurrentState <= IDLE;\r
+ elsif( rising_edge(CLK) ) then\r
+-- if( RESET = '1' ) then\r
+-- constructCurrentState <= IDLE;\r
+-- else\r
constructCurrentState <= constructNextState;\r
- end if;\r
+-- end if;\r
end if;\r
end process constructMachineProc;\r
\r
\r
transmitMachineProc: process( RD_CLK )\r
begin\r
- if( rising_edge(RD_CLK) ) then\r
- if( RESET = '1' ) or (link_ok_125 = '0') then -- gk 01.10.10\r
+ if RESET = '1' then\r
+ transmitCurrentState <= T_IDLE;\r
+ elsif( rising_edge(RD_CLK) ) then\r
+ if (link_ok_125 = '0') then -- gk 01.10.10\r
transmitCurrentState <= T_IDLE;\r
else\r
transmitCurrentState <= transmitNextState;\r
NEW_FRAME_PROC : process(RX_MAC_CLK)
begin
if rising_edge(RX_MAC_CLK) then
- if (RESET = '1') or (MAC_RX_EOF_IN = '1') then
+ if (LINK_OK_IN = '0' or MAC_RX_EOF_IN = '1') then
new_frame <= '0';
new_frame_lock <= '0';
elsif (new_frame_lock = '0') and (MAC_RX_EN_IN = '1') then
new_frame_lock <= '1';
else
new_frame <= '0';
+ new_frame_lock <= new_frame_lock;
end if;
end if;
end process NEW_FRAME_PROC;
FILTER_MACHINE_PROC : process(RX_MAC_CLK)
begin
- if rising_edge(RX_MAC_CLK) then
- if (RESET = '1') then
- filter_current_state <= IDLE;
- else
+ if RESET = '1' then
+ filter_current_state <= IDLE;
+ elsif rising_edge(RX_MAC_CLK) then
+-- if (RESET = '1') then
+-- filter_current_state <= IDLE;
+-- else
filter_current_state <= filter_next_state;
- end if;
+-- end if;
end if;
end process FILTER_MACHINE_PROC;
\r
TransmitStateMachineProc : process (TX_MAC_CLK)\r
begin\r
- if rising_edge(TX_MAC_CLK) then\r
- if (RESET = '1') or (LINK_OK_IN = '0') then -- gk 01.10.10\r
+ if RESET = '1' then\r
+ transmitCurrentState <= T_IDLE;\r
+ elsif rising_edge(TX_MAC_CLK) then\r
+ if (LINK_OK_IN = '0') then -- gk 01.10.10\r
transmitCurrentState <= T_IDLE;\r
else\r
transmitCurrentState <= transmitNextState;\r
SAVE_MACHINE_PROC : process(CLK_IPU)
begin
- if rising_edge(CLK_IPU) then
- if (RESET = '1') then
+ if RESET = '1' then
save_current_state <= IDLE;
- else
+ elsif rising_edge(CLK_IPU) then
+-- if (RESET = '1') then
+-- save_current_state <= IDLE;
+-- else
save_current_state <= save_next_state;
- end if;
+-- end if;
end if;
end process SAVE_MACHINE_PROC;
LOAD_MACHINE_PROC : process(CLK_GBE)
begin
- if rising_edge(CLK_GBE) then
- if (RESET = '1') then
- load_current_state <= IDLE;
- else
+ if RESET = '1' then
+ load_current_state <= IDLE;
+ elsif rising_edge(CLK_GBE) then
+-- if (RESET = '1') then
+-- load_current_state <= IDLE;
+-- else
load_current_state <= load_next_state;
- end if;
+-- end if;
end if;
end process LOAD_MACHINE_PROC;
MAC_CONF_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- mac_conf_current_state <= IDLE;
- else
+ if RESET = '1' then
+ mac_conf_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- mac_conf_current_state <= IDLE;
+-- else
mac_conf_current_state <= mac_conf_next_state;
- end if;
+-- end if;
end if;
end process MAC_CONF_MACHINE_PROC;
signal tsm_hwrite_n : std_logic;
signal tsm_hread_n : std_logic;
-type link_states is (ACTIVE, INACTIVE, ENABLE_MAC, TIMEOUT, FINALIZE, WAIT_FOR_BOOT, GET_ADDRESS);
+type link_states is (INACTIVE, ACTIVE, ENABLE_MAC, TIMEOUT, FINALIZE, WAIT_FOR_BOOT, GET_ADDRESS);
signal link_current_state, link_next_state : link_states;
attribute syn_encoding of link_current_state : signal is "onehot";
REDIRECT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
+ if RESET = '1' then
redirect_current_state <= IDLE;
- else
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- redirect_current_state <= IDLE;
+-- else
redirect_current_state <= redirect_next_state;
- end if;
+-- end if;
end if;
end process REDIRECT_MACHINE_PROC;
FLOW_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- flow_current_state <= IDLE;
- else
+ if RESET = '1' then
+ flow_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- flow_current_state <= IDLE;
+-- else
flow_current_state <= flow_next_state;
- end if;
+-- end if;
end if;
end process FLOW_MACHINE_PROC;
LINK_STATE_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- --if (RESET = '1') then
- if (RESET_FOR_DHCP = '1') then
- if (g_SIMULATE = 0) then
- link_current_state <= INACTIVE;
- else
- link_current_state <= FINALIZE; --ACTIVE; --GET_ADDRESS; --ACTIVE;
- end if;
- else
+ if RESET = '1' then
+ link_current_state <= INACTIVE;
+ elsif rising_edge(CLK) then
+-- --if (RESET = '1') then
+-- if (RESET_FOR_DHCP = '1') then
+-- if (g_SIMULATE = 0) then
+-- link_current_state <= INACTIVE;
+-- else
+-- link_current_state <= FINALIZE; --ACTIVE; --GET_ADDRESS; --ACTIVE;
+-- end if;
+-- else
link_current_state <= link_next_state;
- end if;
+-- end if;
end if;
end process;
LINK_STATE_MACHINE : process(link_current_state, dhcp_done, wait_ctr, PCS_AN_COMPLETE_IN, tsm_ready, link_ok_timeout_ctr)
begin
case link_current_state is
-
- when ACTIVE =>
- link_state <= x"1";
- if (PCS_AN_COMPLETE_IN = '0') then
- link_next_state <= INACTIVE;
- else
- link_next_state <= ACTIVE;
- end if;
-
+
when INACTIVE =>
link_state <= x"2";
if (PCS_AN_COMPLETE_IN = '1') then
else
link_next_state <= INACTIVE;
end if;
-
+
when TIMEOUT =>
link_state <= x"3";
if (PCS_AN_COMPLETE_IN = '0') then
if (PCS_AN_COMPLETE_IN = '0') then
link_next_state <= INACTIVE;
else
- if (wait_ctr = x"0010_0000") then
+ if (wait_ctr = x"0000_1000") then
link_next_state <= GET_ADDRESS;
else
link_next_state <= WAIT_FOR_BOOT;
link_next_state <= GET_ADDRESS;
end if;
end if;
+
+ when ACTIVE =>
+ link_state <= x"1";
+ if (PCS_AN_COMPLETE_IN = '0') then
+ link_next_state <= INACTIVE;
+ else
+ link_next_state <= ACTIVE;
+ end if;
end case;
end process LINK_STATE_MACHINE;
-- Construction state machine
constructMachineProc : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- constructCurrentState <= CIDLE;
- else
+ if RESET = '1' then
+ constructCurrentState <= CIDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- constructCurrentState <= CIDLE;
+-- else
constructCurrentState <= constructNextState;
- end if;
+-- end if;
end if;
end process constructMachineProc;
loadMachineProc : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
+ if RESET = '1' then
loadCurrentState <= LIDLE;
- else
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- loadCurrentState <= LIDLE;
+-- else
loadCurrentState <= loadNextState;
- end if;
+-- end if;
end if;
end process loadMachineProc;
saveSubMachineProc : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- saveSubCurrentState <= SIDLE;
- else
+ if RESET = '1' then
+ saveSubCurrentState <= SIDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- saveSubCurrentState <= SIDLE;
+-- else
saveSubCurrentState <= saveSubNextState;
- end if;
+-- end if;
end if;
end process saveSubMachineProc;
SELECT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- select_current_state <= IDLE;
- else
+ if RESET = '1' then
+ select_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- select_current_state <= IDLE;
+-- else
select_current_state <= select_next_state;
- end if;
+-- end if;
end if;
end process SELECT_MACHINE_PROC;
LOAD_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- load_current_state <= IDLE;
- else
+ if RESET = '1' then
+ load_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- load_current_state <= IDLE;
+-- else
load_current_state <= load_next_state;
- end if;
+-- end if;
end if;
end process LOAD_MACHINE_PROC;
DISSECT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- dissect_current_state <= IDLE;
- else
+ if RESET = '1' then
+ dissect_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- dissect_current_state <= IDLE;
+-- else
dissect_current_state <= dissect_next_state;
- end if;
+-- end if;
end if;
end process DISSECT_MACHINE_PROC;
MAIN_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- main_current_state <= BOOTING;
- else
+ if RESET = '1' then
+ main_current_state <= BOOTING;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- main_current_state <= BOOTING;
+-- else
main_current_state <= main_next_state;
- end if;
+-- end if;
end if;
end process MAIN_MACHINE_PROC;
CONSTRUCT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') or (main_current_state = BOOTING) then
+ if RESET = '1' then
+ construct_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+ if (main_current_state = BOOTING) then
construct_current_state <= IDLE;
else
construct_current_state <= construct_next_state;
DISSECT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- dissect_current_state <= IDLE;
- else
+ if RESET = '1' then
+ dissect_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- dissect_current_state <= IDLE;
+-- else
dissect_current_state <= dissect_next_state;
- end if;
+-- end if;
end if;
end process DISSECT_MACHINE_PROC;
DISSECT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- if (g_SIMULATE = 0) then
- dissect_current_state <= IDLE;
- else
- dissect_current_state <= WAIT_FOR_RESPONSE;
- end if;
- else
+ if RESET = '1' then
+ dissect_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- if (g_SIMULATE = 0) then
+-- dissect_current_state <= IDLE;
+-- else
+-- dissect_current_state <= WAIT_FOR_RESPONSE;
+-- end if;
+-- else
dissect_current_state <= dissect_next_state;
- end if;
+-- end if;
end if;
end process DISSECT_MACHINE_PROC;
DISSECT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- dissect_current_state <= IDLE;
- else
+ if RESET = '1' then
+ dissect_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- dissect_current_state <= IDLE;
+-- else
dissect_current_state <= dissect_next_state;
- end if;
+-- end if;
end if;
end process DISSECT_MACHINE_PROC;
TRANSMIT_MACHINE_PROC : process(CLK)
begin
- if rising_edge(CLK) then
- if (RESET = '1') then
- transmit_current_state <= IDLE;
- else
+ if RESET = '1' then
+ transmit_current_state <= IDLE;
+ elsif rising_edge(CLK) then
+-- if (RESET = '1') then
+-- transmit_current_state <= IDLE;
+-- else
transmit_current_state <= transmit_next_state;
- end if;
+-- end if;
end if;
end process TRANSMIT_MACHINE_PROC;
\r
SGMII_GBE_PCS : sgmii_gbe_pcs35 --sgmii_gbe_pcs36 --sgmii_gbe_pcs35\r
port map(\r
- rst_n => GSR_N,\r
+ rst_n => rst_n, --GSR_N,\r
signal_detect => signal_detected,\r
gbe_mode => '1',\r
sgmii_mode => '0',\r