Changeset 130 for trunk/modules/vci_cc_vcache_wrapper2_v1/caba
- Timestamp:
- Jan 20, 2011, 4:27:47 PM (14 years ago)
- Location:
- trunk/modules/vci_cc_vcache_wrapper2_v1/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_cc_vcache_wrapper2_v1/caba/source/include/vci_cc_vcache_wrapper2_v1.h
r120 r130 565 565 void print_cpi(); 566 566 void print_stats(); 567 void clear_stats(); 568 void print_trace(size_t mode = 0); 567 569 568 570 private: -
trunk/modules/vci_cc_vcache_wrapper2_v1/caba/source/src/vci_cc_vcache_wrapper2_v1.cpp
r120 r130 35 35 //#define EVALUATION_CACHE 36 36 37 #ifdef SOCLIB_MODULE_DEBUG37 //#ifdef SOCLIB_MODULE_DEBUG 38 38 namespace { 39 39 const char *icache_fsm_state_str[] = { … … 169 169 }; 170 170 } 171 #endif171 //#endif 172 172 173 173 #define tmpl(...) template<typename vci_param, typename iss_t> __VA_ARGS__ VciCcVCacheWrapper2V1<vci_param, iss_t> … … 368 368 std::cout << name() << " CPI = " 369 369 << (float)m_cpt_total_cycles/(m_cpt_total_cycles - m_cpt_frz_cycles) << std::endl ; 370 } 371 372 //////////////////////////////////// 373 tmpl(void)::print_trace(size_t mode) 374 //////////////////////////////////// 375 { 376 typename iss_t::InstructionRequest ireq; 377 typename iss_t::DataRequest dreq; 378 379 m_iss.getRequests( ireq, dreq ); 380 381 std::cout << std::dec << "L1_(" << name() << ") cycle: " << m_cpt_total_cycles << std::endl; 382 std::cout << " Proc state: PC = " << std::hex << ireq.addr << " / AD = " << dreq.addr 383 << std::dec << " / V = " << dreq.valid << " / TYPE = " << dreq.type << std::endl; 384 385 std::cout << " Cache state:" 386 << " tgt fsm: " << tgt_fsm_state_str[r_vci_tgt_fsm] 387 << " dcache fsm: " << dcache_fsm_state_str[r_dcache_fsm] 388 << " icache fsm: " << icache_fsm_state_str[r_icache_fsm] 389 << " cmd fsm: " << cmd_fsm_state_str[r_vci_cmd_fsm] 390 << " rsp fsm: " << rsp_fsm_state_str[r_vci_rsp_fsm] 391 << " cleanup fsm: " << cleanup_fsm_state_str[r_cleanup_fsm] 392 << " inval itlb fsm: " << inval_itlb_fsm_state_str[r_inval_itlb_fsm] 393 << " inval dtlb fsm: " << inval_dtlb_fsm_state_str[r_inval_dtlb_fsm] << std::endl; 394 395 if( r_vci_tgt_fsm != TGT_IDLE ) 396 std::cout << " ... coherence request address = " << std::hex << r_tgt_addr.read() << std::endl; 397 398 if(mode & 0x1) 399 { 400 r_wbuf.printTrace(); 401 } 370 402 } 371 403 … … 411 443 << "- ITLB MISS TRANSACTION = " << (float)m_cost_itlbmiss_transaction/m_cpt_itlbmiss_transaction << std::endl 412 444 << "- DTLB MISS TRANSACTION = " << (float)m_cost_dtlbmiss_transaction/m_cpt_dtlbmiss_transaction << std::endl; 445 } 446 447 //////////////////////// 448 tmpl(void)::clear_stats() 449 //////////////////////// 450 { 451 m_cpt_dcache_data_read = 0; 452 m_cpt_dcache_data_write = 0; 453 m_cpt_dcache_dir_read = 0; 454 m_cpt_dcache_dir_write = 0; 455 m_cpt_icache_data_read = 0; 456 m_cpt_icache_data_write = 0; 457 m_cpt_icache_dir_read = 0; 458 m_cpt_icache_dir_write = 0; 459 460 m_cpt_frz_cycles = 0; 461 m_cpt_dcache_frz_cycles = 0; 462 m_cpt_total_cycles = 0; 463 464 m_cpt_read = 0; 465 m_cpt_write = 0; 466 m_cpt_data_miss = 0; 467 m_cpt_ins_miss = 0; 468 m_cpt_unc_read = 0; 469 m_cpt_write_cached = 0; 470 m_cpt_ins_read = 0; 471 472 m_cost_write_frz = 0; 473 m_cost_data_miss_frz = 0; 474 m_cost_unc_read_frz = 0; 475 m_cost_ins_miss_frz = 0; 476 477 m_cpt_imiss_transaction = 0; 478 m_cpt_dmiss_transaction = 0; 479 m_cpt_unc_transaction = 0; 480 m_cpt_write_transaction = 0; 481 m_cpt_icache_unc_transaction = 0; 482 483 m_cost_imiss_transaction = 0; 484 m_cost_dmiss_transaction = 0; 485 m_cost_unc_transaction = 0; 486 m_cost_write_transaction = 0; 487 m_cost_icache_unc_transaction = 0; 488 m_length_write_transaction = 0; 489 490 m_cpt_ins_tlb_read = 0; 491 m_cpt_ins_tlb_miss = 0; 492 m_cpt_ins_tlb_update_acc = 0; 493 494 m_cpt_data_tlb_read = 0; 495 m_cpt_data_tlb_miss = 0; 496 m_cpt_data_tlb_update_acc = 0; 497 m_cpt_data_tlb_update_dirty = 0; 498 m_cpt_ins_tlb_hit_dcache = 0; 499 m_cpt_data_tlb_hit_dcache = 0; 500 m_cpt_ins_tlb_occup_cache = 0; 501 m_cpt_data_tlb_occup_cache = 0; 502 503 m_cost_ins_tlb_miss_frz = 0; 504 m_cost_data_tlb_miss_frz = 0; 505 m_cost_ins_tlb_update_acc_frz = 0; 506 m_cost_data_tlb_update_acc_frz = 0; 507 m_cost_data_tlb_update_dirty_frz = 0; 508 m_cost_ins_tlb_occup_cache_frz = 0; 509 m_cost_data_tlb_occup_cache_frz = 0; 510 511 m_cpt_itlbmiss_transaction = 0; 512 m_cpt_itlb_ll_transaction = 0; 513 m_cpt_itlb_sc_transaction = 0; 514 m_cpt_dtlbmiss_transaction = 0; 515 m_cpt_dtlb_ll_transaction = 0; 516 m_cpt_dtlb_sc_transaction = 0; 517 m_cpt_dtlb_ll_dirty_transaction = 0; 518 m_cpt_dtlb_sc_dirty_transaction = 0; 519 520 m_cost_itlbmiss_transaction = 0; 521 m_cost_itlb_ll_transaction = 0; 522 m_cost_itlb_sc_transaction = 0; 523 m_cost_dtlbmiss_transaction = 0; 524 m_cost_dtlb_ll_transaction = 0; 525 m_cost_dtlb_sc_transaction = 0; 526 m_cost_dtlb_ll_dirty_transaction = 0; 527 m_cost_dtlb_sc_dirty_transaction = 0; 528 529 m_cpt_cc_broadcast = 0; 530 m_cpt_cc_update_data = 0; 531 m_cpt_cc_inval_data = 0; 532 m_cpt_cc_inval_ins = 0; 533 m_cpt_cc_cleanup_data = 0; 534 m_cpt_cc_cleanup_ins = 0; 413 535 } 414 536 … … 1159 1281 case ICACHE_BIS: 1160 1282 { 1161 if ( ireq.valid ) m_cost_ins_miss_frz++;1283 //if ( ireq.valid ) m_cost_ins_miss_frz++; 1162 1284 1163 1285 // external cache invalidate request … … 2749 2871 r_dcache_hit_p_save = dcache_hit_p; 2750 2872 r_dcache_fsm = DCACHE_BIS; 2751 m_cost_data_tlb_miss_frz++;2873 //m_cost_data_tlb_miss_frz++; 2752 2874 } 2753 2875 else // cached or uncached access with a correct speculative physical address … … 2917 3039 case DCACHE_BIS: 2918 3040 { 2919 if ( dreq.valid ) m_cost_data_miss_frz++;3041 //if ( dreq.valid ) m_cost_data_miss_frz++; 2920 3042 2921 3043 // external cache invalidate request … … 5159 5281 case DCACHE_ITLB_CLEANUP: 5160 5282 { 5161 if ( dreq.valid ) m_cost_data_miss_frz++;5283 //if ( dreq.valid ) m_cost_data_miss_frz++; 5162 5284 5163 5285 r_dcache.setinbit(((paddr_t)r_dcache_itlb_cleanup_line.read()<<(uint32_log2(m_dcache_words)+2)), r_dcache_in_itlb, false); … … 5295 5417 5296 5418 r_vci_cmd_cpt = 0; 5419 5420 if ( (r_dcache_cleanup_req && r_dcache_itlb_read_req && (((r_icache_paddr_save.read() & ~((m_dcache_words<<2)-1)) >> (uint32_log2(m_dcache_words) + 2)) == r_dcache_cleanup_line.read())) 5421 || (r_dcache_cleanup_req && r_dcache_tlb_read_req && (((r_dcache_tlb_paddr.read() & ~((m_dcache_words<<2)-1)) >> (uint32_log2(m_dcache_words) + 2)) == r_dcache_cleanup_line.read())) 5422 || (r_dcache_cleanup_req && r_dcache_miss_req && (((r_dcache_paddr_save.read() & ~((m_dcache_words<<2)-1)) >> (uint32_log2(m_dcache_words) + 2)) == r_dcache_cleanup_line.read())) 5423 || (r_icache_cleanup_req && r_icache_miss_req && (((r_icache_paddr_save.read() & ~((m_icache_words<<2)-1)) >> (uint32_log2(m_icache_words) + 2)) == r_icache_cleanup_line.read())) ) 5424 { 5425 break; 5426 } 5427 5297 5428 if (r_dcache_itlb_read_req) 5298 5429 { … … 5403 5534 5404 5535 r_vci_rsp_cpt = 0; 5536 5537 if ( (r_dcache_cleanup_req && r_dcache_itlb_read_req && (((r_icache_paddr_save.read() & ~((m_dcache_words<<2)-1)) >> (uint32_log2(m_dcache_words) + 2)) == r_dcache_cleanup_line.read())) 5538 || (r_dcache_cleanup_req && r_dcache_tlb_read_req && (((r_dcache_tlb_paddr.read() & ~((m_dcache_words<<2)-1)) >> (uint32_log2(m_dcache_words) + 2)) == r_dcache_cleanup_line.read())) 5539 || (r_dcache_cleanup_req && r_dcache_miss_req && (((r_dcache_paddr_save.read() & ~((m_dcache_words<<2)-1)) >> (uint32_log2(m_dcache_words) + 2)) == r_dcache_cleanup_line.read())) 5540 || (r_icache_cleanup_req && r_icache_miss_req && (((r_icache_paddr_save.read() & ~((m_icache_words<<2)-1)) >> (uint32_log2(m_icache_words) + 2)) == r_icache_cleanup_line.read())) ) 5541 { 5542 break; 5543 } 5544 5405 5545 if (r_dcache_itlb_read_req) // ITLB miss response 5406 5546 { … … 6077 6217 } // end switch TGT_FSM 6078 6218 6079 #ifdef SOCLIB_MODULE_DEBUG 6219 #ifdef SOCLIB_MODULE_DEBUG 6080 6220 std::cout << name() 6081 6221 << " Moore R/W:" << std::hex
Note: See TracChangeset
for help on using the changeset viewer.