Changeset 210 for trunk


Ignore:
Timestamp:
Mar 20, 2012, 4:32:16 PM (12 years ago)
Author:
bouyer
Message:

cache_monitor(): use read_neutral(), this should not change the cache state
If paddr_t is not larger than 32bits do not try to shift by 32bits,

and assert that the high bits are 0.

ICACHE_MISS_INVAL, DCACHE_MISS_INVAL: assert that inval() did something.
Add some more debug messages

File:
1 edited

Legend:

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

    r209 r210  
    478478    size_t      cache_word;
    479479    uint32_t    cache_rdata;
    480     bool        cache_hit = r_dcache.read( addr,
     480    bool        cache_hit = r_dcache.read_neutral( addr,
    481481                                           &cache_rdata,
    482482                                           &cache_way,
     
    938938            r_tgt_pktid = p_vci_tgt_c.pktid.read();
    939939
    940             r_tgt_paddr  = (paddr_t)(p_vci_tgt_c.be.read() & 0x3) << 32 |
    941                           (paddr_t)p_vci_tgt_c.wdata.read() * m_dcache_words * 4;
     940            if (sizeof(paddr_t) <= 32) {
     941                assert(p_vci_tgt_c.be.read() == 0 && "byte enable should be 0 for 32bits paddr");
     942                r_tgt_paddr  =
     943                        (paddr_t)p_vci_tgt_c.wdata.read() * m_dcache_words * 4;
     944            } else {
     945                r_tgt_paddr  = (paddr_t)(p_vci_tgt_c.be.read() & 0x3) << 32 |
     946                        (paddr_t)p_vci_tgt_c.wdata.read() * m_dcache_words * 4;
     947            }
    942948
    943949            if ( (address&0x3) == 0x3 ) // broadcast invalidate for data or instruction type
     
    12531259            if ( (int)r_dcache_xtn_opcode.read() == (int)iss_t::XTN_MMU_ICACHE_PA_INV)
    12541260            {
    1255                 r_icache_vci_paddr   = (paddr_t)r_mmu_word_hi.read() << 32 |
    1256                                        (paddr_t)r_mmu_word_lo.read();
     1261                if (sizeof(paddr_t) <= 32) {
     1262                        assert(r_mmu_word_hi.read() == 0 &&
     1263                            "high bits should be 0 for 32bit paddr");
     1264                        r_icache_vci_paddr = (paddr_t)r_mmu_word_lo.read();
     1265                } else {
     1266                        r_icache_vci_paddr =
     1267                                (paddr_t)r_mmu_word_hi.read() << 32 |
     1268                                (paddr_t)r_mmu_word_lo.read();
     1269                }
    12571270                r_icache_fsm         = ICACHE_XTN_CACHE_INVAL_PA;   
    12581271                break;
     
    16331646    {
    16341647        paddr_t nline;
    1635 
    1636         r_icache.inval( r_icache_miss_way.read(),
     1648        bool hit;
     1649
     1650        hit = r_icache.inval( r_icache_miss_way.read(),
    16371651                        r_icache_miss_set.read(),
    16381652                        &nline );       // unused
     1653        assert(hit && "selected way/set line should be in icache");
    16391654
    16401655        r_icache_fsm = ICACHE_MISS_WAIT;
     
    23352350                    case iss_t::XTN_MMU_DCACHE_PA_INV:          // dcache, dtlb & itlb access
    23362351                        r_dcache_fsm   = DCACHE_XTN_DC_INVAL_PA;
    2337                         r_dcache_p0_paddr = (paddr_t)r_mmu_word_hi.read() << 32 |
    2338                                          (paddr_t)r_mmu_word_lo.read();
     2352                        if (sizeof(paddr_t) <= 32) {
     2353                                assert(r_mmu_word_hi.read() == 0 &&
     2354                                    "high bits should be 0 for 32bit paddr");
     2355                                r_dcache_p0_paddr =
     2356                                        (paddr_t)r_mmu_word_lo.read();
     2357                        } else {
     2358                                r_dcache_p0_paddr =
     2359                                        (paddr_t)r_mmu_word_hi.read() << 32 |
     2360                                        (paddr_t)r_mmu_word_lo.read();
     2361                        }
    23392362                        break;
    23402363
     
    35863609        size_t  way        = r_dcache_miss_way.read();
    35873610        size_t  set        = r_dcache_miss_set.read();
    3588 
    3589         r_dcache.inval( way,
     3611        bool hit;
     3612
     3613        hit = r_dcache.inval( way,
    35903614                        set,
    35913615                        &nline );
    3592 
     3616        assert(hit && "selected way/set line should be in dcache");
     3617
     3618#if DEBUG_DCACHE
     3619if ( m_debug_dcache_fsm )
     3620{
     3621    std::cout << "  <PROC.DCACHE_MISS_INVAL> inval line:"
     3622              << " / way = "   << way
     3623              << " / set = "   << set
     3624              << " / nline = "  << std::hex << nline << std::endl;
     3625}
     3626#endif
    35933627        // if selective itlb & dtlb invalidate are required
    35943628        // the miss response is not handled before invalidate completed
Note: See TracChangeset for help on using the changeset viewer.