]> jspc29.x-matter.uni-frankfurt.de Git - soda.git/commitdiff
About to rebuild the tx_control FSM. Major reconstruction.
authorPeter Lemmens <p.j.j.lemmens@rug.nl>
Wed, 30 Oct 2013 07:57:46 +0000 (08:57 +0100)
committerPeter Lemmens <p.j.j.lemmens@rug.nl>
Wed, 30 Oct 2013 07:57:46 +0000 (08:57 +0100)
12 files changed:
soda_client.lpf
soda_source.ldf
soda_source.lpf
source/med_ecp3_sfp_sync_down.vhd
source/med_ecp3_sfp_sync_up.vhd
source/soda_cmd_window_generator.vhd
source/soda_components.vhd
source/soda_packet_builder.vhd
source/soda_source.vhd
source/soda_superburst_gen.vhd
source/trb3_periph_sodaclient.vhd
source/trb3_periph_sodasource.vhd

index 8a14f16a18b620acfa9c6768df0524492a8ec5da..48babc7b2c795433f75bb90797c63b9f60a788c5 100644 (file)
@@ -1,4 +1,4 @@
-rvl_alias "clk_raw_internal" "clk_raw_internal";
+rvl_alias "reveal_ist_282" "the_sync_link/the_serdes/rx_full_clk_ch0";
 BLOCK RESETPATHS ;
 BLOCK ASYNCPATHS ;
 BLOCK RD_DURING_WR_PATHS ;
index fbf8ae47647f707cbfbfc8ab2469a50f77e2f7ea..514b9fe82afe3c2949282752fb4f479fb706a700 100644 (file)
@@ -4,7 +4,7 @@
         <Option name="HDL type" value="VHDL"/>
     </Options>
     <Implementation title="soda_source" dir="soda_source" description="soda_source" default_strategy="Strategy1">
-        <Options def_top="trb3_periph_sodasource" top="trb3_periph_sodasource"/>
+        <Options top="trb3_periph_sodasource"/>
         <Source name="source/version.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
@@ -20,6 +20,9 @@
         <Source name="source/soda_packet_builder.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
+        <Source name="source/soda_cmd_window_generator.vhd" type="VHDL" type_short="VHDL">
+            <Options/>
+        </Source>
         <Source name="source/soda_d8crc8.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
         <Source name="../trbnet/media_interfaces/ecp3_sfp/sfp_1_200_int.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="source/soda_cmd_window_generator.vhd" type="VHDL" type_short="VHDL">
-            <Options/>
-        </Source>
         <Source name="soda_source.lpf" type="Logic Preference" type_short="LPF">
             <Options/>
         </Source>
index ecba5270f77c2369b1bce44cb8a6f0d47bd690d1..d63a6c587fdcec057429fc79d5d5b0ec9a3da340 100644 (file)
@@ -1,4 +1,4 @@
-rvl_alias "reveal_ist_222" "the_sync_link/the_serdes/rx_full_clk_ch0";
+rvl_alias "reveal_ist_129" "the_sync_link/the_serdes/rx_full_clk_ch0";
 BLOCK RESETPATHS ;
 BLOCK ASYNCPATHS ;
 BLOCK RD_DURING_WR_PATHS ;
index 4875f2b2b52be4e780e8bc1996949b15df1a3a04..93bb87121406d02347d72d81a7db8d04c9808128 100644 (file)
@@ -325,7 +325,7 @@ THE_TX : soda_tx_control
                START_POSITION_IN                       => request_retr_position_i,    --TODO
 \r
                TX_DLM_INIT                                     =>      TX_DLM_INIT,
-               SEND_DLM                                                => '0', --TX_DLM,
+               SEND_DLM                                                => TX_DLM,
                SEND_DLM_WORD                           => TX_DLM_WORD,
 
                SEND_LINK_RESET_IN              => CTRL_OP(15),
@@ -493,14 +493,19 @@ STAT_DEBUG <= debug_reg;
 internal_make_link_reset_out <= make_link_reset_i when IS_SYNC_SLAVE = c_YES else '0';
 sd_los_i <= SD_LOS_IN when rising_edge(SYSCLK);        -- PL!
 
-STAT_OP(15) <= send_link_reset_i when rising_edge(SYSCLK);
-STAT_OP(14) <= '0';
-STAT_OP(13) <= internal_make_link_reset_out when rising_edge(SYSCLK); --make trbnet reset
-STAT_OP(12) <= '0';
-STAT_OP(11) <= '0';
-STAT_OP(10) <= rx_allow;
-STAT_OP(9)  <= tx_allow;
-STAT_OP(8 downto 4) <= (others => '0');
+STAT_OP(15)            <= send_link_reset_i when rising_edge(SYSCLK);
+STAT_OP(14)            <= '0';
+STAT_OP(13)            <= internal_make_link_reset_out when rising_edge(SYSCLK); --make trbnet reset
+STAT_OP(12)            <= '0';
+STAT_OP(11)            <= '0';
+STAT_OP(10)            <= rx_allow;
+STAT_OP(9)             <= tx_allow;
+--STAT_OP(8 downto 4) <= (others => '0');
+STAT_OP(8)             <= got_link_ready_i;
+STAT_OP(7)             <= send_link_reset_i;
+STAT_OP(6)             <= make_link_reset_i;
+STAT_OP(5)             <= request_retr_i;
+STAT_OP(4)             <= start_retr_i;
 STAT_OP(3 downto 0) <= x"0" when rx_allow_q = '1' and tx_allow_q = '1' else x"7";
 end med_ecp3_sfp_sync_down_arch;
 
index 369cd5489109f0874e583fb77140fe3b6b82366a..8d4c56dfd44186b2014cfd5af372863746264131 100644 (file)
@@ -495,14 +495,19 @@ internal_make_link_reset_out <= make_link_reset_i when IS_SYNC_SLAVE = c_YES els
 sd_los_i <= SD_LOS_IN when rising_edge(SYSCLK);        -- PL!
 
 
-STAT_OP(15) <= send_link_reset_i when rising_edge(SYSCLK);
-STAT_OP(14) <= '0';
-STAT_OP(13) <= internal_make_link_reset_out when rising_edge(SYSCLK); --make trbnet reset
-STAT_OP(12) <= '0';
-STAT_OP(11) <= '0';
-STAT_OP(10) <= rx_allow;
-STAT_OP(9)  <= tx_allow;
-STAT_OP(8 downto 4) <= (others => '0');
+STAT_OP(15)            <= send_link_reset_i when rising_edge(SYSCLK);
+STAT_OP(14)            <= '0';
+STAT_OP(13)            <= internal_make_link_reset_out when rising_edge(SYSCLK); --make trbnet reset
+STAT_OP(12)            <= '0';
+STAT_OP(11)            <= '0';
+STAT_OP(10)            <= rx_allow;
+STAT_OP(9)             <= tx_allow;
+--STAT_OP(8 downto 4) <= (others => '0');
+STAT_OP(8)             <= got_link_ready_i;
+STAT_OP(7)             <= send_link_reset_i;
+STAT_OP(6)             <= make_link_reset_i;
+STAT_OP(5)             <= request_retr_i;
+STAT_OP(4)             <= start_retr_i;
 STAT_OP(3 downto 0) <= x"0" when rx_allow_q = '1' and tx_allow_q = '1' else x"7";
 end med_ecp3_sfp_sync_up_arch;
 
index fca0ea42d03a0702b1b8f4764b19923a77c9a70b..7eb7bb863d33676e21b0cfb93499833003c3e6b2 100644 (file)
@@ -11,8 +11,8 @@ use work.trb_net16_hub_func.all;
 use work.soda_components.all;
 
 entity soda_cmd_window_generator is
-       generic(                CLOCK_PERIOD                    : natural range 1 to 20 := cSODA_CLOCK_PERIOD;                          -- clock-period in ns
-                                       COMMAND_WINDOS_SIZE     : natural range 1 to 256 := cSODA_COMMAND_WINDOS_SIZE           -- command window size in ns \r
+       generic(                CLOCK_PERIOD                    : natural range 1 to 20         := cSODA_CLOCK_PERIOD;                          -- clock-period in ns
+                                       COMMAND_WINDOS_SIZE     : natural range 1 to 65335 := cSODA_COMMAND_WINDOS_SIZE         -- command window size in ns \r
                                );
        port(
                SODACLK                                         : in    std_logic; -- fabric clock
index fa081a8cdad93ec8c4e8b0a884763ab5f7d2513f..125b04bd38d3ee70933856057922b6873e956eba 100644 (file)
@@ -33,8 +33,6 @@ package soda_components is
                port(
                        SODACLK                                                 : in    std_logic; -- fabric clock
                        RESET                                                           : in    std_logic; -- synchronous reset 
-                       CLEAR                                                           : in    std_logic; -- asynchronous reset
-                       CLK_EN                                                  : in    std_logic;
                        --Internal Connection
                        SODA_BURST_PULSE_IN                     : in    std_logic := '0';       -- 
                        START_OF_SUPERBURST_OUT         : out   std_logic := '0';
@@ -46,8 +44,6 @@ package soda_components is
                port(
                        SODACLK                                         : in    std_logic; -- fabric clock
                        RESET                                                   : in    std_logic; -- synchronous reset
-                       CLEAR                                                   : in    std_logic; -- asynchronous reset
-                       CLK_EN                                          : in    std_logic;
                        --Internal Connection
                        LINK_PHASE_IN                           : in    std_logic := '0';
                        SODA_CMD_STROBE_IN              : in    std_logic := '0';       -- 
@@ -98,8 +94,6 @@ package soda_components is
                        SYSCLK                                  : in    std_logic; -- fabric clock
                        SODACLK                                 : in    std_logic; -- clock for data to serdes
                        RESET                                           : in    std_logic; -- synchronous reset
-                       CLEAR                                           : in    std_logic; -- asynchronous reset
-                       CLK_EN                                  : in    std_logic; 
                        --Internal Connection
                        SODA_BURST_PULSE_IN     : in    std_logic := '0';       -- 
 
index 6e463d9e89c4ca2700a556ec0fdf070a0f5ca9e0..d33d2b3b131b1f51be4f0e29cecccbbf5ef69617 100644 (file)
@@ -13,8 +13,6 @@ entity soda_packet_builder is
        port(\r
                SODACLK                                         : in    std_logic; -- fabric clock\r
                RESET                                                   : in    std_logic; -- synchronous reset\r
-               CLEAR                                                   : in    std_logic; -- asynchronous reset\r
-               CLK_EN                                          : in    std_logic; \r
                --Internal Connection\r
                LINK_PHASE_IN                           : in    std_logic := '0';       --_vector(1 downto 0) := (others => '0');
                SODA_CMD_STROBE_IN              : in    std_logic := '0';       -- \r
@@ -51,6 +49,8 @@ architecture Behavioral of soda_packet_builder is
                                                                                                );\r
        signal  packet_state_S                          :       packet_state_type := c_IDLE;\r
        \r
+       signal  soda_cmd_reg_full_S             : std_logic;
+       signal  soda_cmd_reg_S                          : std_logic_vector(31 downto 0) := (others => '0');             -- from super-burst-nr-generator
 \r
 begin\r
 \r
@@ -189,6 +189,21 @@ begin
                end if;\r
        end process;\r
 \r
+       soda_cmd_reg_proc : process(SODACLK)\r
+       begin\r
+               if rising_edge(SODACLK) then\r
+                       if (RESET='1') then\r
+                               soda_cmd_reg_full_S     <= '0';\r
+                               soda_cmd_reg_S                  <= (others => '0');\r
+                       elsif (soda_pkt_valid_S = '1') then\r
+                               soda_cmd_reg_full_S     <= '1';
+                               soda_cmd_reg_S                  <= '0' & soda_cmd_word_S;
+                               
+                       end if;\r
+               end if;
+       end process;\r
+\r
+\r
        --soda_packet_fill_proc : process(SODACLK, packet_state_S)\r
        --begin\r
                --if rising_edge(SODACLK) then\r
index 0bc1705b3008d9bb1277d54b9ad121497377b3dd..6f2b8537024fec04a0c1f0d0dd470d52fcf9d339 100644 (file)
@@ -14,8 +14,6 @@ entity soda_source is
                SYSCLK                                  : in    std_logic; -- fabric clock
                SODACLK                                 : in    std_logic; -- clock for data to serdes
                RESET                                           : in    std_logic; -- synchronous reset
-               CLEAR                                           : in    std_logic; -- asynchronous reset
-               CLK_EN                                  : in    std_logic; 
                --Internal Connection
                SODA_BURST_PULSE_IN     : in    std_logic := '0';       -- 
 
@@ -79,8 +77,6 @@ begin
                port map(
                        SODACLK                                         =>      SODACLK,                
                        RESET                                                   =>      RESET,
-                       CLEAR                                                   =>      '0',
-                       CLK_EN                                          =>      CLK_EN,
                        --Internal Connection
                        SODA_BURST_PULSE_IN             =>      SODA_BURST_PULSE_IN,
                        START_OF_SUPERBURST_OUT =>      start_of_superburst_S,
@@ -91,8 +87,6 @@ begin
                port map(
                        SODACLK                                 =>      SODACLK,
                        RESET                                           =>      RESET,
-                       CLEAR                                           =>      '0',
-                       CLK_EN                                  => CLK_EN,
                        --Internal Connection
                        LINK_PHASE_IN                   =>      LINK_PHASE_IN,          --link_phase_S, PL!
                        SODA_CMD_STROBE_IN      => soda_cmd_strobe_sodaclk_S,
@@ -152,10 +146,10 @@ begin
        begin\r
                if( RESET = '1' ) then \r
                        TX_DLM_INIT_OUT <= '0';\r
-               elsif ((start_of_superburst_S='1' or soda_cmd_strobe_S='1') and LINK_PHASE_IN=c_IN_SYNC) then\r
+               elsif ((start_of_superburst_S='1' or soda_cmd_strobe_sodaclk_S='1') and LINK_PHASE_IN=c_IN_SYNC) then\r
                        TX_DLM_INIT_OUT <=      '1';\r
                elsif rising_edge(SODACLK) then\r
-                       if (start_of_superburst_S='1' or soda_cmd_strobe_S='1') then
+                       if (start_of_superburst_S='1' or soda_cmd_strobe_sodaclk_S='1') then
                                TX_DLM_INIT_OUT <=      '1';\r
                        else\r
                                TX_DLM_INIT_OUT <=      '0';
index 94f2553abc9c7ac556a4f58b9de2e42a5aade711..518fe60285793e63f28c2c6211e5f74848c8ee15 100644 (file)
@@ -17,8 +17,6 @@ entity soda_superburst_generator is
        port(
                SODACLK                                         : in    std_logic; -- fabric clock
                RESET                                                   : in    std_logic; -- synchronous reset
-               CLEAR                                                   : in    std_logic; -- asynchronous reset
-               CLK_EN                                          : in    std_logic;
                --Internal Connection
                SODA_BURST_PULSE_IN             : in    std_logic := '0';       -- 
                START_OF_SUPERBURST_OUT : out   std_logic := '0';
index 2d3d483c8399fd8e5194242f953823c6262faafb..b3350f2eed64f2e7e22207f23e29e53457c0c803 100644 (file)
@@ -576,10 +576,14 @@ THE_SYNC_LINK : med_ecp3_sfp_sync_up
 ---------------------------------------------------------------------------
 -- LED
 ---------------------------------------------------------------------------
-       LED_ORANGE <= not reset_i when rising_edge(clk_sys_internal);
-       LED_YELLOW <= soda_leds(0);     --'1';
-       LED_GREEN  <= not med_stat_op(9);
-       LED_RED    <= not (med_stat_op(10) or med_stat_op(11));
+       LED_ORANGE <= med_stat_op(8);
+       LED_YELLOW <= med_stat_op(10);
+       LED_GREEN  <= med_stat_op(9);
+       LED_RED    <= med_stat_op(6);
+--     LED_ORANGE <= not reset_i when rising_edge(clk_sys_internal);
+--     LED_YELLOW <= soda_leds(0);     --'1';
+--     LED_GREEN  <= not med_stat_op(9);
+--     LED_RED    <= not (med_stat_op(10) or med_stat_op(11));
 --     LED_ORANGE <= soda_leds(0);
 --     LED_YELLOW <= soda_leds(1);
 --     LED_GREEN  <= soda_leds(2);
index e5795f5008b1b0b22d4ce519af1b428190949243..a98540c857a5f5e63debf3113ec708503a4e10fc 100644 (file)
@@ -586,8 +586,6 @@ THE_SODA_SOURCE : soda_source
                SYSCLK                                  => clk_sys_i,
                SODACLK                                 => clk_raw_internal,
                RESET                                           => reset_i,
-               CLEAR                                           => clear_i,
-               CLK_EN                                  => '1',
                --Internal Connection
                SODA_BURST_PULSE_IN     => SOB_S,
 
@@ -611,10 +609,14 @@ THE_SODA_SOURCE : soda_source
 ---------------------------------------------------------------------------
 -- LED
 ---------------------------------------------------------------------------
-       LED_ORANGE <= not reset_i when rising_edge(clk_sys_internal);
-       LED_YELLOW <= soda_leds(0);     --'1';
-       LED_GREEN  <= not med_stat_op(9);
-       LED_RED    <= not (med_stat_op(10) or med_stat_op(11));
+       LED_ORANGE <= med_stat_op(16+8);
+       LED_YELLOW <= med_stat_op(16+10);
+       LED_GREEN  <= med_stat_op(16+9);
+       LED_RED    <= med_stat_op(16+6);
+--     LED_ORANGE <= not reset_i when rising_edge(clk_sys_internal);
+--     LED_YELLOW <= soda_leds(0);     --'1';
+--     LED_GREEN  <= not med_stat_op(9);
+--     LED_RED    <= not (med_stat_op(10) or med_stat_op(11));
 --     LED_ORANGE <= soda_leds(0);
 --     LED_YELLOW <= soda_leds(1);
 --     LED_GREEN  <= soda_leds(2);