- Timestamp:
- Feb 27, 2014, 12:32:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r615 r645 441 441 //r_dcache_in_tlb = new bool[dcache_ways*dcache_sets]; 442 442 //r_dcache_contains_ptd = new bool[dcache_ways*dcache_sets]; 443 r_dcache_content_state = new int [dcache_ways*dcache_sets]; 444 r_dcache_dirty_word = new int [dcache_ways*dcache_sets*dcache_words]; 443 r_dcache_content_state = new int [dcache_ways*dcache_sets]; 444 r_dcache_dirty_word = new int [dcache_ways*dcache_sets*dcache_words]; 445 r_dcache_zombi_ncc = new bool [dcache_ways*dcache_sets]; 445 446 /////////////////////////////////////////////////////////// 446 447 … … 474 475 delete [] r_dcache_content_state; 475 476 delete [] r_dcache_dirty_word; 477 delete [] r_dcache_zombi_ncc; 476 478 ///////////////////////////////// 479 print_stats(); 477 480 } 478 481 … … 642 645 << "- DUNC TRANSACTION = " << m_cpt_dunc_transaction << std::endl 643 646 << "- LL TRANSACTION = " << m_cpt_ll_transaction << std::endl 647 << "- WRITE DATA MISS = " << m_cpt_data_write_miss << std::endl 648 << "- WRITE DATA ON ZOMBI = " << m_cpt_data_write_on_zombi << std::endl 649 << "- WRITE DATA ON ZOMBI NCC = " << m_cpt_data_write_on_zombi_ncc << std::endl 644 650 << "- CLEANUP DATA NOT DIRTY = " << m_cpt_cleanup_data_not_dirty << std::endl 645 651 << "- CLEANUP DATA DIRTY WORD = " << m_cpt_cleanup_data_dirty_word << std::endl; … … 743 749 m_cpt_cleanup_data_not_dirty = 0; 744 750 m_cpt_cleanup_data_dirty_word = 0; 751 m_cpt_data_write_miss = 0; 752 m_cpt_data_write_on_zombi = 0; 753 m_cpt_data_write_on_zombi_ncc = 0; 745 754 746 755 } … … 778 787 //r_dcache_contains_ptd[i] = false; 779 788 r_dcache_content_state[i] = LINE_CACHE_DATA_NOT_DIRTY; 780 r_dcache_dirty_word[i] = 0; 789 r_dcache_dirty_word[i] = 0; 790 r_dcache_zombi_ncc[i] = false; 781 791 } 782 792 … … 943 953 m_cpt_cleanup_data_not_dirty = 0; 944 954 m_cpt_cleanup_data_dirty_word = 0; 955 m_cpt_data_write_miss = 0; 956 m_cpt_data_write_on_zombi = 0; 957 m_cpt_data_write_on_zombi_ncc = 0; 945 958 946 959 m_cpt_itlbmiss_transaction = 0; … … 2293 2306 2294 2307 2295 // physical address computation : systematic DTLB access if activated)2308 // physical address computation : systematic DTLB access (if activated) 2296 2309 if ( m_dreq.valid ) 2297 2310 { 2298 2299 2311 2300 2312 if ( r_mmu_mode.read() & DATA_TLB_MASK ) // DTLB activated … … 2930 2942 // response to processor 2931 2943 m_drsp.valid = true; 2944 2945 2932 2946 // activating P1 stage 2933 if( (cache_state != CACHE_SLOT_STATE_ZOMBI )&&(cache_state != CACHE_SLOT_STATE_EMPTY )&&(cacheable) )2947 if( (cache_state != CACHE_SLOT_STATE_ZOMBI) && (cache_state != CACHE_SLOT_STATE_EMPTY) && (cacheable) ) 2934 2948 { 2935 2949 wbuf_request = (cache_state == CACHE_SLOT_STATE_VALID_CC); //write to L2 only if CC 2936 2950 updt_request = true; 2937 if ( cache_state == CACHE_SLOT_STATE_VALID_NCC)2951 if ( cache_state == CACHE_SLOT_STATE_VALID_NCC ) 2938 2952 { 2939 if ( r_dcache_content_state[cache_way*m_dcache_sets+cache_set] == LINE_CACHE_DATA_NOT_DIRTY)2953 if ( r_dcache_content_state[cache_way*m_dcache_sets+cache_set] == LINE_CACHE_DATA_NOT_DIRTY ) 2940 2954 { 2941 2955 r_dcache_content_state[cache_way*m_dcache_sets+cache_set] = LINE_CACHE_DATA_DIRTY; 2942 2956 } 2943 r_dcache_dirty_word[(cache_way*m_dcache_sets +cache_set)*m_dcache_words+cache_word] = 1;//dirty bit with word granularity (only for stats) 2957 //dirty bit with word granularity (only for stats) 2958 r_dcache_dirty_word[(cache_way*m_dcache_sets +cache_set)*m_dcache_words+cache_word] = 1; 2944 2959 m_cpt_data_write_back ++; 2945 2960 } 2946 2961 } 2962 // We stall proc if a write request is on line ZOMBI 2963 // Invalidation from memcache on a non-coherent 2964 // line can cause cleanup_data. While sending this 2965 // cleanup the processor can do a write on the same 2966 // line. However there is no guarantee that the 2967 // memcache will receive transactions in the 2968 // correct order, ie it can handle writing before 2969 // cleanup and therefore overwrite the new value of 2970 // writing that is more current than the data 2971 // contained in the cleanup . 2972 // TODO : MAYBE NEED TO OPTIMIZE 2973 else if ( cache_state == CACHE_SLOT_STATE_ZOMBI ) 2974 { 2975 m_drsp.valid = false; 2976 r_dcache_fsm = DCACHE_IDLE; 2977 // STAT : WRITE ON ZOMBI NCC LINE 2978 if (r_dcache_zombi_ncc[cache_way*m_dcache_sets+cache_set] == true) 2979 { 2980 m_cpt_data_write_on_zombi_ncc++; 2981 } 2982 2983 m_cpt_data_write_on_zombi++; 2984 } 2947 2985 else 2948 2986 { 2987 if ( cacheable ) m_cpt_data_write_miss++; 2988 2949 2989 wbuf_request = true; 2950 2990 updt_request = false; … … 4086 4126 m_cpt_dcache_dir_write++; 4087 4127 #endif 4128 4129 4130 4088 4131 r_dcache.write_dir( way, 4089 4132 set, … … 4818 4861 4819 4862 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_NOT_DIRTY; 4863 4820 4864 } 4821 4865 else … … 4830 4874 r_dcache_dirty_word[(way*m_dcache_sets +set)*m_dcache_words+word] = 0; 4831 4875 } 4876 4877 // STAT : WRITE ON ZOMBI NCC LINE 4878 r_dcache_zombi_ncc[r_dcache_miss_way.read()*m_dcache_sets+r_dcache_miss_set.read()] = true; 4832 4879 } 4833 4880 … … 5187 5234 r_dcache_clack_set.read(), 5188 5235 CACHE_SLOT_STATE_EMPTY); 5236 5237 // STAT : WRITE ON ZOMBI NCC LINE 5238 r_dcache_zombi_ncc[r_dcache_clack_way.read()*m_dcache_sets+r_dcache_clack_set.read()] = false; 5189 5239 5190 5240 if ( (r_dcache_miss_set.read() == r_dcache_clack_set.read()) and
Note: See TracChangeset
for help on using the changeset viewer.