]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
locked working in ibuf, Ingo
authorhadaq <hadaq>
Fri, 25 Aug 2006 14:20:14 +0000 (14:20 +0000)
committerhadaq <hadaq>
Fri, 25 Aug 2006 14:20:14 +0000 (14:20 +0000)
testbench/trb_net_ibuf_testbench.vhd
trb_net_ibuf.vhd

index c07daa62f455078757d7340dbaa62f435bff5b35..8cd1f345f641823bedcdc6d6313d764862475ed0 100644 (file)
@@ -33,7 +33,8 @@ architecture trb_net_ibuf_testbench_arch of trb_net_ibuf_testbench is
   signal read_f2   : std_logic_vector(3 downto 0) := (others => '0');
   signal read_f1   : std_logic_vector(3 downto 0) := (others => '0');
   signal stat_buffer  : std_logic_vector(31 downto 0) := (others => '0');
-
+  signal stat_locked  : std_logic_vector(15 downto 0) := (others => '0');
+  
   signal waiter : std_logic := '0';
   
   
@@ -81,7 +82,8 @@ begin
       INT_DATA_OUT    => int_data_out,
       INT_READ_IN     => int_read_in,
       CTRL_LOCKED     => (others => '0'),
-      STAT_BUFFER => stat_buffer
+      STAT_BUFFER => stat_buffer,
+      STAT_LOCKED => stat_locked
       );
   
   clk <= not clk after 10ns;
index bc0de5a589bf5181cc8e0e017bd24dda1e8aa74c..1f3a69aa3a967500ea1d05fa17915a4b04f832be 100644 (file)
@@ -69,7 +69,7 @@ signal filtered_read_out : std_logic;
 
 signal got_ack_internal, reg_ack_internal : std_logic;    --should be raised for 1 cycle when ack
                                         --arrived
-signal is_locked, got_locked : std_logic;
+signal is_locked, got_locked,release_locked : std_logic;
 signal got_eob_out, reg_eob_out: std_logic;
 signal tmp_INT_DATAREADY_OUT: std_logic;
 signal current_last_header, next_last_header : std_logic_vector(50 downto 0);
@@ -183,10 +183,10 @@ INT_DATAREADY_OUT <= tmp_INT_DATAREADY_OUT;
   
 -- this process control the read of the internal point from the fifo
   FILTER_OUT: process (INT_READ_IN, INT_HEADER_IN, fifo_data_out,
-                       current_last_header)
+                       current_last_header, release_locked, is_locked)
     
   begin  -- process
-    got_locked  <= '0';
+    got_locked  <= is_locked;
     fifo_read   <= '0';
     got_eob_out <= '0';
     next_last_header <= current_last_header;
@@ -196,7 +196,9 @@ INT_DATAREADY_OUT <= tmp_INT_DATAREADY_OUT;
       if fifo_data_out(TYPE_POSITION) = TYPE_TRM then
         got_eob_out <= '1';
         fifo_read   <= '1';
-        
+        if release_locked = '0' then
+          got_locked  <= '1';
+        end if;
       else                          -- no TRM, normal read
         got_eob_out <= '0';
         fifo_read   <= '1';
@@ -217,7 +219,9 @@ INT_DATAREADY_OUT <= tmp_INT_DATAREADY_OUT;
   
 
 
-
+release_locked <= CTRL_LOCKED(0);
+STAT_LOCKED(0) <= is_locked;
+STAT_LOCKED(15 downto 1) <= (others => '0');
   
 reg_locked: process(CLK)
     begin
@@ -227,7 +231,11 @@ reg_locked: process(CLK)
         reg_eob_out <= '0';
         current_last_header <= (others => '0');
       elsif CLK_EN = '1' then
-        is_locked <= got_locked;
+        if release_locked = '1' then
+          is_locked <= '0';
+        else
+          is_locked <= got_locked;
+        end if;
         reg_eob_out <= got_eob_out;
         current_last_header <= next_last_header;
       else