From: Jan Michel Date: Sun, 4 May 2014 09:52:36 +0000 (+0200) Subject: update X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=47d9171c86ae72c99d7d1e05c2c0a6719cf168e7;p=trbnet.git update --- diff --git a/gbe2_ecp3/trb_net16_gbe_buf.vhd b/gbe2_ecp3/trb_net16_gbe_buf.vhd index ae1e38d..ac48a20 100755 --- a/gbe2_ecp3/trb_net16_gbe_buf.vhd +++ b/gbe2_ecp3/trb_net16_gbe_buf.vhd @@ -602,13 +602,24 @@ signal dbg_hist, dbg_hist2 : hist_array; signal soft_gbe_reset, soft_rst, dhcp_done : std_logic; signal rst_ctr : std_logic_vector(24 downto 0); signal mac_reset : std_logic; -signal global_reset : std_logic; +signal global_reset, rst_n, ff : std_logic; begin stage_ctrl_regs <= STAGE_CTRL_REGS_IN; -global_reset <= not GSR_N; +reset_sync : process(GSR_N, CLK) +begin + if (GSR_N = '0') then + ff <= '0'; + rst_n <= '0'; + elsif rising_edge(CLK) then + ff <= '1'; + rst_n <= ff; + end if; +end process reset_sync; + +global_reset <= not rst_n; -- gk 23.04.10 LED_PACKET_SENT_OUT <= '0'; --timeout_noticed; --pc_ready; @@ -626,11 +637,10 @@ MAIN_CONTROL : trb_net16_gbe_main_control port map( CLK => CLK, CLK_125 => serdes_clk_125, - RESET => global_reset, --RESET, - RESET_FOR_DHCP => global_reset, --'0', --soft_gbe_reset, --'0', --reset_dhcp, + RESET => RESET, MC_LINK_OK_OUT => link_ok, - MC_RESET_LINK_IN => '0', + MC_RESET_LINK_IN => global_reset, MC_IDLE_TOO_LONG_OUT => idle_too_long, MC_DHCP_DONE_OUT => dhcp_done, @@ -767,6 +777,7 @@ port map( TC_SRC_UDP_IN => mc_src_udp, TC_TRANSMISSION_DONE_OUT => mc_transmit_done, TC_IDENT_IN => mc_ident, + TC_MAX_FRAME_IN => pc_max_frame_size, -- signal to/from frame constructor FC_DATA_OUT => fc_data, diff --git a/gbe2_ecp3/trb_net16_gbe_event_constr.vhd b/gbe2_ecp3/trb_net16_gbe_event_constr.vhd index f4e774c..214eab8 100644 --- a/gbe2_ecp3/trb_net16_gbe_event_constr.vhd +++ b/gbe2_ecp3/trb_net16_gbe_event_constr.vhd @@ -239,7 +239,7 @@ begin end if; end process SHF_Q_PROC; -SAVE_SUB_HDR_MACHINE_PROC : process(CLK) +SAVE_SUB_HDR_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then save_sub_hdr_current_state <= IDLE; @@ -482,7 +482,7 @@ end process; -- LOADING PART --******* -LOAD_MACHINE_PROC : process(CLK) is +LOAD_MACHINE_PROC : process(RESET, CLK) is begin if RESET = '1' then load_current_state <= IDLE; @@ -495,7 +495,7 @@ begin end if; end process LOAD_MACHINE_PROC; -LOAD_MACHINE : process(load_current_state, qsf_empty, header_ctr, load_eod, term_ctr, insert_padding) +LOAD_MACHINE : process(load_current_state, qsf_empty, header_ctr, load_eod_q, term_ctr, insert_padding) begin case (load_current_state) is diff --git a/gbe2_ecp3/trb_net16_gbe_frame_constr.vhd b/gbe2_ecp3/trb_net16_gbe_frame_constr.vhd index 00f289f..a1c5978 100755 --- a/gbe2_ecp3/trb_net16_gbe_frame_constr.vhd +++ b/gbe2_ecp3/trb_net16_gbe_frame_constr.vhd @@ -165,7 +165,7 @@ end process sizeProc; ipCsProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (constructCurrentState = IDLE) then + if (constructCurrentState = IDLE) then ip_checksum <= x"00000000"; else case constructCurrentState is @@ -334,7 +334,7 @@ end process constructMachine; delayCtrProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (constructCurrentState = IDLE) or (constructCurrentState = CLEANUP) then + if (constructCurrentState = IDLE) or (constructCurrentState = CLEANUP) then delay_ctr <= (others => '0'); elsif (constructCurrentState = DELAY) then delay_ctr <= delay_ctr + x"1"; @@ -378,7 +378,7 @@ end process; headersIntProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (constructCurrentState = IDLE) then + if (constructCurrentState = IDLE) then headers_int_counter <= 0; else if (headers_int_counter = cur_max) then @@ -395,7 +395,7 @@ end process headersIntProc; putUdpHeadersProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (FLAGS_OFFSET_IN(12 downto 0) = "0000000000000") then + if (FLAGS_OFFSET_IN(12 downto 0) = "0000000000000") then put_udp_headers <= '1'; else put_udp_headers <= '0'; @@ -405,7 +405,7 @@ end process putUdpHeadersProc; fpfWrEnProc : process(constructCurrentState, WR_EN_IN, RESET, LINK_OK_IN) begin - if (RESET = '1') or (LINK_OK_IN = '0') then -- gk 01.10.10 + if (LINK_OK_IN = '0') then -- gk 01.10.10 fpf_wr_en <= '0'; elsif (constructCurrentState /= IDLE) and (constructCurrentState /= CLEANUP) and (constructCurrentState /= SAVE_DATA) and (constructCurrentState /= DELAY) then fpf_wr_en <= '1'; @@ -461,10 +461,12 @@ end process syncProc; readyFramesCtrProc: process( CLK ) begin if rising_edge(CLK) then - if (RESET = '1') or (LINK_OK_IN = '0') then -- gk 01.10.10 + if (LINK_OK_IN = '0') then -- gk 01.10.10 ready_frames_ctr <= (others => '0'); elsif (constructCurrentState = CLEANUP) then ready_frames_ctr <= ready_frames_ctr + 1; + else + ready_frames_ctr <= ready_frames_ctr; end if; end if; end process readyFramesCtrProc; @@ -472,7 +474,7 @@ end process readyFramesCtrProc; fpfResetProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1' or LINK_OK_IN = '0') then + if (LINK_OK_IN = '0') then fpf_reset <= '1'; else fpf_reset <= '0'; @@ -578,7 +580,7 @@ end process transmitMachine; sopProc: process( RD_CLK ) begin if rising_edge(RD_CLK) then - if ( RESET = '1' ) or (link_ok_125 = '0') then -- gk 01.10.10 + if (link_ok_125 = '0') then -- gk 01.10.10 ft_sop <= '0'; elsif ((transmitCurrentState = T_IDLE) and (sent_frames_ctr /= ready_frames_ctr_q)) then ft_sop <= '1'; @@ -591,7 +593,7 @@ end process sopProc; sentFramesCtrProc: process( RD_CLK ) begin if rising_edge(RD_CLK) then - if ( RESET = '1' ) or (LINK_OK_IN = '0') then -- gk 01.10.10 + if (LINK_OK_IN = '0') then -- gk 01.10.10 sent_frames_ctr <= (others => '0'); mon_sent_frames <= (others => '0'); elsif( FT_TX_DONE_IN = '1' ) or (FT_TX_DISCFRM_IN = '1') then @@ -619,7 +621,7 @@ MONITOR_TX_FRAMES_OUT <= mon_sent_frames; process(RD_CLK) begin if rising_edge(RD_CLK) then - if (RESET = '1') or (LINK_OK_IN = '0') then + if (LINK_OK_IN = '0') then mon_sent_bytes <= (others => '0'); elsif (fpf_rd_en = '1') then mon_sent_bytes <= mon_sent_bytes + x"1"; diff --git a/gbe2_ecp3/trb_net16_gbe_frame_receiver.vhd b/gbe2_ecp3/trb_net16_gbe_frame_receiver.vhd index cd0c724..a3df8c7 100644 --- a/gbe2_ecp3/trb_net16_gbe_frame_receiver.vhd +++ b/gbe2_ecp3/trb_net16_gbe_frame_receiver.vhd @@ -282,13 +282,15 @@ end process; REMOVE_CTR_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = IDLE) or + if (filter_current_state = IDLE) or (filter_current_state = REMOVE_VTYPE and remove_ctr = x"0f") or (filter_current_state = REMOVE_TYPE and remove_ctr = x"0b") then remove_ctr <= (others => '1'); elsif (MAC_RX_EN_IN = '1') and (filter_current_state /= IDLE) then --and (filter_current_state /= CLEANUP) then remove_ctr <= remove_ctr + x"1"; + else + remove_ctr <= remove_ctr; end if; end if; end process REMOVE_CTR_PROC; @@ -296,10 +298,12 @@ end process REMOVE_CTR_PROC; SAVED_PROTO_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_proto <= (others => '0'); elsif (filter_current_state = REMOVE_IP) and (remove_ctr = x"07") then saved_proto <= MAC_RXD_IN; + else + saved_proto <= saved_proto; end if; end if; end process SAVED_PROTO_PROC; @@ -307,7 +311,7 @@ end process SAVED_PROTO_PROC; SAVED_SRC_IP_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_src_ip <= (others => '0'); elsif (filter_current_state = REMOVE_IP) and (remove_ctr = x"0a") then saved_src_ip(7 downto 0) <= MAC_RXD_IN; @@ -317,6 +321,8 @@ begin saved_src_ip(23 downto 16) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_IP) and (remove_ctr = x"0d") then saved_src_ip(31 downto 24) <= MAC_RXD_IN; + else + saved_src_ip <= saved_src_ip; end if; end if; end process SAVED_SRC_IP_PROC; @@ -324,7 +330,7 @@ end process SAVED_SRC_IP_PROC; SAVED_DEST_IP_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_dest_ip <= (others => '0'); elsif (filter_current_state = REMOVE_IP) and (remove_ctr = x"0e") then saved_dest_ip(7 downto 0) <= MAC_RXD_IN; @@ -334,6 +340,8 @@ begin saved_dest_ip(23 downto 16) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_IP) and (remove_ctr = x"11") then saved_dest_ip(31 downto 24) <= MAC_RXD_IN; + else + saved_dest_ip <= saved_dest_ip; end if; end if; end process SAVED_DEST_IP_PROC; @@ -341,12 +349,14 @@ end process SAVED_DEST_IP_PROC; SAVED_SRC_UDP_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_src_udp <= (others => '0'); elsif (filter_current_state = REMOVE_UDP) and (remove_ctr = x"12") then saved_src_udp(15 downto 8) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_UDP) and (remove_ctr = x"13") then saved_src_udp(7 downto 0) <= MAC_RXD_IN; + else + saved_src_udp <= saved_src_udp; end if; end if; end process SAVED_SRC_UDP_PROC; @@ -354,12 +364,14 @@ end process SAVED_SRC_UDP_PROC; SAVED_DEST_UDP_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_dest_udp <= (others => '0'); elsif (filter_current_state = REMOVE_UDP) and (remove_ctr = x"14") then saved_dest_udp(15 downto 8) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_UDP) and (remove_ctr = x"15") then saved_dest_udp(7 downto 0) <= MAC_RXD_IN; + else + saved_dest_udp <= saved_dest_udp; end if; end if; end process SAVED_DEST_UDP_PROC; @@ -368,7 +380,7 @@ end process SAVED_DEST_UDP_PROC; SAVED_DEST_MAC_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_dest_mac <= (others => '0'); elsif (filter_current_state = IDLE) and (MAC_RX_EN_IN = '1') and (new_frame = '0') then saved_dest_mac(7 downto 0) <= MAC_RXD_IN; @@ -382,6 +394,8 @@ begin saved_dest_mac(39 downto 32) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_DEST) and (remove_ctr = x"02") then saved_dest_mac(47 downto 40) <= MAC_RXD_IN; + else + saved_dest_mac <= saved_dest_mac; end if; end if; end process SAVED_DEST_MAC_PROC; @@ -390,7 +404,7 @@ end process SAVED_DEST_MAC_PROC; SAVED_SRC_MAC_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_src_mac <= (others => '0'); elsif (filter_current_state = REMOVE_DEST) and (remove_ctr = x"03") then saved_src_mac(7 downto 0) <= MAC_RXD_IN; @@ -404,6 +418,8 @@ begin saved_src_mac(39 downto 32) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_SRC) and (remove_ctr = x"08") then saved_src_mac(47 downto 40) <= MAC_RXD_IN; + else + saved_src_mac <= saved_src_mac; end if; end if; end process SAVED_SRC_MAC_PROC; @@ -412,7 +428,7 @@ end process SAVED_SRC_MAC_PROC; SAVED_FRAME_TYPE_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_frame_type <= (others => '0'); elsif (filter_current_state = REMOVE_SRC) and (remove_ctr = x"09") then saved_frame_type(15 downto 8) <= MAC_RXD_IN; @@ -423,6 +439,8 @@ begin saved_frame_type(15 downto 8) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_VTYPE) and (remove_ctr = x"0e") then saved_frame_type(7 downto 0) <= MAC_RXD_IN; + else + saved_frame_type <= saved_frame_type; end if; end if; end process SAVED_FRAME_TYPE_PROC; @@ -431,12 +449,14 @@ end process SAVED_FRAME_TYPE_PROC; SAVED_VID_PROC : process(RX_MAC_CLK) begin if rising_edge(RX_MAC_CLK) then - if (RESET = '1') or (filter_current_state = CLEANUP) then + if (filter_current_state = CLEANUP) then saved_vid <= (others => '0'); elsif (filter_current_state = REMOVE_TYPE and remove_ctr = x"0b" and saved_frame_type = x"8100") then saved_vid(15 downto 8) <= MAC_RXD_IN; elsif (filter_current_state = REMOVE_VID and remove_ctr = x"0c") then saved_vid(7 downto 0) <= MAC_RXD_IN; + else + saved_vid <= saved_vid; end if; end if; end process SAVED_VID_PROC; diff --git a/gbe2_ecp3/trb_net16_gbe_frame_trans.vhd b/gbe2_ecp3/trb_net16_gbe_frame_trans.vhd index 00dfd78..41db165 100755 --- a/gbe2_ecp3/trb_net16_gbe_frame_trans.vhd +++ b/gbe2_ecp3/trb_net16_gbe_frame_trans.vhd @@ -157,7 +157,7 @@ end process TransmitStateMachine; FifoAvailProc : process (TX_MAC_CLK) begin if rising_edge(TX_MAC_CLK) then - if (RESET = '1') or (LINK_OK_IN = '0') then -- gk 01.10.10 + if (LINK_OK_IN = '0') then -- gk 01.10.10 tx_fifoavail_i <= '0'; elsif (transmitCurrentState = T_TRANSMIT) then tx_fifoavail_i <= '1'; @@ -169,7 +169,7 @@ end process FifoAvailProc; FifoEmptyProc : process(transmitCurrentState, START_OF_PACKET_IN, TX_EMPTY_IN, RESET) begin - if (RESET = '1') or (LINK_OK_IN = '0') then -- gk 01.10.10 + if (LINK_OK_IN = '0') then -- gk 01.10.10 FifoEmpty <= '1'; elsif (transmitCurrentState = T_WAITFORFIFO) then FifoEmpty <= '1'; @@ -187,11 +187,13 @@ tx_fifoeof_i <= '1' when ((DATA_ENDFLAG_IN = '1') and (transmitCurrentState = T_ SENT_CTR_PROC : process(TX_MAC_CLK) begin - if rising_edge(TX_MAC_CLK) then - if (RESET = '1') then + if (RESET = '1') then sent_ctr <= (others => '0'); - elsif (TX_DONE_IN = '1') and (TX_STAT_EN_IN = '1') and (TX_STATVEC_IN(0) = '1') then + elsif rising_edge(TX_MAC_CLK) then + if (TX_DONE_IN = '1') and (TX_STAT_EN_IN = '1') and (TX_STATVEC_IN(0) = '1') then sent_ctr <= sent_ctr + x"1"; + else + sent_ctr <= sent_ctr; end if; end if; end process SENT_CTR_PROC; diff --git a/gbe2_ecp3/trb_net16_gbe_ipu_interface.vhd b/gbe2_ecp3/trb_net16_gbe_ipu_interface.vhd index a7ff5d4..4211f26 100644 --- a/gbe2_ecp3/trb_net16_gbe_ipu_interface.vhd +++ b/gbe2_ecp3/trb_net16_gbe_ipu_interface.vhd @@ -104,7 +104,7 @@ begin -- RECEIVING PART --********* -SAVE_MACHINE_PROC : process(CLK_IPU) +SAVE_MACHINE_PROC : process(RESET, CLK_IPU) begin if RESET = '1' then save_current_state <= IDLE; @@ -256,12 +256,12 @@ begin end if; end process SF_DATA_EOD_PROC; -SAVED_EVENTS_CTR_PROC : process(CLK_IPU) +SAVED_EVENTS_CTR_PROC : process(RESET, CLK_IPU) begin - if rising_edge(CLK_IPU) then - if (RESET = '1') then - saved_events_ctr <= (others => '0'); - elsif (save_current_state = ADD_SUBSUB4) then + if (RESET = '1') then + saved_events_ctr <= (others => '0'); + elsif rising_edge(CLK_IPU) then + if (save_current_state = ADD_SUBSUB4) then saved_events_ctr <= saved_events_ctr + x"1"; else saved_events_ctr <= saved_events_ctr; @@ -362,7 +362,7 @@ port map( Reset => sf_reset, RPReset => sf_reset, AmEmptyThresh => b"0000_0000_0000_0010", --b"0000_0000_0000_0010", -- one byte ahead - AmFullThresh => b"111_1111_1110_1111", --b"001_0011_1000_1000", --b"111_1111_1110_1111", -- 0x7fef = 32751 + AmFullThresh => b"001_0011_1000_1000", --b"111_1111_1110_1111", -- 0x7fef = 32751 Q(7 downto 0) => sf_q, Q(8) => sf_eod, --WCNT => open, @@ -399,7 +399,7 @@ begin end if; end process PC_DATA_PROC; -LOAD_MACHINE_PROC : process(CLK_GBE) +LOAD_MACHINE_PROC : process(RESET, CLK_GBE) begin if RESET = '1' then load_current_state <= IDLE; @@ -412,13 +412,13 @@ begin end if; end process LOAD_MACHINE_PROC; -LOAD_MACHINE : process(load_current_state, saved_events_ctr_gbe, loaded_events_ctr, loaded_bytes_ctr, PC_READY_IN, sf_eod, MULT_EVT_ENABLE_IN) +LOAD_MACHINE : process(load_current_state, saved_events_ctr_gbe, loaded_events_ctr, loaded_bytes_ctr, PC_READY_IN, sf_eod) begin case (load_current_state) is when IDLE => load_state <= x"1"; - if (saved_events_ctr /= loaded_events_ctr) then + if (saved_events_ctr_gbe /= loaded_events_ctr) then load_next_state <= REMOVE; else load_next_state <= IDLE; @@ -564,12 +564,12 @@ end process TRIGGER_TYPE_PROC; --***** -- counters -LOADED_EVENTS_CTR_PROC : process(CLK_GBE) +LOADED_EVENTS_CTR_PROC : process(RESET, CLK_GBE) begin - if rising_edge(CLK_GBE) then - if (RESET = '1') then - loaded_events_ctr <= (others => '0'); - elsif (load_current_state = CLOSE) then + if (RESET = '1') then + loaded_events_ctr <= (others => '0'); + elsif rising_edge(CLK_GBE) then + if (load_current_state = CLOSE) then loaded_events_ctr <= loaded_events_ctr + x"1"; else loaded_events_ctr <= loaded_events_ctr; @@ -597,7 +597,7 @@ end process LOADED_BYTES_CTR_PROC; READOUT_CTR_PROC : process(CLK_GBE) begin if rising_edge(CLK_GBE) then - if (RESET = '1' or READOUT_CTR_VALID_IN = '1') then + if (READOUT_CTR_VALID_IN = '1') then readout_ctr <= READOUT_CTR_IN; elsif (load_current_state = DECIDE) then readout_ctr <= readout_ctr + x"1"; diff --git a/gbe2_ecp3/trb_net16_gbe_main_control.vhd b/gbe2_ecp3/trb_net16_gbe_main_control.vhd index 261e3d0..ed5e291 100644 --- a/gbe2_ecp3/trb_net16_gbe_main_control.vhd +++ b/gbe2_ecp3/trb_net16_gbe_main_control.vhd @@ -23,7 +23,6 @@ port ( CLK : in std_logic; -- system clock CLK_125 : in std_logic; RESET : in std_logic; - RESET_FOR_DHCP : in std_logic; MC_LINK_OK_OUT : out std_logic; MC_RESET_LINK_IN : in std_logic; @@ -242,8 +241,8 @@ unique_id <= MC_UNIQUE_ID_IN; protocol_selector : trb_net16_gbe_protocol_selector port map( CLK => CLK, - RESET => RESET, - RESET_FOR_DHCP => RESET_FOR_DHCP, + RESET => RESET, + RESET_FOR_DHCP => MC_RESET_LINK_IN, PS_DATA_IN => rc_data_local, -- RC_DATA_IN, PS_WR_EN_IN => ps_wr_en_qq, --ps_wr_en, @@ -378,7 +377,7 @@ begin end if; end process SYNC_PROC; -REDIRECT_MACHINE_PROC : process(CLK) +REDIRECT_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then redirect_current_state <= IDLE; @@ -391,7 +390,7 @@ begin end if; end process REDIRECT_MACHINE_PROC; -REDIRECT_MACHINE : process(redirect_current_state, link_current_state, RC_FRAME_WAITING_IN, RC_DATA_IN, ps_busy, RC_FRAME_PROTO_IN, ps_wr_en, loaded_bytes_ctr, RC_FRAME_SIZE_IN) +REDIRECT_MACHINE : process(redirect_current_state, link_current_state, RC_FRAME_WAITING_IN, ps_busy, RC_FRAME_PROTO_IN, loaded_bytes_ctr, RC_FRAME_SIZE_IN) begin case redirect_current_state is @@ -466,9 +465,7 @@ RC_RD_EN_OUT <= rc_rd_en; LOADING_DONE_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') then - RC_LOADING_DONE_OUT <= '0'; - elsif (RC_DATA_IN(8) = '1' and ps_wr_en_q = '1') then + if (RC_DATA_IN(8) = '1' and ps_wr_en_q = '1') then RC_LOADING_DONE_OUT <= '1'; else RC_LOADING_DONE_OUT <= '0'; @@ -488,7 +485,7 @@ end process PS_WR_EN_PROC; LOADED_BYTES_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (redirect_current_state = IDLE) then + if (redirect_current_state = IDLE) then loaded_bytes_ctr <= (others => '0'); elsif (redirect_current_state = LOAD or redirect_current_state = DROP) and (rc_rd_en = '1') then loaded_bytes_ctr <= loaded_bytes_ctr + x"1"; @@ -504,9 +501,7 @@ begin first_byte_q <= first_byte; first_byte_qq <= first_byte_q; - if (RESET = '1') then - first_byte <= '0'; - elsif (redirect_current_state = IDLE) then + if (redirect_current_state = IDLE) then first_byte <= '1'; else first_byte <= '0'; @@ -517,7 +512,7 @@ end process FIRST_BYTE_PROC; --********************* -- DATA FLOW CONTROL -FLOW_MACHINE_PROC : process(CLK) +FLOW_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then flow_current_state <= IDLE; @@ -586,9 +581,9 @@ end process; --*********************** -- LINK STATE CONTROL -LINK_STATE_MACHINE_PROC : process(CLK) +LINK_STATE_MACHINE_PROC : process(MC_RESET_LINK_IN, CLK) begin - if RESET = '1' then + if MC_RESET_LINK_IN = '1' then link_current_state <= INACTIVE; elsif rising_edge(CLK) then -- --if (RESET = '1') then @@ -687,7 +682,7 @@ LINK_OK_CTR_PROC : process(CLK) begin if rising_edge(CLK) then --if (RESET = '1') or (link_current_state /= TIMEOUT) then - if (RESET_FOR_DHCP = '1') or (link_current_state /= TIMEOUT) then + if (link_current_state /= TIMEOUT) then link_ok_timeout_ctr <= (others => '0'); elsif (link_current_state = TIMEOUT) then link_ok_timeout_ctr <= link_ok_timeout_ctr + x"1"; @@ -712,11 +707,10 @@ end process LINK_OK_CTR_PROC; WAIT_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - --if (RESET = '1') or (link_current_state = INACTIVE) then - if (RESET_FOR_DHCP = '1') or (link_current_state = INACTIVE) then - wait_ctr <= (others => '0'); - elsif (link_current_state = WAIT_FOR_BOOT) then + if (link_current_state = WAIT_FOR_BOOT) then wait_ctr <= wait_ctr + x"1"; + else + wait_ctr <= (others => '0'); end if; end if; end process WAIT_CTR_PROC; @@ -747,10 +741,6 @@ MC_LINK_OK_OUT <= link_ok; -- or nothing_sent; -- GENERATE MAC_ADDRESS g_MY_MAC <= unique_id(31 downto 8) & x"be0002"; ---g_MAX_FRAME_SIZE <= x"0578"; - ---g_MAX_PACKET_SIZE <= x"fa00" when g_SIMULATE = 0 else x"0600"; --- --************* --**************** @@ -759,8 +749,8 @@ g_MY_MAC <= unique_id(31 downto 8) & x"be0002"; TSMAC_CONTROLLER : trb_net16_gbe_mac_control port map( CLK => CLK, - RESET => RESET_FOR_DHCP, --RESET, - + RESET => MC_RESET_LINK_IN, + -- signals to/from main controller MC_TSMAC_READY_OUT => tsm_ready, MC_RECONF_IN => tsm_reconf, diff --git a/gbe2_ecp3/trb_net16_gbe_packet_constr.vhd b/gbe2_ecp3/trb_net16_gbe_packet_constr.vhd index c552a61..46380e1 100755 --- a/gbe2_ecp3/trb_net16_gbe_packet_constr.vhd +++ b/gbe2_ecp3/trb_net16_gbe_packet_constr.vhd @@ -178,12 +178,12 @@ pc_ready <= '1' when (constructCurrentState = CIDLE) and (df_empty = '1') else ' THE_EVT_INFO_STORE_PROC: process( CLK ) begin if( rising_edge(CLK) ) then - if (RESET = '1') then -- gk 31.05.10 - pc_sub_size <= (others => '0'); - pc_trig_nr <= (others => '0'); - elsif( PC_START_OF_SUB_IN = '1' ) then + if( PC_START_OF_SUB_IN = '1' ) then pc_sub_size <= PC_SUB_SIZE_IN; pc_trig_nr <= PC_TRIG_NR_IN; + else + pc_sub_size <= pc_sub_size; + pc_trig_nr <= pc_trig_nr; end if; end if; end process; @@ -214,11 +214,7 @@ port map( LOAD_EOD_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') then - load_eod_q <= '0'; - else - load_eod_q <= load_eod; - end if; + load_eod_q <= load_eod; end if; end process LOAD_EOD_PROC; @@ -296,12 +292,16 @@ sub_size_to_save <= (x"10" + pc_sub_size) when (PC_PADDING_IN = '0') -- gk 29.03.10 no changes here because the queue size should contain the padding bytes of subevents queueSizeProc : process(CLK) begin - if rising_edge(CLK) then + if (RESET = '1') then + queue_size <= x"00000028"; -- + 8B for queue headers and 32B for termination + elsif rising_edge(CLK) then --if (RESET = '1') or (loadCurrentState = PUT_Q_DEC) then -- gk 07.10.10 -- (loadCurrentState = CLEANUP) then - if (RESET = '1') or (loadCurrentState = CLEANUP) then + if (loadCurrentState = CLEANUP) then queue_size <= x"00000028"; -- + 8B for queue headers and 32B for termination elsif (saveSubCurrentState = SAVE_SIZE) and (sub_int_ctr = 3) then queue_size <= queue_size + pc_sub_size + x"10"; -- + 16B for each subevent headers + else + queue_size <= queue_size; end if; end if; end process queueSizeProc; @@ -453,11 +453,15 @@ end process loadMachine; -- gk 04.12.10 firstSubInMultiProc : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = LOAD_TERM) then + if (RESET = '1') then + first_sub_in_multi <= '1'; + elsif rising_edge(CLK) then + if (loadCurrentState = LOAD_TERM) then first_sub_in_multi <= '1'; elsif (loadCurrentState = LOAD_DATA) then first_sub_in_multi <= '0'; + else + first_sub_in_multi <= first_sub_in_multi; end if; end if; end process; @@ -465,13 +469,15 @@ end process; -- gk 04.12.10 fromDivideStateProc : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') then - from_divide_state <= '0'; - elsif (loadCurrentState = DIVIDE) then + if (RESET = '1') then + from_divide_state <= '0'; + elsif rising_edge(CLK) then + if (loadCurrentState = DIVIDE) then from_divide_state <= '1'; elsif (loadCurrentState = PREP_DATA) then from_divide_state <= '0'; + else + from_divide_state <= from_divide_state; end if; end if; end process fromDivideStateProc; @@ -479,10 +485,11 @@ end process fromDivideStateProc; dividePositionProc : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') then - divide_position <= "00"; - elsif (bytes_loaded = max_frame_size - 1) then + if (RESET = '1') then + divide_position <= "00"; + disable_prep <= '0'; + elsif rising_edge(CLK) then + if (bytes_loaded = max_frame_size - 1) then if (loadCurrentState = LIDLE) then divide_position <= "00"; disable_prep <= '0'; -- gk 05.12.10 @@ -515,9 +522,16 @@ begin elsif (loadCurrentState = LOAD_TERM) then divide_position <= "11"; disable_prep <= '0'; -- gk 05.12.10 + else + divide_position <= divide_position; + disable_prep <= disable_prep; end if; elsif (loadCurrentState = PREP_DATA) then -- gk 06.12.10 reset disable_prep disable_prep <= '0'; + divide_position <= divide_position; + else + divide_position <= divide_position; + disable_prep <= disable_prep; end if; end if; @@ -525,10 +539,9 @@ end process dividePositionProc; allIntCtrProc : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') then -- gk 31.05.10 - all_int_ctr <= 0; - else + if (RESET = '1') then -- gk 31.05.10 + all_int_ctr <= 0; + elsif rising_edge(CLK) then case loadCurrentState is when LIDLE => all_int_ctr <= 0; @@ -573,16 +586,13 @@ begin when DELAY => all_int_ctr <= 0; end case; - end if; end if; end process allIntCtrProc; dfRdEnProc : process(loadCurrentState, bytes_loaded, max_frame_size, sub_bytes_loaded, sub_size_loaded, all_int_ctr, RESET, size_left, load_eod_q) begin - if (RESET = '1') then - df_rd_en <= '0'; - elsif (loadCurrentState = LOAD_DATA) then + if (loadCurrentState = LOAD_DATA) then -- if (bytes_loaded = max_frame_size - x"1") then -- df_rd_en <= '0'; -- -- gk 07.10.10 @@ -617,9 +627,7 @@ end process dfRdEnProc; shfRdEnProc : process(loadCurrentState, all_int_ctr, RESET) begin - if (RESET = '1') then -- gk 31.05.10 - shf_rd_en <= '0'; - elsif (loadCurrentState = LOAD_SUB) then + if (loadCurrentState = LOAD_SUB) then shf_rd_en <= '1'; elsif (loadCurrentState = LOAD_TERM) and (all_int_ctr < 31) then shf_rd_en <= '1'; @@ -633,9 +641,7 @@ end process shfRdEnProc; fcWrEnProc : process(loadCurrentState, RESET, first_sub_in_multi, from_divide_state, MULT_EVT_ENABLE_IN, divide_position, disable_prep) begin - if (RESET = '1') then -- gk 31.05.10 - fc_wr_en <= '0'; - elsif (loadCurrentState = PUT_Q_LEN) or (loadCurrentState = PUT_Q_DEC) then + if (loadCurrentState = PUT_Q_LEN) or (loadCurrentState = PUT_Q_DEC) then fc_wr_en <= '1'; elsif (loadCurrentState = LOAD_SUB) or (loadCurrentState = LOAD_DATA) or (loadCurrentState = LOAD_TERM) then fc_wr_en <= '1'; @@ -674,10 +680,12 @@ end process fcDataProc; DELAY_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if ((RESET = '1') or (loadCurrentState = LIDLE)) then + if (loadCurrentState = LIDLE) then delay_ctr <= PC_DELAY_IN; elsif ((loadCurrentState = DELAY) and (ticks_ctr(7) = '1')) then delay_ctr <= delay_ctr - x"1"; + else + delay_ctr <= delay_ctr; end if; end if; end process DELAY_CTR_PROC; @@ -686,10 +694,12 @@ end process DELAY_CTR_PROC; TICKS_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if ((RESET = '1') or (loadCurrentState = LIDLE) or (ticks_ctr(7) = '1')) then + if ((loadCurrentState = LIDLE) or (ticks_ctr(7) = '1')) then ticks_ctr <= x"00"; elsif (loadCurrentState = DELAY) then ticks_ctr <= ticks_ctr + x"1"; + else + ticks_ctr <= ticks_ctr; end if; end if; end process TICKS_CTR_PROC; @@ -710,11 +720,7 @@ rst_after_sub_comb <= '1' when (loadCurrentState = LIDLE) or RST_AFTER_SUB_PROC : process(CLK) begin if(rising_edge(CLK)) then - if(RESET = '1') then - rst_after_sub <= '0'; - else - rst_after_sub <= rst_after_sub_comb; - end if; + rst_after_sub <= rst_after_sub_comb; end if; end process RST_AFTER_SUB_PROC; @@ -722,7 +728,7 @@ end process RST_AFTER_SUB_PROC; bytesLoadedProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = LIDLE) or (loadCurrentState = DIVIDE) or (loadCurrentState = CLEANUP) then + if (loadCurrentState = LIDLE) or (loadCurrentState = DIVIDE) or (loadCurrentState = CLEANUP) then bytes_loaded <= x"0000"; elsif (loadCurrentState = PUT_Q_LEN) or (loadCurrentState = PUT_Q_DEC) or (loadCurrentState = LOAD_DATA) or (loadCurrentState = LOAD_SUB) or (loadCurrentState = LOAD_TERM) then bytes_loaded <= bytes_loaded + x"1"; @@ -733,6 +739,8 @@ begin bytes_loaded <= bytes_loaded + x"1"; elsif (MULT_EVT_ENABLE_IN = '1') and (loadCurrentState = PREP_DATA) and (from_divide_state = '1') and ((divide_position = "00") or (divide_position = "01")) and (disable_prep = '0') then bytes_loaded <= bytes_loaded + x"1"; + else + bytes_loaded <= bytes_loaded; end if; end if; end process bytesLoadedProc; @@ -741,7 +749,7 @@ end process bytesLoadedProc; subSizeLoadedProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) or (rst_after_sub = '1') then -- gk 08.04.10 + if (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) or (rst_after_sub = '1') then -- gk 08.04.10 sub_size_loaded <= x"00000000"; elsif (loadCurrentState = LOAD_SUB) and (all_int_ctr < 4) then -- was all_int_ctr @@ -750,6 +758,8 @@ begin -- gk 29.03.10 here the padding bytes have to be added to the loadedSize in order to load the correct amount of bytes from fifo elsif (loadCurrentState = LOAD_SUB) and (all_int_ctr = 5) and (sub_size_loaded(2) = '1') then sub_size_loaded <= sub_size_loaded + x"4"; + else + sub_size_loaded <= sub_size_loaded; end if; end if; end process subSizeLoadedProc; @@ -758,10 +768,12 @@ end process subSizeLoadedProc; subBytesLoadedProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) or (rst_after_sub = '1') then -- gk 26.07.10 --or (sub_bytes_loaded = sub_size_loaded) -- gk 08.04.10 + if (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) or (rst_after_sub = '1') then -- gk 26.07.10 --or (sub_bytes_loaded = sub_size_loaded) -- gk 08.04.10 sub_bytes_loaded <= x"00000011"; -- subevent headers doesnt count elsif (loadCurrentState = LOAD_DATA) then sub_bytes_loaded <= sub_bytes_loaded + x"1"; + else + sub_bytes_loaded <= sub_bytes_loaded; end if; end if; end process subBytesLoadedProc; @@ -770,21 +782,27 @@ end process subBytesLoadedProc; actualPacketProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) then + if (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) then actual_packet_size <= x"0008"; elsif (fc_wr_en = '1') then actual_packet_size <= actual_packet_size + x"1"; + else + actual_packet_size <= actual_packet_size; end if; end if; end process actualPacketProc; actualQueueSizeProc : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = CLEANUP) then + if RESET = '1' then + actual_queue_size <= (others => '0'); + elsif rising_edge(CLK) then + if (loadCurrentState = CLEANUP) then actual_queue_size <= (others => '0'); elsif (loadCurrentState = LIDLE) then actual_queue_size <= queue_size; + else + actual_queue_size <= actual_queue_size; end if; end if; end process actualQueueSizeProc; @@ -792,13 +810,17 @@ end process actualQueueSizeProc; -- amount of bytes left to send in current packet sizeLeftProc : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = CLEANUP) then + if (RESET = '1') then + size_left <= (others => '0'); + elsif rising_edge(CLK) then + if (loadCurrentState = CLEANUP) then size_left <= (others => '0'); elsif (loadCurrentState = LIDLE) then size_left <= queue_size; elsif (fc_wr_en = '1') then size_left <= size_left - 1; + else + size_left <= size_left; end if; end if; end process sizeLeftProc; @@ -807,11 +829,13 @@ end process sizeLeftProc; -- In this case, we increment the fragmented packet ID with EOD from ipu2gbe. THE_FC_IDENT_COUNTER_PROC: process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') then - fc_ident <= (others => '0'); - elsif (PC_END_OF_DATA_IN = '1') then + if (RESET = '1') then + fc_ident <= (others => '0'); + elsif rising_edge(CLK) then + if (PC_END_OF_DATA_IN = '1') then fc_ident <= fc_ident + 1; + else + fc_ident <= fc_ident; end if; end if; end process THE_FC_IDENT_COUNTER_PROC; @@ -821,7 +845,7 @@ fc_flags_offset(15 downto 14) <= "00"; moreFragmentsProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) then + if (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) then fc_flags_offset(13) <= '0'; elsif ((loadCurrentState = DIVIDE) and (TC_READY_IN = '1')) or ((loadCurrentState = WAIT_FOR_FC) and (TC_READY_IN = '1')) then if ((actual_queue_size - actual_packet_size) < max_frame_size) then @@ -829,6 +853,8 @@ begin else fc_flags_offset(13) <= '1'; -- more fragments end if; + else + fc_flags_offset(13) <= fc_flags_offset(13); end if; end if; end process moreFragmentsProc; @@ -836,9 +862,7 @@ end process moreFragmentsProc; eodProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') then - fc_eod <= '0'; - elsif (loadCurrentState = LOAD_DATA) and (bytes_loaded = max_frame_size - 2) then + if (loadCurrentState = LOAD_DATA) and (bytes_loaded = max_frame_size - 2) then fc_eod <= '1'; elsif (loadCurrentState = LOAD_SUB) and (bytes_loaded = max_frame_size - 2) then fc_eod <= '1'; @@ -853,9 +877,7 @@ end process eodProc; sodProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') then - fc_sod <= '0'; - elsif (loadCurrentState = WAIT_FOR_FC) and (TC_READY_IN = '1') then + if (loadCurrentState = WAIT_FOR_FC) and (TC_READY_IN = '1') then fc_sod <= '1'; elsif (loadCurrentState = DIVIDE) and (TC_READY_IN = '1') then fc_sod <= '1'; @@ -868,10 +890,12 @@ end process sodProc; offsetProc : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) then + if (loadCurrentState = LIDLE) or (loadCurrentState = CLEANUP) then fc_flags_offset(12 downto 0) <= (others => '0'); elsif ((loadCurrentState = DIVIDE) and (TC_READY_IN = '1')) then fc_flags_offset(12 downto 0) <= actual_packet_size(15 downto 3); + else + fc_flags_offset(12 downto 0) <= fc_flags_offset(12 downto 0); end if; end if; end process offsetProc; @@ -879,25 +903,25 @@ end process offsetProc; fcIPSizeProc : process(CLK) begin if rising_edge(CLK) then - if (RESET= '1') then - fc_ip_size <= (others => '0'); - elsif ((loadCurrentState = DIVIDE) and (TC_READY_IN = '1')) or ((loadCurrentState = WAIT_FOR_FC) and (TC_READY_IN = '1')) then + if ((loadCurrentState = DIVIDE) and (TC_READY_IN = '1')) or ((loadCurrentState = WAIT_FOR_FC) and (TC_READY_IN = '1')) then if (size_left >= max_frame_size) then fc_ip_size <= max_frame_size; else fc_ip_size <= size_left(15 downto 0); end if; + else + fc_ip_size <= fc_ip_size; end if; end if; end process fcIPSizeProc; fcUDPSizeProc : process(CLK) - begin +begin if rising_edge(CLK) then - if (RESET = '1') then - fc_udp_size <= (others => '0'); - elsif (loadCurrentState = WAIT_FOR_FC) and (TC_READY_IN = '1') then + if (loadCurrentState = WAIT_FOR_FC) and (TC_READY_IN = '1') then fc_udp_size <= queue_size(15 downto 0); + else + fc_udp_size <= fc_udp_size; end if; end if; end process fcUDPSizeProc; @@ -1015,7 +1039,7 @@ end process; subIntProc: process( CLK ) begin if rising_edge(CLK) then - if (RESET = '1') or (saveSubCurrentState = SIDLE) then + if (saveSubCurrentState = SIDLE) then sub_int_ctr <= 0; elsif (sub_int_ctr = 3) and (saveSubCurrentState /= SAVE_TERM) then sub_int_ctr <= 0; @@ -1023,6 +1047,8 @@ begin sub_int_ctr <= 0; elsif (saveSubCurrentState /= SIDLE) and (loadCurrentState /= PREP_DATA) then sub_int_ctr <= sub_int_ctr + 1; + else + sub_int_ctr <= sub_int_ctr; end if; end if; end process subIntProc; diff --git a/gbe2_ecp3/trb_net16_gbe_protocol_prioritizer.vhd b/gbe2_ecp3/trb_net16_gbe_protocol_prioritizer.vhd index b26b1b1..f0cbfad 100644 --- a/gbe2_ecp3/trb_net16_gbe_protocol_prioritizer.vhd +++ b/gbe2_ecp3/trb_net16_gbe_protocol_prioritizer.vhd @@ -37,12 +37,11 @@ begin PRIORITIZE : process(CLK, FRAME_TYPE_IN, PROTOCOL_CODE_IN) begin - - if rising_edge(CLK) then + if RESET = '1' then + CODE_OUT <= (others => '0'); + elsif rising_edge(CLK) then CODE_OUT <= (others => '0'); - - if (RESET = '0') then --**** HERE ADD YOU PROTOCOL RECOGNITION AT WANTED PRIORITY LEVEL -- priority level is the bit position in the CODE_OUT vector @@ -79,8 +78,6 @@ begin end case; - end if; - end if; end process PRIORITIZE; diff --git a/gbe2_ecp3/trb_net16_gbe_protocol_selector.vhd b/gbe2_ecp3/trb_net16_gbe_protocol_selector.vhd index 94a9135..a5b71b0 100644 --- a/gbe2_ecp3/trb_net16_gbe_protocol_selector.vhd +++ b/gbe2_ecp3/trb_net16_gbe_protocol_selector.vhd @@ -554,7 +554,7 @@ port map ( PS_BUSY_OUT <= busy; -SELECT_MACHINE_PROC : process(CLK) +SELECT_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then select_current_state <= IDLE; @@ -616,7 +616,7 @@ end process SELECT_MACHINE; INDEX_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (select_current_state = IDLE) then + if (select_current_state = IDLE) then index <= 0; elsif (select_current_state = LOOP_OVER and resp_ready(index) = '0') then index <= index + 1; @@ -629,21 +629,7 @@ end process INDEX_PROC; SELECTOR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') then - TC_DATA_OUT <= (others => '0'); - TC_FRAME_SIZE_OUT <= (others => '0'); - TC_FRAME_TYPE_OUT <= (others => '0'); - TC_DEST_MAC_OUT <= (others => '0'); - TC_DEST_IP_OUT <= (others => '0'); - TC_DEST_UDP_OUT <= (others => '0'); - TC_SRC_MAC_OUT <= (others => '0'); - TC_SRC_IP_OUT <= (others => '0'); - TC_SRC_UDP_OUT <= (others => '0'); - TC_IP_PROTOCOL_OUT <= (others => '0'); - TC_IDENT_OUT <= (others => '0'); - PS_RESPONSE_READY_OUT <= '0'; - selected <= (others => '0'); - elsif (select_current_state = SELECT_ONE or select_current_state = PROCESS_REQUEST) then + if (select_current_state = SELECT_ONE or select_current_state = PROCESS_REQUEST) then TC_DATA_OUT <= tc_data((index + 1) * 9 - 1 downto index * 9); TC_FRAME_SIZE_OUT <= tc_size((index + 1) * 16 - 1 downto index * 16); TC_FRAME_TYPE_OUT <= tc_type((index + 1) * 16 - 1 downto index * 16); diff --git a/gbe2_ecp3/trb_net16_gbe_receive_control.vhd b/gbe2_ecp3/trb_net16_gbe_receive_control.vhd index 4644a57..35e6712 100644 --- a/gbe2_ecp3/trb_net16_gbe_receive_control.vhd +++ b/gbe2_ecp3/trb_net16_gbe_receive_control.vhd @@ -200,22 +200,26 @@ end process; FRAMES_REC_CTR_PROC : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') then + if (RESET = '1') then frames_received_ctr <= (others => '0'); - elsif (FR_FRAME_VALID_IN = '1') then - frames_received_ctr <= frames_received_ctr + x"1"; + elsif rising_edge(CLK) then + if (FR_FRAME_VALID_IN = '1') then + frames_received_ctr <= frames_received_ctr + x"1"; + else + frames_received_ctr <= frames_received_ctr; end if; end if; end process FRAMES_REC_CTR_PROC; FRAMES_READOUT_CTR_PROC : process(CLK) begin - if rising_edge(CLK) then - if (RESET = '1') then + if (RESET = '1') then frames_readout_ctr <= (others => '0'); - elsif (RC_LOADING_DONE_IN = '1') then - frames_readout_ctr <= frames_readout_ctr + x"1"; + elsif rising_edge(CLK) then + if (RC_LOADING_DONE_IN = '1') then + frames_readout_ctr <= frames_readout_ctr + x"1"; + else + frames_readout_ctr <= frames_readout_ctr; end if; end if; end process FRAMES_READOUT_CTR_PROC; @@ -223,11 +227,13 @@ end process FRAMES_READOUT_CTR_PROC; -- debug only BYTES_REC_CTR_PROC : process(CLK) begin - if rising_edge(CLK) then if (RESET = '1') then bytes_rec_ctr <= (others => '0'); - elsif (FR_FRAME_VALID_IN = '1') then - bytes_rec_ctr <= bytes_rec_ctr + FR_FRAME_SIZE_IN; + elsif rising_edge(CLK) then + if (FR_FRAME_VALID_IN = '1') then + bytes_rec_ctr <= bytes_rec_ctr + FR_FRAME_SIZE_IN; + else + bytes_rec_ctr <= bytes_rec_ctr; end if; end if; end process BYTES_REC_CTR_PROC; @@ -235,14 +241,14 @@ end process BYTES_REC_CTR_PROC; SAVED_PROTO_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') then - saved_proto <= (others => '0'); - elsif (load_current_state = READY) then + if (load_current_state = READY) then if (and_all(proto_code) = '0') then saved_proto <= proto_code; else saved_proto <= (others => '0'); end if; + else + saved_proto <= saved_proto; end if; end if; end process SAVED_PROTO_PROC; diff --git a/gbe2_ecp3/trb_net16_gbe_response_constructor_DHCP.vhd b/gbe2_ecp3/trb_net16_gbe_response_constructor_DHCP.vhd index ab9edc1..f3b9c9b 100644 --- a/gbe2_ecp3/trb_net16_gbe_response_constructor_DHCP.vhd +++ b/gbe2_ecp3/trb_net16_gbe_response_constructor_DHCP.vhd @@ -72,7 +72,7 @@ architecture trb_net16_gbe_response_constructor_DHCP of trb_net16_gbe_response_c attribute syn_encoding : string; -type main_states is (BOOTING, SENDING_DISCOVER, WAITING_FOR_OFFER, SENDING_REQUEST, WAITING_FOR_ACK, ESTABLISHED); +type main_states is (BOOTING, DELAY, SENDING_DISCOVER, WAITING_FOR_OFFER, SENDING_REQUEST, WAITING_FOR_ACK, ESTABLISHED); signal main_current_state, main_next_state : main_states; attribute syn_encoding of main_current_state: signal is "onehot"; @@ -160,12 +160,15 @@ g_MY_IP <= saved_true_ip when main_current_state = ESTABLISHED else (others => ' SAVE_SERVER_ADDR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (main_current_state = BOOTING) then + if (main_current_state = BOOTING) then saved_server_mac <= (others => '0'); saved_server_ip <= (others => '0'); elsif (main_current_state = WAITING_FOR_OFFER) and (receive_current_state = SAVE_VALUES and save_ctr = 1) then saved_server_mac <= PS_SRC_MAC_ADDRESS_IN; saved_server_ip <= PS_SRC_IP_ADDRESS_IN; + else + saved_server_mac <= saved_server_mac; + saved_server_ip <= saved_server_ip; end if; end if; end process SAVE_SERVER_ADDR_PROC; @@ -173,7 +176,7 @@ end process SAVE_SERVER_ADDR_PROC; -- **** MAIN MACHINE PART -MAIN_MACHINE_PROC : process(CLK) +MAIN_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then main_current_state <= BOOTING; @@ -186,7 +189,7 @@ begin end if; end process MAIN_MACHINE_PROC; -MAIN_MACHINE : process(main_current_state, DHCP_START_IN, construct_current_state, wait_ctr, receive_current_state, PS_DATA_IN) +MAIN_MACHINE : process(main_current_state, DHCP_START_IN, construct_current_state, saved_true_ip, saved_proposed_ip, wait_ctr, receive_current_state, PS_DATA_IN) begin case (main_current_state) is @@ -194,10 +197,17 @@ begin when BOOTING => state2 <= x"1"; if (DHCP_START_IN = '1') then - main_next_state <= SENDING_DISCOVER; + main_next_state <= DELAY; --SENDING_DISCOVER; else main_next_state <= BOOTING; end if; + + when DELAY => + if (wait_ctr = x"2000_0000") then + main_next_state <= SENDING_DISCOVER; + else + main_next_state <= DELAY; + end if; when SENDING_DISCOVER => state2 <= x"2"; @@ -211,7 +221,7 @@ begin state2 <= x"3"; if (receive_current_state = SAVE_VALUES) and (PS_DATA_IN(8) = '1') then main_next_state <= SENDING_REQUEST; - elsif (wait_ctr = x"1000_0000") then + elsif (wait_ctr = x"2000_0000") then main_next_state <= BOOTING; else main_next_state <= WAITING_FOR_OFFER; @@ -229,7 +239,7 @@ begin state2 <= x"5"; if (receive_current_state = SAVE_VALUES) and (PS_DATA_IN(8) = '1') then main_next_state <= ESTABLISHED; - elsif (wait_ctr = x"1000_0000") then + elsif (wait_ctr = x"2000_0000") then main_next_state <= BOOTING; else main_next_state <= WAITING_FOR_ACK; @@ -237,11 +247,11 @@ begin when ESTABLISHED => state2 <= x"6"; - if (saved_proposed_ip = saved_true_ip) then +-- if (saved_proposed_ip = saved_true_ip) then main_next_state <= ESTABLISHED; - else - main_next_state <= BOOTING; - end if; +-- else +-- main_next_state <= BOOTING; +-- end if; end case; @@ -250,10 +260,12 @@ end process MAIN_MACHINE; WAIT_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (main_current_state = BOOTING or main_current_state = SENDING_DISCOVER or main_current_state = SENDING_REQUEST) then + if (main_current_state = SENDING_DISCOVER or main_current_state = SENDING_REQUEST or main_current_state = BOOTING) then wait_ctr <= (others => '0'); - elsif (main_current_state = WAITING_FOR_ACK or main_current_state = WAITING_FOR_OFFER) then + elsif (main_current_state = WAITING_FOR_ACK or main_current_state = WAITING_FOR_OFFER or main_current_state = DELAY) then wait_ctr <= wait_ctr + x"1"; + else + wait_ctr <= wait_ctr; end if; end if; end process WAIT_CTR_PROC; @@ -263,18 +275,20 @@ DHCP_DONE_OUT <= '1' when main_current_state = ESTABLISHED else '0'; -- **** MESSAGES RECEIVING PART -RECEIVE_MACHINE_PROC : process(CLK) +RECEIVE_MACHINE_PROC : process(RESET, CLK) begin - if rising_edge(CLK) then - if (RESET = '1') or (main_current_state = BOOTING) then - receive_current_state <= IDLE; - else + if RESET = '1' then + receive_current_state <= IDLE; + elsif rising_edge(CLK) then + --if (main_current_state = BOOTING) then + -- receive_current_state <= IDLE; + --else receive_current_state <= receive_next_state; - end if; + --end if; end if; end process RECEIVE_MACHINE_PROC; -RECEIVE_MACHINE : process(receive_current_state, main_current_state, PS_DATA_IN, PS_DEST_MAC_ADDRESS_IN, g_MY_MAC, PS_ACTIVATE_IN, PS_WR_EN_IN, save_ctr) +RECEIVE_MACHINE : process(receive_current_state, main_current_state, bootp_hdr, saved_dhcp_type, saved_transaction_id, PS_DATA_IN, PS_DEST_MAC_ADDRESS_IN, g_MY_MAC, PS_ACTIVATE_IN, PS_WR_EN_IN, save_ctr) begin case receive_current_state is @@ -330,10 +344,12 @@ end process RECEIVE_MACHINE; SAVE_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (receive_current_state = IDLE) then + if (receive_current_state = IDLE) then save_ctr <= 0; elsif (receive_current_state = SAVE_VALUES and PS_WR_EN_IN = '1' and PS_ACTIVATE_IN = '1') then save_ctr <= save_ctr + 1; + else + save_ctr <= save_ctr; end if; end if; end process SAVE_CTR_PROC; @@ -341,13 +357,16 @@ end process SAVE_CTR_PROC; SAVE_VALUES_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (main_current_state = BOOTING) then + if (main_current_state = BOOTING) then saved_transaction_id <= (others => '0'); saved_proposed_ip <= (others => '0'); + saved_true_ip <= (others => '0'); saved_dhcp_type <= (others => '0'); -- dissection of DHCP Offer message elsif (main_current_state = WAITING_FOR_OFFER and receive_current_state = SAVE_VALUES) then + saved_true_ip <= saved_true_ip; + case save_ctr is when 3 => @@ -391,6 +410,8 @@ begin -- dissection on DHCP Ack message elsif (main_current_state = WAITING_FOR_ACK and receive_current_state = SAVE_VALUES) then + saved_proposed_ip <= saved_proposed_ip; + case save_ctr is when 3 => @@ -431,7 +452,11 @@ begin when others => null; end case; - + else + saved_transaction_id <= saved_transaction_id; + saved_proposed_ip <= saved_proposed_ip; + saved_true_ip <= saved_true_ip; + saved_dhcp_type <= saved_dhcp_type; end if; end if; end process SAVE_VALUES_PROC; @@ -439,7 +464,7 @@ end process SAVE_VALUES_PROC; -- **** MESSAGES CONSTRUCTING PART -CONSTRUCT_MACHINE_PROC : process(CLK) +CONSTRUCT_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then construct_current_state <= IDLE; @@ -557,7 +582,7 @@ end process CONSTRUCT_MACHINE; LOAD_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (construct_current_state = IDLE) then + if (construct_current_state = IDLE) then load_ctr <= 0; elsif (TC_RD_EN_IN = '1') and (PS_SELECTED_IN = '1') then -- elsif (construct_current_state /= IDLE and construct_current_state /= CLEANUP and PS_SELECTED_IN = '1') then @@ -579,7 +604,7 @@ end process LOAD_CTR_PROC; -- end if; --end process TC_WR_PROC; -TC_DATA_PROC : process(CLK, construct_current_state, load_ctr, bootp_hdr, g_MY_MAC, main_current_state) +TC_DATA_PROC : process(CLK) begin if rising_edge(CLK) then case (construct_current_state) is diff --git a/gbe2_ecp3/trb_net16_gbe_response_constructor_SCTRL.vhd b/gbe2_ecp3/trb_net16_gbe_response_constructor_SCTRL.vhd index 98719ca..06c5c84 100644 --- a/gbe2_ecp3/trb_net16_gbe_response_constructor_SCTRL.vhd +++ b/gbe2_ecp3/trb_net16_gbe_response_constructor_SCTRL.vhd @@ -311,7 +311,7 @@ gsc_init_dataready <= '1' when (GSC_INIT_READ_IN = '1' and dissect_current_state PACKET_NUM_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (dissect_current_state = IDLE) then + if (dissect_current_state = IDLE) then packet_num <= "100"; elsif (GSC_INIT_READ_IN = '1' and rx_fifo_rd = '1' and packet_num = "100") then packet_num <= "000"; @@ -412,7 +412,7 @@ GSC_REPLY_READ_OUT <= gsc_reply_read; TX_DATA_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1' or dissect_current_state = IDLE) then + if (dissect_current_state = IDLE) then tx_data_ctr <= (others => '0'); elsif (tx_fifo_wr = '1') then tx_data_ctr <= tx_data_ctr + x"2"; @@ -423,7 +423,7 @@ end process TX_DATA_CTR_PROC; TOO_MUCH_DATA_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') or (dissect_current_state = IDLE) then + if (dissect_current_state = IDLE) then too_much_data <= '0'; elsif (dissect_current_state = SAVE_RESPONSE) and (tx_data_ctr = x"fa00") then too_much_data <= '1'; @@ -435,7 +435,7 @@ end process TOO_MUCH_DATA_PROC; TX_LOADED_CTR_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1' or dissect_current_state = IDLE) then + if (dissect_current_state = IDLE) then tx_loaded_ctr <= x"0000"; elsif (dissect_current_state = LOAD_FRAME and PS_SELECTED_IN = '1' and TC_RD_EN_IN = '1') then tx_loaded_ctr <= tx_loaded_ctr + x"1"; @@ -475,7 +475,7 @@ TC_IDENT_OUT <= x"3" & reply_ctr(11 downto 0); TC_FRAME_SIZE_OUT <= tx_data_ctr; -DISSECT_MACHINE_PROC : process(CLK) +DISSECT_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then dissect_current_state <= IDLE; @@ -492,7 +492,7 @@ begin end if; end process DISSECT_MACHINE_PROC; -DISSECT_MACHINE : process(dissect_current_state, reset_detected, too_much_data, PS_WR_EN_IN, PS_ACTIVATE_IN, PS_DATA_IN, data_ctr, PS_SELECTED_IN, GSC_INIT_READ_IN, GSC_REPLY_DATAREADY_IN, tx_loaded_ctr, tx_data_ctr, rx_fifo_q, GSC_BUSY_IN, tx_frame_loaded, g_MAX_FRAME_SIZE) +DISSECT_MACHINE : process(dissect_current_state, reset_detected, too_much_data, PS_WR_EN_IN, PS_ACTIVATE_IN, PS_DATA_IN, PS_SELECTED_IN, GSC_INIT_READ_IN, GSC_REPLY_DATAREADY_IN, tx_loaded_ctr, tx_data_ctr, rx_fifo_q, GSC_BUSY_IN) begin case dissect_current_state is @@ -579,10 +579,12 @@ end process DISSECT_MACHINE; RESET_DETECTED_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1' or dissect_current_state = CLEANUP) then + if (dissect_current_state = IDLE) then reset_detected <= '0'; - elsif (PS_DATA_IN(7 downto 0) = x"80" and PS_WR_EN_IN = '1' and PS_ACTIVATE_IN = '1' and saved_hdr_ctr = "0100") then--and dissect_current_state = IDLE and PS_WR_EN_IN = '1' and PS_ACTIVATE_IN = '1') then -- first byte as 0x80 + elsif (PS_DATA_IN(7 downto 0) = x"80" and PS_WR_EN_IN = '1' and PS_ACTIVATE_IN = '1' and saved_hdr_ctr = "0100") then reset_detected <= '1'; + else + reset_detected <= reset_detected; end if; end if; end process RESET_DETECTED_PROC; @@ -590,10 +592,12 @@ end process DISSECT_MACHINE; MAKE_RESET_PROC : process(CLK) begin if rising_edge(CLK) then - if (RESET = '1') then + if (dissect_current_state = IDLE) then make_reset <= '0'; elsif (dissect_current_state = CLEANUP and reset_detected = '1') then make_reset <= '1'; + else + make_reset <= make_reset; end if; end if; end process MAKE_RESET_PROC; diff --git a/gbe2_ecp3/trb_net16_gbe_response_constructor_TrbNetData.vhd b/gbe2_ecp3/trb_net16_gbe_response_constructor_TrbNetData.vhd index fb7e5cd..3fec48d 100644 --- a/gbe2_ecp3/trb_net16_gbe_response_constructor_TrbNetData.vhd +++ b/gbe2_ecp3/trb_net16_gbe_response_constructor_TrbNetData.vhd @@ -271,7 +271,7 @@ port map( PC_TRIG_NR_IN => pc_trig_nr, PC_TRIGGER_TYPE_IN => pc_trig_type, PC_QUEUE_DEC_IN => CFG_QUEUE_DEC_IN, --x"0003_0062", --pc_queue_dec, - PC_MAX_FRAME_SIZE_IN => g_MAX_FRAME_SIZE, + PC_MAX_FRAME_SIZE_IN => (others => '0'), -- not used anymore PC_MAX_QUEUE_SIZE_IN => x"0000_0fd0", -- not used for the moment PC_DELAY_IN => (others => '0'), PC_INSERT_TTYPE_IN => CFG_INSERT_TTYPE_IN, diff --git a/gbe2_ecp3/trb_net16_gbe_setup.vhd b/gbe2_ecp3/trb_net16_gbe_setup.vhd index 3c99be2..ac94e5c 100644 --- a/gbe2_ecp3/trb_net16_gbe_setup.vhd +++ b/gbe2_ecp3/trb_net16_gbe_setup.vhd @@ -149,7 +149,6 @@ begin when x"04" => max_frame <= BUS_DATA_IN(15 downto 0); - g_MAX_FRAME_SIZE <= BUS_DATA_IN(15 downto 0); when x"05" => if (BUS_DATA_IN = x"0000_0000") then diff --git a/gbe2_ecp3/trb_net16_gbe_transmit_control2.vhd b/gbe2_ecp3/trb_net16_gbe_transmit_control2.vhd index 1443250..aca1526 100644 --- a/gbe2_ecp3/trb_net16_gbe_transmit_control2.vhd +++ b/gbe2_ecp3/trb_net16_gbe_transmit_control2.vhd @@ -33,6 +33,7 @@ port ( TC_SRC_UDP_IN : in std_logic_vector(15 downto 0); TC_TRANSMISSION_DONE_OUT : out std_logic; TC_IDENT_IN : in std_logic_vector(15 downto 0); + TC_MAX_FRAME_IN : in std_logic_vector(15 downto 0); -- signal to/from frame constructor FC_DATA_OUT : out std_logic_vector(7 downto 0); @@ -78,7 +79,7 @@ signal mon_packets_sent_ctr : std_logic_vector(31 downto 0); begin -TRANSMIT_MACHINE_PROC : process(CLK) +TRANSMIT_MACHINE_PROC : process(RESET, CLK) begin if RESET = '1' then transmit_current_state <= IDLE; @@ -91,7 +92,7 @@ begin end if; end process TRANSMIT_MACHINE_PROC; -TRANSMIT_MACHINE : process(transmit_current_state, FC_H_READY_IN, TC_DATAREADY_IN, FC_READY_IN, local_end, g_MAX_FRAME_SIZE, actual_frame_bytes, go_to_divide) +TRANSMIT_MACHINE : process(transmit_current_state, FC_H_READY_IN, TC_DATAREADY_IN, FC_READY_IN, local_end, TC_MAX_FRAME_IN, actual_frame_bytes, go_to_divide) begin case transmit_current_state is @@ -116,7 +117,7 @@ begin if (local_end = x"0000") then transmit_next_state <= SEND_ONE; else - if (actual_frame_bytes = g_MAX_FRAME_SIZE - x"1") then + if (actual_frame_bytes = TC_MAX_FRAME_IN - x"1") then transmit_next_state <= SEND_ONE; else transmit_next_state <= TRANSMIT; @@ -182,7 +183,7 @@ begin if rising_edge(CLK) then if (transmit_current_state = IDLE or transmit_current_state = DIVIDE) then go_to_divide <= '0'; - elsif (transmit_current_state = TRANSMIT and actual_frame_bytes = g_MAX_FRAME_SIZE - x"1") then + elsif (transmit_current_state = TRANSMIT and actual_frame_bytes = TC_MAX_FRAME_IN - x"1") then go_to_divide <= '1'; -- elsif (transmit_current_state = SEND_ONE and full_packet_size < packet_loaded_bytes - x"1") then -- go_to_divide <= '1'; @@ -220,8 +221,8 @@ process(CLK) begin if rising_edge(CLK) then if (transmit_current_state = PREPARE_HEADERS) then - if (local_end >= g_MAX_FRAME_SIZE) then - ip_size <= g_MAX_FRAME_SIZE; + if (local_end >= TC_MAX_FRAME_IN) then + ip_size <= TC_MAX_FRAME_IN; else ip_size <= local_end + x"1"; end if; @@ -239,7 +240,7 @@ MORE_FRAGMENTS_PROC : process(CLK) begin if rising_edge(CLK) then if (transmit_current_state = PREPARE_HEADERS) then - if (local_end >= g_MAX_FRAME_SIZE) then + if (local_end >= TC_MAX_FRAME_IN) then more_fragments <= '1'; else more_fragments <= '0'; diff --git a/gbe2_ecp3/trb_net_gbe_components.vhd b/gbe2_ecp3/trb_net_gbe_components.vhd index 906c89b..0f5c968 100644 --- a/gbe2_ecp3/trb_net_gbe_components.vhd +++ b/gbe2_ecp3/trb_net_gbe_components.vhd @@ -30,6 +30,7 @@ port ( TC_SRC_UDP_IN : in std_logic_vector(15 downto 0); TC_IDENT_IN : in std_logic_vector(15 downto 0); TC_TRANSMISSION_DONE_OUT : out std_logic; + TC_MAX_FRAME_IN : in std_logic_vector(15 downto 0); -- signal to/from frame constructor FC_DATA_OUT : out std_logic_vector(7 downto 0); @@ -414,7 +415,6 @@ port ( CLK : in std_logic; -- system clock CLK_125 : in std_logic; RESET : in std_logic; - RESET_FOR_DHCP : in std_logic; MC_LINK_OK_OUT : out std_logic; MC_RESET_LINK_IN : in std_logic; diff --git a/gbe2_ecp3/trb_net_gbe_protocols.vhd b/gbe2_ecp3/trb_net_gbe_protocols.vhd index 60bffe9..fe87182 100644 --- a/gbe2_ecp3/trb_net_gbe_protocols.vhd +++ b/gbe2_ecp3/trb_net_gbe_protocols.vhd @@ -16,11 +16,6 @@ signal g_MY_IP : std_logic_vector(31 downto 0); -- g_MY_MAC is being set by Main Controller signal g_MY_MAC : std_logic_vector(47 downto 0); --- size of ethernet frame use for fragmentation of outgoing packets -signal g_MAX_FRAME_SIZE : std_logic_vector(15 downto 0) := x"0578"; --x"0200"; -- set up in main controller - ---signal g_MAX_PACKET_SIZE : std_logic_vector(15 downto 0); - constant c_MAX_FRAME_TYPES : integer range 1 to 16 := 2; constant c_MAX_PROTOCOLS : integer range 1 to 16 := 5; --5; --4; --5; constant c_MAX_IP_PROTOCOLS : integer range 1 to 16 := 2;