Ignore:
Timestamp:
Nov 25, 2012, 1:20:00 AM (12 years ago)
Author:
bouyer
Message:

Fix writes:

  • properly compute r_buf_address, + has highter priority than <<
  • compute r_block_count after writing the block to file, not before. Also, don't forget to reset r_index.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_block_device_tsar_v4/caba/source/src/vci_block_device_tsar_v4.cpp

    r260 r272  
    338338            if ( p_vci_initiator.reop.read() )  // last flit of the burst
    339339            {
    340                     r_flit_count  = 0;
    341                 r_buf_address = r_buf_address.read() + r_burst_nflits.read()<<2;
    342 
    343                         if( (p_vci_initiator.rerror.read()&0x1) != 0 )
     340                r_flit_count  = 0;
     341                r_buf_address = r_buf_address.read() + (r_burst_nflits.read()<<2);
     342
     343                if( (p_vci_initiator.rerror.read()&0x1) != 0 )
    344344                {
    345345                    r_initiator_fsm = M_WRITE_ERROR;
     
    348348                          (aligned and (r_burst_count.read() == (m_bursts_per_block-1))) ) // last burst
    349349                {
    350                     r_burst_count    = 0;
    351                     r_block_count    = r_block_count.read() + 1;
    352350                    r_initiator_fsm  = M_WRITE_BLOCK;
    353351                }
     
    376374                r_initiator_fsm = M_WRITE_ERROR;
    377375            }
    378             else if ( r_block_count.read() == r_nblocks.read() )
     376            else if ( r_block_count.read() == r_nblocks.read() - 1 )
    379377            {
    380378                r_initiator_fsm = M_WRITE_SUCCESS;
     
    382380            else
    383381            {
     382                r_burst_count    = 0;
     383                r_index          = 0;
     384                r_block_count    = r_block_count.read() + 1;
    384385                r_initiator_fsm = M_WRITE_BURST;
    385386            }
Note: See TracChangeset for help on using the changeset viewer.