Changeset 230


Ignore:
Timestamp:
May 8, 2012, 12:54:58 PM (12 years ago)
Author:
alain
Message:

Fixing a bug in the LL reservation registration

File:
1 edited

Legend:

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

    r229 r230  
    689689        r_mmu_mode = 0x3;
    690690
    691         // No request from ICACHE FSM to CMD FSM
     691            // No request from ICACHE FSM to CMD FSM
    692692        r_icache_miss_req          = false;
    693693        r_icache_unc_req           = false;
     
    712712
    713713        // No LL reservation
    714         r_dcache_ll_valid          = false;
     714            r_dcache_ll_valid          = false;
    715715
    716716        // No processor XTN request pending
     
    19641964    {
    19651965    case DCACHE_IDLE:   // There is 8 conditions to exit the IDLE state :
    1966                         // 1) Dirty bit update (processor)      => DCACHE_DIRTY_GET_PTE
    1967                         // 2) Coherence request (TGT FSM)       => DCACHE_CC_CHECK
    1968                         // 3) ITLB miss request (ICACHE FSM)    => DCACHE_TLB_MISS
    1969                         // 4) XTN request (processor)           => DCACHE_XTN_*
    1970                         // 5) DTLB miss (processor)             => DCACHE_TLB_MISS
    1971                         // 6) Cacheable read miss (processor)   => DCACHE_MISS_VICTIM
    1972                         // 7) Uncacheable read (processor)      => DCACHE_UNC_WAIT
    1973                         // 8) SC access (processor)             => DCACHE_SC_WAIT
     1966                                                // 1) Dirty bit update (processor)      => DCACHE_DIRTY_GET_PTE
     1967                                                // 2) Coherence request (TGT FSM)       => DCACHE_CC_CHECK
     1968                                                // 3) ITLB miss request (ICACHE FSM)    => DCACHE_TLB_MISS
     1969                                                // 4) XTN request (processor)           => DCACHE_XTN_*
     1970                                                // 5) DTLB miss (processor)             => DCACHE_TLB_MISS
     1971                                                // 6) Cacheable read miss (processor)   => DCACHE_MISS_VICTIM
     1972                                                // 7) Uncacheable read (processor)      => DCACHE_UNC_WAIT
     1973                                                // 8) SC access (processor)             => DCACHE_SC_WAIT
    19741974                        //
    19751975                        // The dtlb is unconditionally accessed to translate the
     
    25322532                    // If dcache miss, we go to DCACHE_MISS_VICTIM state.
    25332533                    // If uncacheable, we go to DCACHE_UNC_WAIT state.
     2534                    // In case of LL, the LL registration is done when the data is returned:
     2535                    // in DCACHE_IDLE if cacheable / in DCACHE_UNC_WAIT if uncacheable
    25342536                    if ( ((m_dreq.type == iss_t::DATA_READ) or (m_dreq.type == iss_t::DATA_LL))
    25352537                        and not r_dcache_p0_valid.read() and not r_dcache_p1_valid.read() )
     
    25702572                                m_drsp.valid   = true;
    25712573                                m_drsp.rdata   = cache_rdata;
     2574
     2575                                // makes reservation in case of LL
     2576                                if ( m_dreq.type == iss_t::DATA_LL )
     2577                                {
     2578                                    r_dcache_ll_valid = true;
     2579                                    r_dcache_ll_vaddr = m_dreq.addr;
     2580                                    r_dcache_ll_data  = cache_rdata;
     2581                                }
    25722582#if DEBUG_DCACHE
    25732583if ( m_debug_dcache_fsm )
     
    25862596                        }
    25872597
    2588                         // makes reservation in case of LL
    2589                         if ( m_dreq.type == iss_t::DATA_LL )
    2590                         {
    2591                             r_dcache_ll_valid = true;
    2592                             r_dcache_ll_data  = cache_rdata;
    2593                             r_dcache_ll_vaddr = m_dreq.addr;
    2594                         }
    25952598                        r_dcache_p0_valid = false;
    25962599                    } // end READ or LL
     
    26662669                            {
    26672670                                // The PTE physical address is obtained from the nline value (dtlb),
    2668                                 // and the word index (proper bits of the virtual address)
     2671                                // and the word index (virtual address)
    26692672                                if ( tlb_flags.b )      // PTE1
    26702673                                {
     
    38673870            break;
    38683871        }
    3869         else if ( r_vci_rsp_fifo_dcache.rok() )     // data available
    3870         {
     3872            else if ( r_vci_rsp_fifo_dcache.rok() )     // data available
     3873            {
     3874            // consume data
    38713875            vci_rsp_fifo_dcache_get = true;     
    38723876            r_dcache_fsm            = DCACHE_IDLE;
    3873             // we acknowledge the processor request if it has not been modified
     3877
     3878            // acknowledge the processor request if it has not been modified
    38743879            if ( m_dreq.valid and (m_dreq.addr == r_dcache_p0_vaddr.read()) )
    38753880            {
    3876                 m_drsp.valid          = true;
    3877                 m_drsp.rdata          = r_vci_rsp_fifo_dcache.read();
    3878             }
    3879         }       
     3881                    m_drsp.valid          = true;
     3882                    m_drsp.rdata          = r_vci_rsp_fifo_dcache.read();
     3883
     3884                // makes reservation in case of LL
     3885                if ( m_dreq.type == iss_t::DATA_LL )
     3886                {
     3887                    r_dcache_ll_valid = true;
     3888                    r_dcache_ll_data  = r_vci_rsp_fifo_dcache.read();
     3889                    r_dcache_ll_vaddr = m_dreq.addr;
     3890                }
     3891            }
     3892            }   
    38803893        break;
    38813894    }
Note: See TracChangeset for help on using the changeset viewer.