Changeset 141 for trunk/modules


Ignore:
Timestamp:
Mar 16, 2011, 2:23:15 PM (13 years ago)
Author:
guthmull
Message:

Improve activity counters. Table sizes are now instance parameters.

Location:
trunk/modules/vci_mem_cache_v4/caba/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_mem_cache_v4/caba/source/include/vci_mem_cache_v4.h

    r140 r141  
    287287      uint32_t     m_cpt_write_dirty;       // Cumulated length for WRITE transactions
    288288      uint32_t     m_cpt_update;            // Number of UPDATE transactions
     289      uint32_t     m_cpt_trt_rb;            // Read blocked by a hit in trt
     290      uint32_t     m_cpt_trt_full;          // Transaction blocked due to a full trt
    289291      uint32_t     m_cpt_update_mult;       // Number of targets for UPDATE
    290292      uint32_t     m_cpt_inval;             // Number of INVAL  transactions
     
    319321          size_t nsets,                                     // Number of sets
    320322          size_t nwords,                                    // Number of words per line
    321           size_t heap_size=1024);                           // Size of the heap
     323          size_t heap_size=1024,                            // Size of the heap
     324          size_t transaction_tab_lines=TRANSACTION_TAB_LINES,// Size of the TRT
     325          size_t update_tab_lines=UPDATE_TAB_LINES          // Size of the UPT
     326          );
    322327
    323328      ~VciMemCacheV4();
     
    343348      std::list<soclib::common::Segment>  m_seglist;            // memory cached into the cache
    344349      std::list<soclib::common::Segment>  m_cseglist;           // coherence segment for the cache
    345       vci_addr_t                        *m_coherence_table;     // address(srcid)
    346       TransactionTab                    m_transaction_tab;      // xram transaction table
     350      vci_addr_t                             *m_coherence_table;        // address(srcid)
     351      TransactionTab                        m_transaction_tab;  // xram transaction table
     352      uint32_t                    m_transaction_tab_lines;
    347353      UpdateTab                         m_update_tab;           // pending update & invalidate
    348       CacheDirectory                    m_cache_directory;      // data cache directory
     354      uint32_t                    m_update_tab_lines;
     355      CacheDirectory                            m_cache_directory;      // data cache directory
    349356      HeapDirectory                     m_heap_directory;       // heap directory
    350357
     
    713720
    714721// Local Variables:
    715 // tab-width: 4
    716 // c-basic-offset: 4
     722// tab-width: 2
     723// c-basic-offset: 2
    717724// c-file-offsets:((innamespace . 0)(inline-open . 0))
    718725// indent-tabs-mode: nil
  • trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp

    r140 r141  
    244244      size_t nsets,
    245245      size_t nwords,
    246       size_t heap_size)
     246      size_t heap_size,
     247      size_t transaction_tab_lines,
     248      size_t update_tab_lines)
    247249
    248250    : soclib::caba::BaseModule(name),
     
    265267    m_cseglist(mtc.getSegmentList(vci_tgt_index_cleanup)),
    266268    m_coherence_table( mtc.getCoherenceTable<vci_addr_t>() ),
    267     m_transaction_tab( TRANSACTION_TAB_LINES, nwords ),
    268     m_update_tab( UPDATE_TAB_LINES ),
     269    m_transaction_tab_lines(transaction_tab_lines),
     270    m_transaction_tab( transaction_tab_lines, nwords ),
     271    m_update_tab_lines( update_tab_lines),
     272    m_update_tab( update_tab_lines ),
    269273    m_cache_directory( nways, nsets, nwords, vci_param::N ),
    270274    m_heap_directory( m_heap_size ),
     
    338342      assert(nwords);
    339343      assert(nways);
    340       assert(nsets <= 1024);
    341       assert(nwords <= 32);
    342       assert(nways <= 32);
    343344
    344345      // Set the broadcast address with Xmin,Xmax,Ymin,Ymax set to maximum
     
    383384
    384385      // Allocation for IXR_RSP FSM
    385       r_ixr_rsp_to_xram_rsp_rok     = new sc_signal<bool>[TRANSACTION_TAB_LINES];
     386      r_ixr_rsp_to_xram_rsp_rok     = new sc_signal<bool>[m_transaction_tab_lines];
    386387
    387388      // Allocation for XRAM_RSP FSM
     
    441442    std::cout << "----------------------------------" << std::dec << std::endl;
    442443    std::cout << "MEM_CACHE " << m_srcid_ini << " / Time = " << m_cpt_cycles << std::endl
    443       << "- READ RATE            = " << (double)m_cpt_read/m_cpt_cycles << std::endl
    444       << "- READ MISS RATE       = " << (double)m_cpt_read_miss/m_cpt_read << std::endl
    445       << "- WRITE RATE           = " << (double)m_cpt_write/m_cpt_cycles << std::endl
    446       << "- WRITE MISS RATE      = " << (double)m_cpt_write_miss/m_cpt_write << std::endl
    447       << "- WRITE BURST LENGTH   = " << (double)m_cpt_write_cells/m_cpt_write << std::endl
    448       << "- UPDATE RATE          = " << (double)m_cpt_update/m_cpt_cycles << std::endl
    449       << "- UPDATE ARITY         = " << (double)m_cpt_update_mult/m_cpt_update << std::endl
    450       << "- INVAL MULTICAST RATE = " << (double)(m_cpt_inval-m_cpt_inval_brdcast)/m_cpt_cycles << std::endl
    451       << "- INVAL MULTICAST ARITY= " << (double)m_cpt_inval_mult/(m_cpt_inval-m_cpt_inval_brdcast) << std::endl
    452       << "- INVAL BROADCAST RATE = " << (double)m_cpt_inval_brdcast/m_cpt_cycles << std::endl
    453       << "- SAVE DIRTY RATE      = " << (double)m_cpt_write_dirty/m_cpt_cycles << std::endl
    454       << "- CLEANUP RATE         = " << (double)m_cpt_cleanup/m_cpt_cycles << std::endl
    455       << "- LL RATE              = " << (double)m_cpt_ll/m_cpt_cycles << std::endl
    456       << "- SC RATE              = " << (double)m_cpt_sc/m_cpt_cycles << std::endl;
     444              << "- READ RATE            = " << (double)m_cpt_read/m_cpt_cycles << std::endl
     445              << "- READ TOTAL           = " << m_cpt_read << std::endl
     446              << "- READ MISS RATE       = " << (double)m_cpt_read_miss/m_cpt_read << std::endl
     447              << "- WRITE RATE           = " << (double)m_cpt_write/m_cpt_cycles << std::endl
     448              << "- WRITE TOTAL          = " << m_cpt_write << std::endl
     449              << "- WRITE MISS RATE      = " << (double)m_cpt_write_miss/m_cpt_write << std::endl
     450              << "- WRITE BURST LENGTH   = " << (double)m_cpt_write_cells/m_cpt_write << std::endl
     451              << "- WRITE BURST TOTAL    = " << m_cpt_write_cells << std::endl
     452              << "- REQUESTS TRT FULL    = " << m_cpt_trt_full << std::endl
     453              << "- READ TRT BLOKED HIT  = " << m_cpt_trt_rb << std::endl
     454              << "- UPDATE RATE          = " << (double)m_cpt_update/m_cpt_cycles << std::endl
     455              << "- UPDATE ARITY         = " << (double)m_cpt_update_mult/m_cpt_update << std::endl
     456              << "- INVAL MULTICAST RATE = " << (double)(m_cpt_inval-m_cpt_inval_brdcast)/m_cpt_cycles << std::endl
     457              << "- INVAL MULTICAST ARITY= " << (double)m_cpt_inval_mult/(m_cpt_inval-m_cpt_inval_brdcast) << std::endl
     458              << "- INVAL BROADCAST RATE = " << (double)m_cpt_inval_brdcast/m_cpt_cycles << std::endl
     459              << "- SAVE DIRTY RATE      = " << (double)m_cpt_write_dirty/m_cpt_cycles << std::endl
     460              << "- CLEANUP RATE         = " << (double)m_cpt_cleanup/m_cpt_cycles << std::endl
     461              << "- LL RATE              = " << (double)m_cpt_ll/m_cpt_cycles << std::endl
     462              << "- SC RATE              = " << (double)m_cpt_sc/m_cpt_cycles << std::endl;
    457463  }
    458464
     
    567573#endif
    568574
    569       for(size_t i=0; i<TRANSACTION_TAB_LINES ; i++){
     575      for(size_t i=0; i<m_transaction_tab_lines ; i++){
    570576        r_ixr_rsp_to_xram_rsp_rok[i] = false;
    571577      }
     
    602608      m_cpt_ll                      = 0;
    603609      m_cpt_sc                      = 0;
     610      m_cpt_trt_full      = 0;
     611      m_cpt_trt_rb        = 0;
    604612
    605613      return;
     
    721729          if ( p_vci_tgt.cmdval && m_cmd_read_addr_fifo.wok() ) {
    722730            cmd_read_fifo_put = true;
    723             if ( p_vci_tgt.eop )  r_tgt_cmd_fsm = TGT_CMD_IDLE;
    724             else                  r_tgt_cmd_fsm = TGT_CMD_READ_EOP;             
     731            if ( p_vci_tgt.eop ) {
     732                    m_cpt_read++;
     733                    r_tgt_cmd_fsm = TGT_CMD_IDLE;
     734            } else  r_tgt_cmd_fsm = TGT_CMD_READ_EOP;           
    725735          }
    726736          break;
     
    730740        {
    731741          if ( p_vci_tgt.cmdval && p_vci_tgt.eop ){
     742            m_cpt_read++;
    732743            r_tgt_cmd_fsm = TGT_CMD_IDLE;
    733744          }
     
    881892            PRINTF("  * <MEM_CACHE.READ> Request from %d.%d at address %llx\n",(uint32_t)m_cmd_read_srcid_fifo.read(),(uint32_t)m_cmd_read_pktid_fifo.read(),(uint64_t)m_cmd_read_addr_fifo.read());
    882893
    883             m_cpt_read++;
    884894            r_read_fsm = READ_DIR_LOCK;
    885895          }
     
    922932            } else {
    923933              r_read_fsm = READ_TRT_LOCK;
    924               m_cpt_read_miss++;
    925934            }
    926935          }
     
    11621171            bool   wok = !m_transaction_tab.full(index);
    11631172            if( hit_read || !wok || hit_write ) {  // missing line already requested or no space
     1173              if(!wok)
     1174                m_cpt_trt_full++;
     1175              if(hit_read || hit_write)
     1176                m_cpt_trt_rb++;
    11641177              r_read_fsm = READ_IDLE;
    11651178            } else {                       // missing line is requested to the XRAM
     1179              m_cpt_read_miss++;
    11661180              r_read_trt_index = index;
    11671181              r_read_fsm       = READ_TRT_SET;
     
    13241338            } else {
    13251339              r_write_fsm = WRITE_TRT_LOCK;
    1326               m_cpt_write_miss++;
    13271340            }
    13281341          }
     
    15941607              r_write_trt_index = hit_index;
    15951608              r_write_fsm       = WRITE_TRT_DATA;
     1609              m_cpt_write_miss++;
    15961610            } else if ( wok && !hit_write ) {   // set a new entry in TRT
    15971611              r_write_trt_index = wok_index;
    15981612              r_write_fsm       = WRITE_TRT_SET;
     1613              m_cpt_write_miss++;
    15991614            } else {            // wait an empty entry in TRT
    16001615              r_write_fsm       = WRITE_WAIT;
     1616              m_cpt_trt_full++;
    16011617            }
    16021618          }
     
    20402056        {
    20412057          size_t ptr   = r_xram_rsp_trt_index.read();
    2042           size_t lines = TRANSACTION_TAB_LINES;
     2058          size_t lines = m_transaction_tab_lines;
    20432059          for(size_t i=0; i<lines; i++){
    20442060            size_t index=(i+ptr+1)%lines;
     
    48594875
    48604876// Local Variables:
    4861 // tab-width: 4
    4862 // c-basic-offset: 4
     4877// tab-width: 2
     4878// c-basic-offset: 2
    48634879// c-file-offsets:((innamespace . 0)(inline-open . 0))
    48644880// indent-tabs-mode: nil
Note: See TracChangeset for help on using the changeset viewer.