Changeset 538 for branches/RWT
- Timestamp:
- Oct 2, 2013, 4:03:11 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
r515 r538 357 357 r_dcache_cleanup_victim_req("r_dcache_cleanup_victim_req"), 358 358 r_dcache_cleanup_victim_nline("r_dcache_cleanup_victim_nline"), 359 360 r_icache_cleanup_victim_req("r_icache_cleanup_victim_req"), 361 r_icache_cleanup_victim_nline("r_icache_cleanup_victim_nline"), 359 362 360 363 r_dcache_cc_send_req("r_dcache_cc_send_req"), … … 1601 1604 } 1602 1605 1603 if ( not r_icache_cc_send_req.read() ) // wait for previous cc_send request to be sent 1604 { 1605 bool found; 1606 bool cleanup; 1607 size_t way; 1608 size_t set; 1609 paddr_t victim; 1606 bool found; 1607 bool cleanup; 1608 size_t way; 1609 size_t set; 1610 paddr_t victim; 1610 1611 1611 1612 #ifdef INSTRUMENTATION 1612 1613 m_cpt_icache_dir_read++; 1613 1614 #endif 1614 r_icache.read_select(r_icache_vci_paddr.read(), 1615 &victim, 1616 &way, 1617 &set, 1618 &found, 1619 &cleanup ); 1620 if ( found ) 1621 { 1622 r_icache_miss_way = way; 1623 r_icache_miss_set = set; 1624 1625 if ( cleanup ) 1615 r_icache.read_select(r_icache_vci_paddr.read(), 1616 &victim, 1617 &way, 1618 &set, 1619 &found, 1620 &cleanup ); 1621 if ( found ) 1622 { 1623 r_icache_miss_way = way; 1624 r_icache_miss_set = set; 1625 1626 if ( cleanup ) 1627 { 1628 if ( not r_icache_cc_send_req.read() ) 1626 1629 { 1627 r_icache_fsm = ICACHE_MISS_CLEAN; 1628 r_icache_miss_clack = true; 1629 // request cleanup 1630 r_icache_cc_send_req = true; 1631 r_icache_cc_send_nline = victim; 1632 r_icache_cc_send_way = way; 1633 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1630 r_icache_cc_send_req = true; 1631 r_icache_cc_send_nline = victim; 1632 r_icache_cc_send_way = way; 1633 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1634 1634 } 1635 1635 else 1636 1636 { 1637 r_icache_fsm = ICACHE_MISS_WAIT; 1637 r_icache_cleanup_victim_req = true; 1638 r_icache_cleanup_victim_nline = victim; 1638 1639 } 1640 1641 r_icache_miss_clack = true; 1642 r_icache_fsm = ICACHE_MISS_CLEAN; 1643 } 1644 else 1645 { 1646 r_icache_fsm = ICACHE_MISS_WAIT; 1647 } 1639 1648 1640 1649 #if DEBUG_ICACHE … … 1649 1658 } 1650 1659 #endif 1651 }1652 1660 } 1653 1661 break; … … 1682 1690 if (m_ireq.valid) m_cost_ins_miss_frz++; 1683 1691 1692 if ( r_icache_cleanup_victim_req.read() and not r_icache_cc_send_req.read() ) 1693 { 1694 r_icache_cc_send_req = true; 1695 r_icache_cc_send_nline = r_icache_cleanup_victim_nline; 1696 r_icache_cc_send_way = r_icache_miss_way; 1697 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1698 r_icache_cleanup_victim_req = false; 1699 } 1700 1684 1701 // coherence clack interrupt 1685 1702 if ( r_icache_clack_req.read() ) … … 1689 1706 break; 1690 1707 } 1691 1708 1692 1709 // coherence interrupt 1693 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() )1710 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() and not r_icache_cleanup_victim_req.read() ) 1694 1711 { 1695 1712 r_icache_fsm = ICACHE_CC_CHECK; … … 1761 1778 if ( m_ireq.valid ) m_cost_ins_miss_frz++; 1762 1779 1780 if ( r_icache_cleanup_victim_req.read() and not r_icache_cc_send_req.read() ) 1781 { 1782 r_icache_cc_send_req = true; 1783 r_icache_cc_send_nline = r_icache_cleanup_victim_nline; 1784 r_icache_cc_send_way = r_icache_miss_way; 1785 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1786 r_icache_cleanup_victim_req = false; 1787 } 1788 1763 1789 // coherence clack interrupt 1764 1790 if ( r_icache_clack_req.read() ) … … 1770 1796 1771 1797 // coherence interrupt 1772 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() )1798 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() and not r_icache_cleanup_victim_req.read() ) 1773 1799 { 1774 1800 r_icache_fsm = ICACHE_CC_CHECK; … … 2019 2045 } 2020 2046 } 2047 #if DEBUG_ICACHE 2048 if ( m_debug_activated ) 2049 { 2050 std::cout << " <PROC " << name() 2051 << " ICACHE_CC_CHECK> Coherence request received:" 2052 << " PADDR = " << std::hex << paddr 2053 << " / TYPE = " << std::dec << r_cc_receive_dcache_type.read() 2054 << " / HIT = " << ((state == CACHE_SLOT_STATE_VALID_CC) or (state == CACHE_SLOT_STATE_VALID_NCC)) << std::endl; 2055 } 2056 #endif 2057 2021 2058 break; 2022 2059 } … … 3790 3827 // to avoid dead-lock in case of simultaneous ITLB miss 3791 3828 { 3829 // coherence clack request (from DSPIN CLACK) 3830 if ( r_dcache_clack_req.read() ) 3831 { 3832 r_dcache_fsm = DCACHE_CC_CHECK; 3833 r_dcache_fsm_cc_save = r_dcache_fsm.read(); 3834 break; 3835 } 3836 3837 // coherence request (from CC_RECEIVE FSM) 3838 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3839 { 3840 r_dcache_fsm = DCACHE_CC_CHECK; 3841 r_dcache_fsm_cc_save = r_dcache_fsm.read(); 3842 break; 3843 } 3844 3792 3845 // itlb miss request 3793 3846 if ( r_icache_tlb_miss_req.read() ) … … 4514 4567 //r_dcache_in_tlb[way*m_dcache_sets+set] = false; 4515 4568 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_DIRTY; 4516 r_dcache_tlb_inval_line = r_dcache_cc_send_nline; 4569 if( not r_dcache_cleanup_victim_req.read() ) 4570 { 4571 r_dcache_tlb_inval_line = r_dcache_cc_send_nline.read(); 4572 } 4573 else 4574 { 4575 r_dcache_tlb_inval_line = r_dcache_cleanup_victim_nline.read(); 4576 } 4517 4577 r_dcache_tlb_inval_set = 0; 4518 4578 r_dcache_fsm_scan_save = DCACHE_MISS_WAIT; … … 5101 5161 paddr_t mask = ~((m_dcache_words<<2)-1); 5102 5162 5103 #if DEBUG_DCACHE5104 if ( m_debug_activated )5105 {5106 std::cout << " <PROC " << name() << std::hex5107 << " DCACHE_CC_CHECK> paddr = " << paddr5108 << " r_dcache_vci_paddr = " << r_dcache_vci_paddr.read()5109 << " mask = " << mask5110 << " (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT) = "5111 << (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT)5112 << " (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT) = "5113 << (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT)5114 << " ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)) = "5115 << ((r_dcache_vci_paddr.read() & mask) == (paddr & mask))5116 << std::dec <<std::endl;5117 }5118 #endif5163 //#if DEBUG_DCACHE 5164 //if ( m_debug_activated ) 5165 //{ 5166 // std::cout << " <PROC " << name() << std::hex 5167 // << " DCACHE_CC_CHECK> paddr = " << paddr 5168 // << " r_dcache_vci_paddr = " << r_dcache_vci_paddr.read() 5169 // << " mask = " << mask 5170 // << " (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT) = " 5171 // << (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT) 5172 // << " (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT) = " 5173 // << (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT) 5174 // << " ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)) = " 5175 // << ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)) 5176 // << std::dec <<std::endl; 5177 //} 5178 //#endif 5119 5179 // CLACK handler 5120 5180 // We switch the directory slot to EMPTY state and reset
Note: See TracChangeset
for help on using the changeset viewer.