]> jspc29.x-matter.uni-frankfurt.de Git - cri.git/commitdiff
add separate reset signal to DCA communication (DCA-Trbnet bridge)
authorAdrian Weber <adrian.a.weber@exp2.physik.uni-giessen.de>
Thu, 18 Nov 2021 13:27:14 +0000 (14:27 +0100)
committerAdrian Weber <adrian.a.weber@exp2.physik.uni-giessen.de>
Thu, 18 Nov 2021 13:27:14 +0000 (14:27 +0100)
src/cri_trbnet_dca_bridge.vhd
src/cri_trbnet_dca_bridge_handler.vhd

index b0c9d9f388f84c4149ca26e86db856c8bf417c6a..662ced02b0345722028150919e5a4dffba70d903 100644 (file)
@@ -131,6 +131,9 @@ signal wait_dca, wait_dca_sync : std_logic := '0';
 
 signal reset_timeout           : std_logic_vector( 4 downto 0);
 
+signal dca_trb_reset           : std_logic;
+signal dca_trb_reset_nosync    : std_logic;
+
 begin
   reset_dca <= not RST_N_DCA;
 
@@ -157,6 +160,7 @@ begin
     TX_DATA_SIZE       => tx_data_size_dca,
     TX_READ_SIZE_ACK   => tx_rd_size_ack,
     
+    DCA_TRB_RESET      => dca_trb_reset_nosync,
     
     --WB_RESPONSE_READY_IN => WB_RESPONSE_READY,
 
@@ -209,6 +213,17 @@ THE_SYNC_RX_DATA : entity work.signal_sync
    PULSE_B_OUT => rx_data_wr_sync_i
  );
  
+ THE_SYNC_DCA_TRB_RESET_STB : entity work.pulse_sync
+ port map(
+   RESET_A_IN  => reset_dca,
+   CLK_A_IN    => CLK_DCA,
+   PULSE_A_IN  => dca_trb_reset_nosync,
+
+   RESET_B_IN  => RESET,
+   CLK_B_IN    => CLK,
+   PULSE_B_OUT => dca_trb_reset
+ );
+
  rx_data_wr_sync <= rx_data_wr_sync_i when reset_timeout(4) = '1'
                     else '0'; 
  
@@ -641,12 +656,16 @@ end process DISSECT_MACHINE;
 RESET_DETECTED_PROC : process(CLK)
 begin
   if rising_edge(CLK) then
-    if (dissect_current_state = IDLE) then
-      reset_detected <= '0';
-    elsif (rx_data_dca_sync(15 downto 8) = x"80" and rx_data_wr_sync = '1' and saved_hdr_ctr = "0010") then
+    if (dca_trb_reset = '1') then
       reset_detected <= '1';
     else
-      reset_detected <= reset_detected;
+      if (dissect_current_state = IDLE) then
+        reset_detected <= '0';
+      elsif (rx_data_dca_sync(15 downto 8) = x"80" and rx_data_wr_sync = '1' and saved_hdr_ctr = "0010") then
+        reset_detected <= '1';
+      else
+        reset_detected <= reset_detected;
+      end if;
     end if;
   end if;
 end process RESET_DETECTED_PROC;
@@ -656,6 +675,8 @@ begin
   if rising_edge(CLK) then
     if (dissect_current_state = IDLE) then
       make_reset <= '0';
+    elsif (dca_trb_reset = '1') then
+      make_reset <= '1';
     elsif (dissect_current_state = CLEANUP and reset_detected = '1') then
       make_reset <= '1';
     else
index d95177d9e310927baf4635a7397781de1b4e1432..dd24194a2853b5bf4b302cbcb575c2ceb830dbd0 100644 (file)
@@ -32,7 +32,9 @@ entity cri_trbnet_dca_bridge_handler is
     TX_DATA_IN       : in  std_logic_vector(31 downto 0);
     
     TX_DATA_SIZE     : in  std_logic_vector(15 downto 0); -- in byte
-    TX_READ_SIZE_ACK : out std_logic;   
+    TX_READ_SIZE_ACK : out std_logic;
+
+    DCA_TRB_RESET    : out std_logic;
 
     DEBUG_OUT        : out std_logic_vector(63 downto 0)
   );
@@ -108,6 +110,9 @@ GEN_AGWB_HANDLER_REAL: if SIMULATION = c_NO generate
     TX_SIZE_i(15 downto  0) => TX_DATA_SIZE,
     TX_SIZE_i_ack           => TX_READ_SIZE_ACK,
 
+    DCA_TRB_RESET_o         => open,
+    DCA_TRB_RESET_o_stb     => DCA_TRB_RESET,
+
     rst_n_i                 => RST_N,
     clk_sys_i               => CLK_DCA
   );