From 2348e54226c09f12db84d3a517c5d1777e785371 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 28 Nov 2017 17:41:30 +0100 Subject: [PATCH] gk: updated link status --- gbe_trb/base/trb_net16_gbe_main_control.vhd | 93 +++++++++++---------- 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/gbe_trb/base/trb_net16_gbe_main_control.vhd b/gbe_trb/base/trb_net16_gbe_main_control.vhd index 122cc31..0537eab 100644 --- a/gbe_trb/base/trb_net16_gbe_main_control.vhd +++ b/gbe_trb/base/trb_net16_gbe_main_control.vhd @@ -201,7 +201,7 @@ architecture trb_net16_gbe_main_control of trb_net16_gbe_main_control is signal tsm_hwrite_n : std_logic; signal tsm_hread_n : std_logic; - type link_states is (INACTIVE, ACTIVE, 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"; @@ -425,13 +425,18 @@ begin if (RESET = '1') then disable_redirect <= '0'; elsif (redirect_current_state = CHECK_TYPE) then - if (link_current_state /= ACTIVE and link_current_state /= GET_ADDRESS) then - disable_redirect <= '1'; - elsif (link_current_state = GET_ADDRESS and RC_FRAME_PROTO_IN /= "10") then - disable_redirect <= '1'; - else - disable_redirect <= '0'; + if (link_current_state = ACTIVE) then + disable_redirect <= '0'; + else + disable_redirect <= '1'; end if; +-- if (link_current_state /= ACTIVE and link_current_state /= GET_ADDRESS) then +-- disable_redirect <= '1'; +-- elsif (link_current_state = GET_ADDRESS and RC_FRAME_PROTO_IN /= "10") then +-- disable_redirect <= '1'; +-- else +-- disable_redirect <= '0'; +-- end if; else disable_redirect <= disable_redirect; end if; @@ -476,8 +481,8 @@ begin redirect_state <= x"2"; if (link_current_state = ACTIVE) then redirect_next_state <= CHECK_BUSY; - elsif (link_current_state = GET_ADDRESS and RC_FRAME_PROTO_IN = "10") then - redirect_next_state <= CHECK_BUSY; +-- elsif (link_current_state = GET_ADDRESS and RC_FRAME_PROTO_IN = "10") then +-- redirect_next_state <= CHECK_BUSY; else redirect_next_state <= DROP; end if; @@ -654,31 +659,35 @@ begin lsm_impl_gen : if DO_SIMULATION = 0 generate LINK_STATE_MACHINE_PROC : process(MC_RESET_LINK_IN, CLK) begin - if MC_RESET_LINK_IN = '1' then - link_current_state <= INACTIVE; - elsif rising_edge(CLK) then - if RX_PATH_ENABLE = 1 then - link_current_state <= link_next_state; - else - link_current_state <= INACTIVE; - end if; - end if; + --if MC_RESET_LINK_IN = '1' then + -- link_current_state <= INACTIVE; + --elsif rising_edge(CLK) then + if rising_edge(CLK) then + if (RESET = '1' or MC_RESET_LINK_IN = '1') then + link_current_state <= INACTIVE; + else + if RX_PATH_ENABLE = 1 then + link_current_state <= link_next_state; + else + link_current_state <= INACTIVE; + end if; + end if; end process; end generate lsm_impl_gen; lsm_sim_gen : if DO_SIMULATION = 1 generate - LINK_STATE_MACHINE_PROC : process(MC_RESET_LINK_IN, CLK) - begin - if MC_RESET_LINK_IN = '1' then - link_current_state <= GET_ADDRESS; - elsif rising_edge(CLK) then - if RX_PATH_ENABLE = 1 then - link_current_state <= link_next_state; - else - link_current_state <= ACTIVE; - end if; - end if; - end process; +-- LINK_STATE_MACHINE_PROC : process(MC_RESET_LINK_IN, CLK) +-- begin +-- if MC_RESET_LINK_IN = '1' then +-- link_current_state <= GET_ADDRESS; +-- elsif rising_edge(CLK) then +-- if RX_PATH_ENABLE = 1 then +-- link_current_state <= link_next_state; +-- else +-- link_current_state <= ACTIVE; +-- end if; +-- end if; +-- end process; end generate lsm_sim_gen; incl_dhcp_gen : if (INCLUDE_DHCP = '1') generate @@ -748,17 +757,17 @@ begin end if; end if; - when GET_ADDRESS => - link_state <= x"6"; - if (PCS_AN_COMPLETE_IN = '0') then - link_next_state <= INACTIVE; - else - if (dhcp_done = '1') then - link_next_state <= ACTIVE; - else - link_next_state <= GET_ADDRESS; - end if; - end if; +-- when GET_ADDRESS => +-- link_state <= x"6"; +-- if (PCS_AN_COMPLETE_IN = '0') then +-- link_next_state <= INACTIVE; +-- else +-- if (dhcp_done = '1') then +-- link_next_state <= ACTIVE; +-- else +-- link_next_state <= GET_ADDRESS; +-- end if; +-- end if; when ACTIVE => link_state <= x"7"; @@ -792,7 +801,7 @@ begin -- end if; --if (link_current_state = GET_ADDRESS) then - if (incl_dhcp = '1') then + if (incl_dhcp = '1' and link_current_state = ACTIVE) then dhcp_start <= '1'; else dhcp_start <= '0'; -- 2.43.0