- Timestamp:
- Apr 8, 2010, 3:41:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_cc_vcache_wrapper2_v1/caba/source/src/vci_cc_vcache_wrapper2_v1.cpp
r2 r12 1067 1067 r_itlb_read_dcache_req = true; 1068 1068 r_icache_vaddr_req = ireq.addr; 1069 r_itlb_k_read_dcache = true; 1069 1070 r_icache_fsm = ICACHE_TLB2_READ; 1070 1071 m_cpt_ins_tlb_miss++; … … 1667 1668 if ( r_tgt_icache_req ) 1668 1669 { 1669 r_tgt_icache_req = false; 1670 r_icache_fsm = ICACHE_CC_INVAL; 1671 r_icache_fsm_save = r_icache_fsm; 1672 m_cost_ins_waste_wait_frz++; 1673 break; 1670 1674 } 1671 1675 … … 1727 1731 { 1728 1732 if ( ireq.valid ) m_cost_ins_waste_wait_frz++; 1733 // external cache invalidate request 1734 if ( r_tgt_icache_req ) 1735 { 1736 r_icache_fsm = ICACHE_CC_INVAL; 1737 r_icache_fsm_save = r_icache_fsm; 1738 m_cost_ins_waste_wait_frz++; 1739 break; 1740 } 1729 1741 1730 1742 paddr_t ipaddr = 0; … … 1755 1767 //////////////////////// 1756 1768 case ICACHE_CACHE_INVAL_PA: 1757 { 1769 { 1770 // external cache invalidate request 1771 if ( r_tgt_icache_req ) 1772 { 1773 r_icache_fsm = ICACHE_CC_INVAL; 1774 r_icache_fsm_save = r_icache_fsm; 1775 m_cost_ins_waste_wait_frz++; 1776 break; 1777 } 1778 1758 1779 paddr_t ipaddr = (paddr_t)r_mmu_word_hi.read() << 32 | r_mmu_word_lo.read(); 1759 1780 … … 1989 2010 else if (((r_icache_fsm_save == ICACHE_BIS)||(r_icache_fsm_save == ICACHE_MISS_WAIT) || 1990 2011 /* (r_icache_fsm_save == ICACHE_UNC_WAIT)||*/(r_icache_fsm_save == ICACHE_MISS_UPDT)) && 1991 (r_icache_tlb_nline .read() == r_dcache_itlb_inval_line.read()))2012 (r_icache_tlb_nline == r_dcache_itlb_inval_line)) 1992 2013 { 1993 2014 r_icache_inval_tlb_rsp = true; … … 2190 2211 2191 2212 bool itlb_hit_dcache = r_dcache.read(r_icache_paddr_save, &rsp_itlb_miss); 2192 if ( (r_icache_fsm == ICACHE_TLB2_READ)&& itlb_hit_dcache )2213 if ( r_itlb_k_read_dcache && itlb_hit_dcache ) 2193 2214 { 2215 r_itlb_k_read_dcache = false; 2194 2216 bool itlb_hit_ppn = r_dcache.read(r_icache_paddr_save.read()+4, &rsp_itlb_ppn); 2195 2217 assert(itlb_hit_ppn && "Address of pte[64-32] and pte[31-0] should be successive"); … … 2533 2555 else // using actual physical address for uncached access 2534 2556 { 2535 dcache_hit_c = ((tlb_dpaddr == (paddr_t)r_dcache_paddr_save) && r_dcache_buf_unc_valid ); 2536 dcache_rdata = r_dcache_miss_buf[0]; 2557 dcache_hit_c = false; 2537 2558 } 2538 2559 … … 2618 2639 if ( dcache_hit_c ) 2619 2640 { 2620 r_dcache_buf_unc_valid = false;2621 2641 r_dcache_fsm = DCACHE_IDLE; 2622 2642 drsp.valid = true; … … 3987 4007 { 3988 4008 // external cache invalidate request 3989 if ( r_tgt_dcache_req ) 3990 { 3991 r_tgt_dcache_req = false; 3992 } 3993 4009 if ( r_tgt_dcache_req ) 4010 { 4011 r_dcache_fsm = DCACHE_CC_CHECK; 4012 r_dcache_fsm_save = r_dcache_fsm; 4013 m_cost_data_waste_wait_frz++; 4014 break; 4015 } 3994 4016 size_t way = r_dcache_way; 3995 4017 size_t set = r_dcache_set; … … 4057 4079 case DCACHE_DCACHE_INVAL: 4058 4080 { 4081 // external cache invalidate request 4082 if ( r_tgt_dcache_req ) 4083 { 4084 r_dcache_fsm = DCACHE_CC_CHECK; 4085 r_dcache_fsm_save = r_dcache_fsm; 4086 m_cost_data_waste_wait_frz++; 4087 break; 4088 } 4089 4059 4090 m_cpt_dcache_dir_read += m_dcache_ways; 4060 4091 vaddr_t invadr = dreq.wdata; … … 4105 4136 case DCACHE_DCACHE_INVAL_PA: 4106 4137 { 4138 // external cache invalidate request 4139 if ( r_tgt_dcache_req ) 4140 { 4141 r_dcache_fsm = DCACHE_CC_CHECK; 4142 r_dcache_fsm_save = r_dcache_fsm; 4143 m_cost_data_waste_wait_frz++; 4144 break; 4145 } 4107 4146 m_cpt_dcache_dir_read += m_dcache_ways; 4108 4147 paddr_t dpaddr = (paddr_t)r_mmu_word_hi.read() << 32 | r_mmu_word_lo.read(); … … 4300 4339 if ( r_dcache_inval_tlb_rsp ) // Miss read response and tlb invalidation 4301 4340 { 4302 r_dcache_fsm = DCACHE_IDLE;4303 4341 r_dcache_inval_tlb_rsp = false; 4304 break;4305 4342 } 4306 4343 … … 4330 4367 4331 4368 } 4332 r_dcache_buf_unc_valid = true; 4369 drsp.valid = true; 4370 drsp.rdata = r_dcache_miss_buf[0]; 4333 4371 r_dcache_fsm = DCACHE_IDLE; 4334 4372 } … … 4801 4839 if (((r_dcache_fsm_save == DCACHE_BIS)||(r_dcache_fsm_save == DCACHE_MISS_WAIT) || 4802 4840 (r_dcache_fsm_save == DCACHE_UNC_WAIT)||(r_dcache_fsm_save == DCACHE_MISS_UPDT)) && 4803 (r_dcache_tlb_nline .read() == r_dcache_dtlb_inval_line.read()))4841 (r_dcache_tlb_nline == r_dcache_dtlb_inval_line)) 4804 4842 { 4805 4843 r_dcache_inval_tlb_rsp = true; … … 5644 5682 } 5645 5683 else 5646 { 5684 { 5647 5685 p_vci_ini_c.address = r_dcache_cleanup_line.read() * (m_dcache_words<<2); 5648 5686 p_vci_ini_c.trdid = 0; // cleanup data
Note: See TracChangeset
for help on using the changeset viewer.