]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
temporarily switched off buffer check in iobuf, Jan
authorhadeshyp <hadeshyp>
Thu, 6 Sep 2007 14:01:55 +0000 (14:01 +0000)
committerhadeshyp <hadeshyp>
Thu, 6 Sep 2007 14:01:55 +0000 (14:01 +0000)
trb_net_ibuf.vhd
trb_net_iobuf.vhd
trb_net_obuf.vhd
trb_net_passive_apimbuf.vhd
trb_net_trigger_reader.vhd

index c4195dd6a254c48994a234fed36b5ef46b91998e..0e61fbcfa4f3f6d8ac4d0f54e687289c4411c12d 100644 (file)
@@ -160,7 +160,7 @@ signal next_rec_buffer_size_out, current_rec_buffer_size_out
     end process;
 
     MED_READ_OUT <= reg_read_out; 
-    
+
 reg_buffer: process(CLK)
     begin
     if rising_edge(CLK) then
@@ -214,7 +214,7 @@ reg_buffer: process(CLK)
     fifo_read   <= '0';
     got_locked  <= is_locked;
     next_last_header <= current_last_header;
+
     if fifo_empty = '0' then
       if sbuf_free  = '1' and fifo_data_out(TYPE_POSITION) = TYPE_DAT then
         -- next data word can be registered
@@ -243,11 +243,11 @@ reg_buffer: process(CLK)
   end process;
 
 --BUGBUG HDR retransmit needed
-  
+
 release_locked <= CTRL_LOCKED(0);
 STAT_LOCKED(0) <= is_locked;
 STAT_LOCKED(15 downto 1) <= (others => '0');
-  
+
 reg_locked: process(CLK)
     begin
     if rising_edge(CLK) then
index c90ea91da81d7c7a40f75061ece3c3fac6b4a7f5..e42132b6c97b87852678c33e6e7c272d6240b9c8 100644 (file)
@@ -13,7 +13,9 @@ use work.trb_net_std.all;
 entity trb_net_iobuf is
 
   generic (
---    INIT_DEPTH : integer := 0;
+      SWITCH_OFF_BUFFER_CHECK : integer := 0;
+                      --switching off erroneous output buffer counter. MUST ONLY be 
+                      --used for short transfers!!!!
       INIT_DEPTH : integer := 3;     -- Depth of the FIFO, 2^(n+1), if
                                           -- the initibuf
       REPLY_DEPTH : integer := 3);   -- or the replyibuf
@@ -135,7 +137,11 @@ architecture trb_net_iobuf_arch of trb_net_iobuf is
   
   component trb_net_obuf is
   generic (
-    DATA_COUNT_WIDTH : integer := 4);
+    DATA_COUNT_WIDTH : integer := 4;    
+    SWITCH_OFF_BUFFER_CHECK : integer := 0
+                      --switching off erroneous output buffer counter. MUST ONLY be 
+                      --used for short transfers!!!!
+    );
   port(
     --  Misc
     CLK    : in std_logic;             
@@ -271,7 +277,11 @@ architecture trb_net_iobuf_arch of trb_net_iobuf is
     
     INITOBUF : trb_net_obuf
       generic map (
-        DATA_COUNT_WIDTH => 16)
+        DATA_COUNT_WIDTH => 16,
+        SWITCH_OFF_BUFFER_CHECK => SWITCH_OFF_BUFFER_CHECK
+                      --switching off erroneous output buffer counter. MUST ONLY be 
+                      --used for short transfers!!!!
+        )
       port map (
         CLK       => CLK,
         RESET     => RESET,
@@ -290,7 +300,11 @@ architecture trb_net_iobuf_arch of trb_net_iobuf is
 
     REPLYOBUF : trb_net_obuf
       generic map (
-        DATA_COUNT_WIDTH => 16)
+        DATA_COUNT_WIDTH => 16,
+        SWITCH_OFF_BUFFER_CHECK => SWITCH_OFF_BUFFER_CHECK
+                      --switching off erroneous output buffer counter. MUST ONLY be 
+                      --used for short transfers!!!!
+      )
       port map (
         CLK       => CLK,
         RESET     => RESET,
index e71c3bb9474d01070b50fffc5dc353a004fc4b6c..d4bc67eefa1abee55f551559f146abf14fa41cc4 100644 (file)
@@ -11,8 +11,11 @@ use work.trb_net_std.all;
 --Entity decalaration for clock generator
 entity trb_net_obuf is
   generic (
-    DATA_COUNT_WIDTH : integer := 4);
-
+    DATA_COUNT_WIDTH : integer := 4;
+    SWITCH_OFF_BUFFER_CHECK : integer := 0
+                      --switching off erroneous output buffer counter. MUST ONLY be 
+                      --used for short transfers!!!!
+    );
   port(
     --  Misc
     CLK    : in std_logic;             
@@ -158,9 +161,9 @@ architecture trb_net_obuf_arch of trb_net_obuf is
 
 --finally, block data read if the rec buffer is full
       if sent_data = '0' or
-        (next_DATA_COUNT(DATA_COUNT_WIDTH-1 downto 0) = max_DATA_COUNT_minus_one(DATA_COUNT_WIDTH-1 downto 0)) or
-        next_TRANSMITTED_BUFFERS(1) = '1'
-      then           
+        (next_DATA_COUNT(DATA_COUNT_WIDTH-1 downto 0) = max_DATA_COUNT_minus_one(DATA_COUNT_WIDTH-1 downto 0)) 
+        or (next_TRANSMITTED_BUFFERS(1) = '1' and SWITCH_OFF_BUFFER_CHECK = 0)
+      then
         next_INT_READ_OUT       <= '0';
       end if;
 --In any case: if sbuf not free, then we stop data taking
@@ -221,7 +224,7 @@ architecture trb_net_obuf_arch of trb_net_obuf is
   current_NOP_word(47 downto 0)   <= (others => '0');
     
   current_DATA_word(50 downto 0)  <= INT_DATA_IN;
-  sent_DATA                       <= not TRANSMITTED_BUFFERS(1);
+  sent_DATA                       <= '1' when (TRANSMITTED_BUFFERS(1) = '0' or SWITCH_OFF_BUFFER_CHECK = 1) else '0'; 
 
 -- generate max_DATA_COUNT, comb. operation which should be registered
 --     next_max_DATA_COUNT <= "0000000000000100" when REC_BUFFER_SIZE_IN="0001" else
index 9f8baaa58f914d209785e185d133e48da0397544..f56f7100da894e5ca44aee5e759d92a14d1362b3 100644 (file)
@@ -82,7 +82,10 @@ architecture trb_net_passive_apimbuf_arch of trb_net_passive_apimbuf is
 
 component trb_net_iobuf is
 
-  generic (INIT_DEPTH : integer := 3;     -- Depth of the FIFO, 2^(n+1), if
+  generic (SWITCH_OFF_BUFFER_CHECK : integer := 0;
+                      --switching off erroneous output buffer counter. MUST ONLY be 
+                      --used for short transfers!!!!
+           INIT_DEPTH : integer := 3;     -- Depth of the FIFO, 2^(n+1), if
                                           -- the initibuf
            REPLY_DEPTH : integer := 3);   -- or the replyibuf
 
@@ -377,7 +380,10 @@ STAT_api_control_signals(31 downto 13) <= (others => '0');
 
 IOBUF: trb_net_iobuf
 
-  generic map (INIT_DEPTH => INIT_DEPTH,
+  generic map (SWITCH_OFF_BUFFER_CHECK => 0,
+                      --switching off erroneous output buffer counter. MUST ONLY be 
+                      --used for short transfers!!!!
+               INIT_DEPTH => INIT_DEPTH,
                REPLY_DEPTH => REPLY_DEPTH)
 
   port map (
index ee9fc5dddb87a415c6ffabfffef189de62b17d2a..df697a47c0fd26afaa5f9990b07203bd8a7e51e4 100644 (file)
@@ -190,7 +190,7 @@ STAT_TRIGGER_READER <= buf_STAT_TRIGGER_READER;
       if trigger_num_is_read = '1' and trigger_time_is_read = '1' then
         next_trigger_num_is_read <= '0';
         next_trigger_time_is_read <= '0';
-        next_fifo_read <= '1';
+        fifo_read <= '1';
         next_TRB_TRIGGER_READ_ERROR <= buf_TRB_TRIGGER_READ_ERROR;
       end if;