From 00e5b8aadacf9c92ffbddcff504c3691aa11fc9b Mon Sep 17 00:00:00 2001 From: Michael Boehmer Date: Sun, 31 Jul 2022 23:08:31 +0200 Subject: [PATCH] OOB registers added --- gbe/tomcat_gbe.prj | 6 +++--- gbe/tomcat_gbe.vhd | 42 +++++++++++++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/gbe/tomcat_gbe.prj b/gbe/tomcat_gbe.prj index aec088a..15b9715 100644 --- a/gbe/tomcat_gbe.prj +++ b/gbe/tomcat_gbe.prj @@ -62,7 +62,7 @@ add_file -vhdl -lib work "../../trbnet/trb_net_components.vhd" add_file -vhdl -lib work "tdc_release/tdc_version.vhd" add_file -vhdl -lib work "../../trbnet/gbe_trb/base/trb_net_gbe_protocols.vhd" add_file -vhdl -lib work "../../trbnet/gbe_trb/base/trb_net_gbe_components.vhd" -add_file -vhdl -lib work "../../trbnet/trb_net16_hub_func.vhd" +#add_file -vhdl -lib work "../../trbnet/trb_net16_hub_func.vhd" #Basic Infrastructure add_file -vhdl -lib work "../../trb3sc/gbe_hub/reset_handler.vhd" @@ -197,9 +197,9 @@ add_file -vhdl -lib work "../../trbnet/gbe_trb/protocols/trb_net16_gbe_response_ add_file -vhdl -lib work "../../trbnet/gbe_trb/protocols/trb_net16_gbe_response_constructor_Ping.vhd" add_file -vhdl -lib work "../../trbnet/gbe_trb/protocols/trb_net16_gbe_response_constructor_DHCP.vhd" add_file -vhdl -lib work "../../trbnet/gbe_trb/protocols/trb_net16_gbe_response_constructor_SCTRL.vhd" -add_file -vhdl -lib work "../../trbnet/gbe_trb/protocols/trb_net16_gbe_response_constructor_KillPing.vhd" +#add_file -vhdl -lib work "../../trbnet/gbe_trb/protocols/trb_net16_gbe_response_constructor_KillPing.vhd" add_file -vhdl -lib work "../../trbnet/gbe_trb/protocols/trb_net16_gbe_response_constructor_Forward.vhd" -add_file -verilog -lib work "../../trbnet/gbe_trb_ecp5/media/ecp5-5g/serdes_gbe_softlogic.v" +#add_file -verilog -lib work "../../trbnet/gbe_trb_ecp5/media/ecp5-5g/serdes_gbe_softlogic.v" add_file -vhdl -lib work "../../trbnet/gbe_trb/ipcores/ecp5/fifo_4096x9.vhd" add_file -vhdl -lib work "../../trbnet/gbe_trb/ipcores/ecp5/fifo_512x32.vhd" diff --git a/gbe/tomcat_gbe.vhd b/gbe/tomcat_gbe.vhd index 258b503..a857b52 100644 --- a/gbe/tomcat_gbe.vhd +++ b/gbe/tomcat_gbe.vhd @@ -186,6 +186,13 @@ architecture arch of tomcat_gbe is signal sgl_debug : std_logic_vector(15 downto 0); + signal blink_counter : unsigned(9 downto 0); + + signal oob_reg_0_int : std_logic_vector(31 downto 0); + signal oob_reg_1_int : std_logic_vector(31 downto 0); + signal oob_reg_2_int : std_logic_vector(31 downto 0); + signal oob_reg_3_int : std_logic_vector(31 downto 0); + begin --------------------------------------------------------------------------- @@ -222,12 +229,23 @@ begin ); +--------------------------------------------------------------------------- +--------------------------------------------------------------------------- +THE_BLINK_COUNTER_PROC: process( clk_sys ) +begin + if( rising_edge(clk_sys) ) then + if( tick_ms_int = '1' ) then + blink_counter <= blink_counter + 1; + end if; + end if; +end process THE_BLINK_COUNTER_PROC; + --------------------------------------------------------------------------- -- GbE interface (SFP) --------------------------------------------------------------------------- GBE_SFP_INTERFACE: entity gbe_med_fifo generic map( - SERDES_NUM => 0 + SERDES_NUM => 3 ) port map( RESET => reset_i, @@ -273,7 +291,7 @@ begin --------------------------------------------------------------------------- GBE_COPPER_INTERFACE: entity gbe_med_fifo generic map( - SERDES_NUM => 3 + SERDES_NUM => 0 ) port map( RESET => reset_i, @@ -439,6 +457,11 @@ begin FWD_EOP_IN => fwd_eop_int, FWD_READY_OUT => fwd_ready_int, FWD_FULL_OUT => fwd_full_int, + -- + OOB_REGISTER_0_OUT => oob_reg_0_int, + OOB_REGISTER_1_OUT => oob_reg_1_int, + OOB_REGISTER_2_OUT => oob_reg_2_int, + OOB_REGISTER_3_OUT => oob_reg_3_int, -- reset MAKE_RESET_OUT => reset_via_gbe, -- debug @@ -519,8 +542,13 @@ begin TIMERS_OUT => timer, MY_ADDRESS_OUT => open ); - - common_stat_reg <= (others => '0'); + + common_stat_reg(159 downto 128) <= oob_reg_3_int; + common_stat_reg(127 downto 96) <= oob_reg_2_int; + common_stat_reg(95 downto 64) <= oob_reg_1_int; + common_stat_reg(63 downto 32) <= oob_reg_0_int; + +-- common_stat_reg <= (others => '0'); ------------------------------------------------------------------------------- -- Bus Handler @@ -616,9 +644,9 @@ begin LED_SFP_GREEN <= not (status(0) and status(1) and status(2)); --'0'; LED_SFP_YELLOW <= not status(5); --'0'; LED_SFP_RED <= not status(6); --'0'; - LED(3) <= not '1'; --additional_reg(7); --'0'; - LED(2) <= not '1'; --additional_reg(6); --'0'; - LED(1) <= not '1'; --additional_reg(5); --'0'; + LED(3) <= not std_logic(blink_counter(8)); --additional_reg(7); --'0'; + LED(2) <= not additional_reg(6); --'0'; + LED(1) <= not additional_reg(5); --'0'; LED(0) <= not additional_reg(4); --'0'; -- 0 red -- 2.43.0