]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
small change to trb_net_base_api.vhd, Jan
authorhadeshyp <hadeshyp>
Fri, 31 Aug 2007 11:44:00 +0000 (11:44 +0000)
committerhadeshyp <hadeshyp>
Fri, 31 Aug 2007 11:44:00 +0000 (11:44 +0000)
trb_net_base_api.vhd

index 9e01b81cbdb69090b932d883326c9dd040a8cb47..150b98323ec6343527952416347e165eebf5af00 100644 (file)
@@ -361,7 +361,7 @@ begin
     ACTIVE_SBUF: trb_net_sbuf
       generic map (
         DATA_WIDTH => 51,
-        VERSION => 1)
+        VERSION => 0)
       port map (
         CLK   => CLK,
         RESET  => RESET,
@@ -431,6 +431,7 @@ begin
       next_APL_DATAREADY_OUT <= '0';
       fifo_to_apl_read <= '0';
       next_slave_running <= slave_running;
+      next_sequence_counter <= sequence_counter;
     -------------------------------------------------------------------------------
     -- IDLE
     -------------------------------------------------------------------------------
@@ -440,24 +441,23 @@ begin
             next_state <=  SEND_SHORT;  -- no next data word, waiting for falling edge of APL_SEND_IN
             next_INT_MASTER_DATAREADY_OUT <= '0';
           else  -- normal transfer, prepare the header
-            next_state <=  SEND_HEADER;
+            next_state <= SEND_HEADER;
             out_select <= HDR;
             next_INT_MASTER_DATAREADY_OUT <= '1';
           end if;                       -- next word will be a header
         else
-          next_state <=  IDLE;                      
+          next_state <=  IDLE;
         end if;                         -- APL_SEND_IN
     -------------------------------------------------------------------------------
     -- SEND_SHORT
     -------------------------------------------------------------------------------
       elsif current_state = SEND_SHORT then 
         next_state <=  SEND_SHORT;
+        update_registered_trailer <= '1';
         if APL_SEND_IN = '0' then -- terminate the transfer
           next_state <= SEND_TRAILER;
           next_INT_MASTER_DATAREADY_OUT <= '1';
           out_select <= TRM;
-        else
-          update_registered_trailer <= '1';
         end if;
     -------------------------------------------------------------------------------
     -- SEND_HEADER
@@ -560,6 +560,7 @@ begin
           end if;
           if reg_APL_TYP_OUT = TYPE_TRM and (APL_READ_IN = '1' and reg_APL_DATAREADY_OUT = '1') then  --fifo_to_apl_read = '1'
             next_state <= IDLE;
+            next_sequence_counter <= sequence_counter +1;
           end if;
         end if;
         -- MISSING: SEQNR check
@@ -629,21 +630,21 @@ begin
   APL_DATA_OUT <= reg_APL_DATA_OUT;
   APL_TYP_OUT <= reg_APL_TYP_OUT;
 --  APL_RUN_OUT <= '0' when ((current_state = IDLE )) 
-  APL_RUN_OUT <= '0' when ((current_state = IDLE and API_TYPE = 1) 
+  APL_RUN_OUT <= '0' when ((current_state = IDLE and API_TYPE = 1)
                            or (slave_running = '0'  and API_TYPE = 0))
                  else '1';
   APL_SEQNR_OUT <= sequence_counter;
     
 -- generate the sequence counter
-    -- combinatorial part
-  SEQNR_COMB : process(sequence_counter, current_state, next_state)
-    begin
-      if current_state = WAITING and next_state = IDLE then
-        next_sequence_counter <=  sequence_counter+1;
-      else
-        next_sequence_counter <=  sequence_counter;
-      end if;
-    end process;
+--     -- combinatorial part
+--   SEQNR_COMB : process(sequence_counter, current_state, next_state)
+--     begin
+--       if current_state = WAITING and next_state = IDLE then
+--         next_sequence_counter <=  sequence_counter+1;
+--       else
+--         next_sequence_counter <=  sequence_counter;
+--       end if;
+--     end process;