Changeset 338


Ignore:
Timestamp:
Mar 28, 2013, 2:12:01 PM (11 years ago)
Author:
joannou
Message:
  • In vci_cc_vcache_wrapper_dspin_coherence, modified both states DCACHE_TLB_PTE1_GET and DCACHE_TLB_PTE2_GET to take into account the zombi state of a chache line
  • In vci_mem_cache_dspin_coherence, added so traces
Location:
branches/v5/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/src/vci_cc_vcache_wrapper_dspin_coherence.cpp

    r336 r338  
    28612861        size_t          set;
    28622862        size_t          word;
    2863 
    2864         bool     hit = r_dcache.read( r_dcache_tlb_paddr.read(),
    2865                                       &entry,
    2866                                       &way,
    2867                                       &set,
    2868                                       &word );
     2863        int         cache_state;
     2864        r_dcache.read( r_dcache_tlb_paddr.read(),
     2865                       &entry,
     2866                       &way,
     2867                       &set,
     2868                       &word,
     2869                       &cache_state );
    28692870#ifdef INSTRUMENTATION
    28702871m_cpt_dcache_data_read++;
    28712872m_cpt_dcache_dir_read++;
    28722873#endif
    2873         if ( hit )      // hit in dcache
     2874        if ( cache_state == CACHE_SLOT_STATE_VALID )   // hit in dcache
    28742875        {
    28752876            if ( not (entry & PTE_V_MASK) )     // unmapped
     
    29602961#endif
    29612962            }
     2963        }
     2964        else if ( cache_state == CACHE_SLOT_STATE_ZOMBI ) // pending cleanup
     2965        {
     2966            // stalled until cleanup is acknowledged
     2967            r_dcache_fsm   = DCACHE_TLB_PTE1_GET;
    29622968        }
    29632969        else            // we must load the missing cache line in dcache
     
    31363142        size_t          set;
    31373143        size_t          word;
    3138 
    3139         bool     hit = r_dcache.read( r_dcache_tlb_paddr.read(),
    3140                                       &pte_flags,
    3141                                       &pte_ppn,
    3142                                       &way,
    3143                                       &set,
    3144                                       &word );
     3144        int         cache_state;
     3145
     3146        r_dcache.read( r_dcache_tlb_paddr.read(),
     3147                       &pte_flags,
     3148                       &pte_ppn,
     3149                       &way,
     3150                       &set,
     3151                       &word,
     3152                       &cache_state );
    31453153#ifdef INSTRUMENTATION
    31463154m_cpt_dcache_data_read++;
    31473155m_cpt_dcache_dir_read++;
    31483156#endif
    3149         if ( hit )      // request hits in dcache
     3157        if ( cache_state == CACHE_SLOT_STATE_VALID )   // hit in dcache
    31503158        {
    31513159            if ( not (pte_flags & PTE_V_MASK) ) // unmapped
     
    31623170                    r_mmu_detr             = MMU_READ_PT2_UNMAPPED;
    31633171                    r_mmu_dbvar            = r_dcache_tlb_vaddr.read();
    3164                     m_drsp.valid             = true;
    3165                     m_drsp.error             = true;
     3172                    m_drsp.valid           = true;
     3173                    m_drsp.error           = true;
    31663174                }
    3167                 r_dcache_fsm          = DCACHE_IDLE;
     3175                r_dcache_fsm               = DCACHE_IDLE;
    31683176
    31693177#if DEBUG_DCACHE
     
    31963204#endif
    31973205             }
     3206        }
     3207        else if ( cache_state == CACHE_SLOT_STATE_ZOMBI ) // pending cleanup
     3208        {
     3209            // stalled until cleanup is acknowledged
     3210            r_dcache_fsm   = DCACHE_TLB_PTE2_GET;
    31983211        }
    31993212        else            // we must load the missing cache line in dcache
  • branches/v5/modules/vci_mem_cache_dspin_coherence/caba/source/src/vci_mem_cache_dspin_coherence.cpp

    r336 r338  
    13361336        }
    13371337#endif
    1338 /*
    1339           if(m_monitor_ok)
    1340           {
    1341             char buf[80];
    1342             snprintf(buf, 80, "READ_IDLE srcid %d, ins %d", m_cmd_read_srcid_fifo.read(), m_cmd_read_pktid_fifo.read()&0x2);
    1343             check_monitor_read(buf, m_cmd_read_addr_fifo.read());
    1344           }
    1345 */
    13461338        r_read_fsm = READ_DIR_REQ;
    13471339      }
     
    14611453        // TYPE_READ_INS_UNC   0bX010 with TSAR encoding
    14621454        // TYPE_READ_INS_MISS  0bX011 with TSAR encoding
    1463         bool inst_read    = (m_cmd_read_pktid_fifo.read() & 0x2);
     1455        bool inst_read    = ((m_cmd_read_pktid_fifo.read() & 0x2) != 0);
    14641456        // check if this is a cached read, this means pktid is either
    14651457        // TYPE_READ_DATA_MISS 0bX001 with TSAR encoding
     
    15181510          std::cout
    15191511              << "  <MEMC " << name() << ".READ_DIR_HIT> Update directory entry:"
    1520               << " set = " << std::dec << set
     1512              << " addr = " << std::hex << m_cmd_read_addr_fifo.read()
     1513              << " / set = " << std::dec << set
    15211514              << " / way = " << way
    15221515              << " / owner_id = " << entry.owner.srcid
     
    15261519        }
    15271520#endif
     1521/**/
     1522          if(m_monitor_ok)
     1523          {
     1524            char buf[80];
     1525            snprintf(buf, 80, "READ_DIR_HIT srcid %d, ins %d", m_cmd_read_srcid_fifo.read(), ((m_cmd_read_pktid_fifo.read()&0x2)!=0));
     1526            check_monitor_read(buf, m_cmd_read_addr_fifo.read());
     1527          }
     1528/**/
    15281529
    15291530        m_cache_directory.write(set, way, entry);
     
    15371538      // Get the lock to the HEAP directory
    15381539    {
     1540/**/
     1541          if(m_monitor_ok)
     1542          {
     1543            char buf[80];
     1544            snprintf(buf, 80, "READ_HEAP_REQ srcid %d, ins %d", m_cmd_read_srcid_fifo.read(), ((m_cmd_read_pktid_fifo.read()&0x2)!=0));
     1545            check_monitor_read(buf, m_cmd_read_addr_fifo.read());
     1546          }
     1547/**/
    15391548      if(r_alloc_heap_fsm.read() == ALLOC_HEAP_READ)
    15401549      {
     
    16681677        heap_entry.owner.cache_id = m_cmd_read_pktid_fifo.read();
    16691678#endif
    1670         heap_entry.owner.inst     = (m_cmd_read_pktid_fifo.read() & 0x2);
     1679        heap_entry.owner.inst     = ((m_cmd_read_pktid_fifo.read() & 0x2) != 0);
    16711680
    16721681        if(r_read_count.read() == 1)  // creation of a new linked list
     
    34793488                  << " way = " << std::dec << way
    34803489                  << " / set = " << set
     3490                  << " / owner_id = " << entry.owner.srcid
     3491                  << " / owner_ins = " << entry.owner.inst
    34813492                  << " / count = " << entry.count
    34823493                  << " / is_cnt = " << entry.is_cnt << std::endl;
     
    41164127            << " hit but copy not found"
    41174128            << std::endl;
    4118 
     4129/**/
     4130        std::cout
     4131          << "r_cleanup_srcid = " << r_cleanup_srcid.read()
     4132          << " / r_cleanup_inst = " << r_cleanup_inst.read() << std::endl
     4133          << "r_cleanup_copy = " << r_cleanup_copy.read()
     4134          << " / r_cleanup_copy_inst = " << r_cleanup_copy_inst.read() << std::endl
     4135          << "heap_entry.owner.srcid = " << heap_entry.owner.srcid
     4136          << " / heap_entry.owner.inst = " << heap_entry.owner.inst << std::endl;
     4137/**/
    41194138        exit(0);
    41204139      }
     
    41274146            << " two copies matching the cleanup owner id"
    41284147            << std::endl;
     4148/**/
     4149        std::cout
     4150          << "r_cleanup_srcid = " << r_cleanup_srcid.read()
     4151          << " / r_cleanup_inst = " << r_cleanup_inst.read() << std::endl
     4152          << "r_cleanup_copy = " << r_cleanup_copy.read()
     4153          << " / r_cleanup_copy_inst = " << r_cleanup_copy_inst.read() << std::endl
     4154          << "heap_entry.owner.srcid = " << heap_entry.owner.srcid
     4155          << " / heap_entry.owner.inst = " << heap_entry.owner.inst << std::endl;
     4156/**/
    41294157
    41304158        exit(0);
Note: See TracChangeset for help on using the changeset viewer.