]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
gk: updated link status
authorYour Name <you@example.com>
Tue, 28 Nov 2017 16:41:30 +0000 (17:41 +0100)
committerYour Name <you@example.com>
Tue, 28 Nov 2017 16:41:30 +0000 (17:41 +0100)
gbe_trb/base/trb_net16_gbe_main_control.vhd

index 122cc31dd5ab832e4f92c23c367e014b769c91ae..0537eabf42330f098832c3f54598e70d8f8c8f89 100644 (file)
@@ -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';