Changeset 644 for branches/RWT/modules/vci_mem_cache/caba
- Timestamp:
- Feb 27, 2014, 12:09:51 PM (11 years ago)
- Location:
- branches/RWT/modules/vci_mem_cache/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r611 r644 427 427 428 428 // Counters accessible in software (not yet but eventually) 429 uint32_t m_cpt_reset_count; // Last cycle at which counters have been reset 429 430 uint32_t m_cpt_read_local; // Number of local READ transactions 430 uint32_t m_cpt_read_remote; // number of remote READ transactions431 uint32_t m_cpt_read_cost; // Number of (flits * distance) for READs431 uint32_t m_cpt_read_remote; // number of remote READ transactions 432 uint32_t m_cpt_read_cost; // Number of (flits * distance) for READs 432 433 433 434 uint32_t m_cpt_write_local; // Number of local WRITE transactions 434 uint32_t m_cpt_write_remote; // number of remote WRITE transactions435 uint32_t m_cpt_write_remote; // number of remote WRITE transactions 435 436 uint32_t m_cpt_write_flits_local; // number of flits for local WRITEs 436 437 uint32_t m_cpt_write_flits_remote; // number of flits for remote WRITEs 437 uint32_t m_cpt_write_cost; // Number of (flits * distance) for WRITEs438 uint32_t m_cpt_write_cost; // Number of (flits * distance) for WRITEs 438 439 439 440 uint32_t m_cpt_ll_local; // Number of local LL transactions … … 633 634 ~VciMemCache(); 634 635 636 void reset_counters(); 635 637 void print_stats(bool activity_counters, bool stats); 636 638 void print_trace( size_t detailled = 0 ); -
branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r612 r644 371 371 p_clk( "p_clk" ), 372 372 p_resetn( "p_resetn" ), 373 p_irq( "p_irq" ), 373 374 p_vci_tgt( "p_vci_tgt" ), 374 375 p_vci_ixr( "p_vci_ixr" ), … … 819 820 } 820 821 822 823 ///////////////////////////////////////// 824 tmpl(void)::reset_counters() 825 ///////////////////////////////////////// 826 { 827 m_cpt_reset_count = m_cpt_cycles; 828 m_cpt_read_local = 0; 829 m_cpt_read_remote = 0; 830 m_cpt_read_cost = 0; 831 m_cpt_write_local = 0; 832 m_cpt_write_remote = 0; 833 m_cpt_write_flits_local = 0; 834 m_cpt_write_flits_remote = 0; 835 m_cpt_write_cost = 0; 836 m_cpt_ll_local = 0; 837 m_cpt_ll_remote = 0; 838 m_cpt_ll_cost = 0; 839 m_cpt_sc_local = 0; 840 m_cpt_sc_remote = 0; 841 m_cpt_sc_cost = 0; 842 m_cpt_cas_local = 0; 843 m_cpt_cas_remote = 0; 844 m_cpt_cas_cost = 0; 845 m_cpt_update = 0; 846 m_cpt_update_local = 0; 847 m_cpt_update_remote = 0; 848 m_cpt_update_cost = 0; 849 m_cpt_minval = 0; 850 m_cpt_minval_local = 0; 851 m_cpt_minval_remote = 0; 852 m_cpt_minval_cost = 0; 853 m_cpt_binval = 0; 854 m_cpt_cleanup_local = 0; 855 m_cpt_cleanup_remote = 0; 856 m_cpt_cleanup_cost = 0; 857 m_cpt_read_miss = 0; 858 m_cpt_write_miss = 0; 859 m_cpt_write_dirty = 0; 860 m_cpt_trt_rb = 0; 861 m_cpt_trt_full = 0; 862 m_cpt_get = 0; 863 m_cpt_put = 0; 864 m_cpt_ncc_to_cc_read = 0; 865 m_cpt_ncc_to_cc_write = 0; 866 m_cpt_ncc_to_cc = 0; 867 } 868 821 869 822 870 ///////////////////////////////////////// … … 831 879 std::cout << "----------------------------------" << std::dec << std::endl; 832 880 std::cout 881 << "[000] COUNTERS RESET AT CYCLE = " << m_cpt_reset_count << std::endl 833 882 << "[001] NUMBER OF CYCLES = " << m_cpt_cycles << std::endl 834 883 << std::endl … … 1117 1166 1118 1167 // Activity counters 1119 m_cpt_cycles = 0; 1168 m_cpt_reset_count = 0; 1169 m_cpt_cycles = 0; 1120 1170 m_cpt_read_local = 0; 1121 1171 m_cpt_read_remote = 0; … … 1151 1201 m_cpt_write_miss = 0; 1152 1202 m_cpt_write_dirty = 0; 1153 m_cpt_write_broadcast = 0;1154 m_cpt_trt_rb = 0;1203 m_cpt_write_broadcast = 0; 1204 m_cpt_trt_rb = 0; 1155 1205 m_cpt_trt_full = 0; 1156 m_cpt_get = 0;1157 m_cpt_put = 0;1206 m_cpt_get = 0; 1207 m_cpt_put = 0; 1158 1208 m_cpt_dir_unused = 0; 1159 1209 m_cpt_upt_unused = 0; … … 3456 3506 3457 3507 assert ((r_write_count.read() == 1) and "NCC to CC req without copy"); 3458 if(!match_inval and !r_write_to_cc_send_req.read()) 3459 { 3460 r_write_to_cc_send_req = true; 3461 r_write_to_cc_send_dest = r_write_copy; 3508 3509 if( not match_inval and 3510 not r_write_to_cc_send_req.read() and 3511 not r_write_to_cc_send_multi_req.read() and 3512 not r_write_to_cc_send_brdcast_req.read() ) 3513 { 3514 r_write_to_cc_send_req = true; 3515 r_write_to_cc_send_dest = r_write_copy; 3462 3516 r_write_to_cc_send_nline = nline; 3463 r_write_to_cleanup_req = true;3517 r_write_to_cleanup_req = true; 3464 3518 r_write_to_cleanup_nline = nline; 3465 3519 … … 3480 3534 { 3481 3535 std::cout << " <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> get access to the UPT: " 3482 << " Inval requested = " << ( !match_inval and !r_write_to_cc_send_req.read())3536 << " Inval requested = " << (not match_inval and not r_write_to_cc_send_req.read()) 3483 3537 << std::endl; 3484 3538 } 3485 3539 #endif 3540 break; 3486 3541 } 3487 3542 #if DEBUG_MEMC_WRITE 3488 3543 if(m_debug) 3489 3544 { 3490 std::cout << " <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> failed to access to the UPT: "3545 std::cout << " <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> failed to access to the IVT: " 3491 3546 << std::endl; 3492 3547 } … … 3560 3615 // coherence update required 3561 3616 { 3562 if(!r_write_to_cc_send_multi_req.read() and 3563 !r_write_to_cc_send_brdcast_req.read()) 3617 if( not r_write_to_cc_send_multi_req.read() and 3618 not r_write_to_cc_send_brdcast_req.read() and 3619 not r_write_to_cc_send_req.read() ) 3564 3620 { 3565 3621 r_write_fsm = WRITE_UPT_LOCK; … … 3685 3741 // send the request if only one copy 3686 3742 { 3687 assert( not r_write_to_cc_send_multi_req.read() and3743 assert( not r_write_to_cc_send_multi_req.read() and 3688 3744 not r_write_to_cc_send_brdcast_req.read() and 3745 not r_write_to_cc_send_req.read() and 3689 3746 "Error in VCI_MEM_CACHE : pending multicast or broadcast\n" 3690 3747 "transaction in WRITE_UPT_REQ state" … … 4286 4343 case WRITE_BC_CC_SEND: // Post a coherence broadcast request to CC_SEND FSM 4287 4344 { 4288 if(!r_write_to_cc_send_multi_req.read() and !r_write_to_cc_send_brdcast_req.read()) 4345 if( not r_write_to_cc_send_multi_req.read() and 4346 not r_write_to_cc_send_brdcast_req.read() and 4347 not r_write_to_cc_send_req.read() ) 4289 4348 { 4290 4349 r_write_to_cc_send_multi_req = false; … … 7234 7293 } 7235 7294 7295 // READ 7236 7296 if(r_read_to_cc_send_req.read()) 7237 7297 { … … 7240 7300 } 7241 7301 7302 // WRITE 7242 7303 if(r_write_to_cc_send_req.read()) 7243 7304 { … … 7246 7307 } 7247 7308 7248 7249 // WRITE7250 if(r_read_to_cc_send_req.read())7251 {7252 r_cc_send_fsm = CC_SEND_READ_NCC_INVAL_HEADER;7253 break;7254 }7255 7256 if(r_write_to_cc_send_req.read())7257 {7258 r_cc_send_fsm = CC_SEND_WRITE_NCC_INVAL_HEADER;7259 break;7260 }7261 7309 if(m_write_to_cc_send_inst_fifo.rok() or 7262 7310 r_write_to_cc_send_multi_req.read())
Note: See TracChangeset
for help on using the changeset viewer.