Changeset 484 for trunk/modules/vci_cc_vcache_wrapper
- Timestamp:
- Aug 6, 2013, 1:36:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r473 r484 1030 1030 1031 1031 // coherence interrupt 1032 if ( r_cc_receive_icache_req.read() )1032 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1033 1033 { 1034 1034 r_icache_fsm = ICACHE_CC_CHECK; … … 1266 1266 1267 1267 // coherence interrupt 1268 if ( r_cc_receive_icache_req.read() )1268 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1269 1269 { 1270 1270 r_icache_fsm = ICACHE_CC_CHECK; … … 1318 1318 1319 1319 // coherence request (from CC_RECEIVE FSM) 1320 if ( r_cc_receive_icache_req.read() )1320 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1321 1321 { 1322 1322 r_icache_fsm = ICACHE_CC_CHECK; … … 1525 1525 1526 1526 // coherence interrupt 1527 if ( r_cc_receive_icache_req.read() )1527 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1528 1528 { 1529 1529 r_icache_fsm = ICACHE_CC_CHECK; … … 1622 1622 1623 1623 // coherence interrupt 1624 if ( r_cc_receive_icache_req.read() )1624 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1625 1625 { 1626 1626 r_icache_fsm = ICACHE_CC_CHECK; … … 1701 1701 1702 1702 // coherence interrupt 1703 if ( r_cc_receive_icache_req.read() )1703 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1704 1704 { 1705 1705 r_icache_fsm = ICACHE_CC_CHECK; … … 1780 1780 1781 1781 // coherence interrupt 1782 if ( r_cc_receive_icache_req.read() )1782 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1783 1783 { 1784 1784 r_icache_fsm = ICACHE_CC_CHECK; … … 1819 1819 paddr_t mask = ~((m_icache_words<<2)-1); 1820 1820 1821 // CLACK handler 1822 // We switch the directory slot to EMPTY state 1823 // and reset r_icache_miss_clack if the cleanup ack 1824 // is matching a pending miss. 1825 if ( r_icache_clack_req.read() ) 1826 { 1827 1828 if ( m_ireq.valid ) m_cost_ins_miss_frz++; 1829 1830 #ifdef INSTRUMENTATION 1831 m_cpt_icache_dir_write++; 1832 #endif 1833 r_icache.write_dir( 0, 1834 r_icache_clack_way.read(), 1835 r_icache_clack_set.read(), 1836 CACHE_SLOT_STATE_EMPTY); 1837 1838 if ( (r_icache_miss_set.read() == r_icache_clack_set.read()) and 1839 (r_icache_miss_way.read() == r_icache_clack_way.read()) ) 1840 { 1841 r_icache_miss_clack = false; 1842 } 1843 1844 r_icache_clack_req = false; 1845 1846 // return to cc_save state 1847 r_icache_fsm = r_icache_fsm_save.read(); 1848 1849 #if DEBUG_ICACHE 1850 if ( m_debug_activated ) 1851 { 1852 std::cout << " <PROC " << name() 1853 << " ICACHE_CC_CHECK> CC_TYPE_CLACK slot returns to empty state" 1854 << " set = " << r_icache_clack_set.read() 1855 << " / way = " << r_icache_clack_way.read() << std::endl; 1856 } 1857 #endif 1858 1859 break; 1860 } 1821 1861 1822 1862 // Match between MISS address and CC address … … 1858 1898 } 1859 1899 1860 // CLACK handler 1861 // We switch the directory slot to EMPTY state 1862 // and reset r_icache_miss_clack if the cleanup ack 1863 // is matching a pending miss. 1864 if ( r_icache_clack_req.read() ) 1865 { 1866 1867 if ( m_ireq.valid ) m_cost_ins_miss_frz++; 1868 1869 #ifdef INSTRUMENTATION 1870 m_cpt_icache_dir_write++; 1871 #endif 1872 r_icache.write_dir( 0, 1873 r_icache_clack_way.read(), 1874 r_icache_clack_set.read(), 1875 CACHE_SLOT_STATE_EMPTY); 1876 1877 if ( (r_icache_miss_set.read() == r_icache_clack_set.read()) and 1878 (r_icache_miss_way.read() == r_icache_clack_way.read()) ) 1879 { 1880 r_icache_miss_clack = false; 1881 } 1882 1883 r_icache_clack_req = false; 1884 1885 // return to cc_save state if no pending CC request 1886 if ( not r_cc_receive_icache_req.read() ) 1887 r_icache_fsm = r_icache_fsm_save.read(); 1888 1889 #if DEBUG_ICACHE 1890 if ( m_debug_activated ) 1891 { 1892 std::cout << " <PROC " << name() 1893 << " ICACHE_CC_CHECK> CC_TYPE_CLACK slot returns to empty state" 1894 << " set = " << r_icache_clack_set.read() 1895 << " / way = " << r_icache_clack_way.read() << std::endl; 1896 } 1897 #endif 1898 1899 break; 1900 } 1901 1902 // wait if pending request to CC_SEND. This way if there are pending 1903 // CLACK they can be treated in this state and then a deadlock 1904 // situation is avoided 1905 if ( r_icache_cc_send_req.read() ) break; 1900 assert ( not r_icache_cc_send_req.read() and "CC_SEND must be available in ICACHE_CC_CHECK"); 1906 1901 1907 1902 // CC request handler … … 2344 2339 } 2345 2340 // coherence request (from CC_RECEIVE FSM) 2346 else if ( r_cc_receive_dcache_req.read() )2341 else if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 2347 2342 { 2348 2343 r_dcache_fsm = DCACHE_CC_CHECK; … … 2956 2951 2957 2952 // coherence request (from CC_RECEIVE FSM) 2958 if ( r_cc_receive_dcache_req.read() )2953 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 2959 2954 { 2960 2955 r_dcache_fsm = DCACHE_CC_CHECK; … … 3261 3256 3262 3257 // coherence request (from CC_RECEIVE FSM) 3263 if ( r_cc_receive_dcache_req.read() )3258 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3264 3259 { 3265 3260 r_dcache_fsm = DCACHE_CC_CHECK; … … 3566 3561 3567 3562 // coherence request (from CC_RECEIVE FSM) 3568 if ( r_cc_receive_dcache_req.read() )3563 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3569 3564 { 3570 3565 r_dcache_fsm = DCACHE_CC_CHECK; … … 3645 3640 3646 3641 // coherence request (from CC_RECEIVE FSM) 3647 if ( r_cc_receive_dcache_req.read() )3642 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3648 3643 { 3649 3644 r_dcache_fsm = DCACHE_CC_CHECK; … … 3675 3670 3676 3671 // coherence request (from CC_RECEIVE FSM) 3677 if ( r_cc_receive_dcache_req.read() )3672 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3678 3673 { 3679 3674 r_dcache_fsm = DCACHE_CC_CHECK; … … 3718 3713 3719 3714 // coherence request (from CC_RECEIVE FSM) 3720 if ( r_cc_receive_dcache_req.read() )3715 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3721 3716 { 3722 3717 r_dcache_fsm = DCACHE_CC_CHECK; … … 3987 3982 3988 3983 // coherence request (from CC_RECEIVE FSM) 3989 if ( r_cc_receive_dcache_req.read() )3984 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3990 3985 { 3991 3986 r_dcache_fsm = DCACHE_CC_CHECK; … … 4111 4106 4112 4107 // coherence request (from CC_RECEIVE FSM) 4113 if ( r_cc_receive_dcache_req.read() )4108 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4114 4109 { 4115 4110 r_dcache_fsm = DCACHE_CC_CHECK; … … 4234 4229 4235 4230 // coherence request (from CC_RECEIVE FSM) 4236 if ( r_cc_receive_dcache_req.read() )4231 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4237 4232 { 4238 4233 r_dcache_fsm = DCACHE_CC_CHECK; … … 4316 4311 4317 4312 // coherence request (from CC_RECEIVE FSM) 4318 if ( r_cc_receive_dcache_req.read() )4313 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4319 4314 { 4320 4315 r_dcache_fsm = DCACHE_CC_CHECK; … … 4361 4356 4362 4357 // coherence request (from CC_RECEIVE FSM) 4363 if ( r_cc_receive_dcache_req.read() )4358 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4364 4359 { 4365 4360 r_dcache_fsm = DCACHE_CC_CHECK; … … 4415 4410 4416 4411 // coherence request (from CC_RECEIVE FSM) 4417 if ( r_cc_receive_dcache_req.read() )4412 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4418 4413 { 4419 4414 r_dcache_fsm = DCACHE_CC_CHECK; … … 4515 4510 4516 4511 // coherence request (from CC_RECEIVE FSM) 4517 if ( r_cc_receive_dcache_req.read() )4512 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4518 4513 { 4519 4514 r_dcache_fsm = DCACHE_CC_CHECK; … … 4571 4566 } 4572 4567 #endif 4568 // CLACK handler 4569 // We switch the directory slot to EMPTY state and reset 4570 // r_dcache_miss_clack if the cleanup ack is matching a pending miss. 4571 if ( r_dcache_clack_req.read() ) 4572 { 4573 if ( m_dreq.valid ) m_cost_data_miss_frz++; 4574 4575 #ifdef INSTRUMENTATION 4576 m_cpt_dcache_dir_write++; 4577 #endif 4578 r_dcache.write_dir( 0, 4579 r_dcache_clack_way.read(), 4580 r_dcache_clack_set.read(), 4581 CACHE_SLOT_STATE_EMPTY); 4582 4583 if ( (r_dcache_miss_set.read() == r_dcache_clack_set.read()) and 4584 (r_dcache_miss_way.read() == r_dcache_clack_way.read()) ) 4585 { 4586 r_dcache_miss_clack = false; 4587 } 4588 4589 r_dcache_clack_req = false; 4590 4591 // return to cc_save state 4592 r_dcache_fsm = r_dcache_fsm_cc_save.read() ; 4593 4594 #if DEBUG_DCACHE 4595 if ( m_debug_activated ) 4596 { 4597 std::cout << " <PROC " << name() 4598 << " DCACHE_CC_CHECK> CC_TYPE_CLACK Switch slot to EMPTY state" 4599 << " set = " << r_dcache_clack_set.read() 4600 << " / way = " << r_dcache_clack_way.read() << std::endl; 4601 } 4602 #endif 4603 break; 4604 } 4573 4605 4574 4606 … … 4612 4644 } 4613 4645 4614 // CLACK handler 4615 // We switch the directory slot to EMPTY state and reset 4616 // r_dcache_miss_clack if the cleanup ack is matching a pending miss. 4617 if ( r_dcache_clack_req.read() ) 4618 { 4619 if ( m_dreq.valid ) m_cost_data_miss_frz++; 4620 4621 #ifdef INSTRUMENTATION 4622 m_cpt_dcache_dir_write++; 4623 #endif 4624 r_dcache.write_dir( 0, 4625 r_dcache_clack_way.read(), 4626 r_dcache_clack_set.read(), 4627 CACHE_SLOT_STATE_EMPTY); 4628 4629 if ( (r_dcache_miss_set.read() == r_dcache_clack_set.read()) and 4630 (r_dcache_miss_way.read() == r_dcache_clack_way.read()) ) 4631 { 4632 r_dcache_miss_clack = false; 4633 } 4634 4635 r_dcache_clack_req = false; 4636 4637 // return to cc_save state if no pending CC request 4638 if ( not r_cc_receive_dcache_req.read() ) 4639 { 4640 r_dcache_fsm = r_dcache_fsm_cc_save.read() ; 4641 } 4642 4643 #if DEBUG_DCACHE 4644 if ( m_debug_activated ) 4645 { 4646 std::cout << " <PROC " << name() 4647 << " DCACHE_CC_CHECK> CC_TYPE_CLACK Switch slot to EMPTY state" 4648 << " set = " << r_dcache_clack_set.read() 4649 << " / way = " << r_dcache_clack_way.read() << std::endl; 4650 } 4651 #endif 4652 break; 4653 } 4654 4655 // wait if pending request to CC_SEND. This way if there are pending 4656 // CLACK they can be treated in this state and then a deadlock 4657 // situation is avoided 4658 if ( r_dcache_cc_send_req.read() ) break; 4646 4647 assert ( not r_dcache_cc_send_req.read() and "CC_SEND must be available in DCACHE_CC_CHECK" ); 4659 4648 4660 4649 // CC request handler … … 5573 5562 // flip_flop to check that ? 5574 5563 if (not (r_cc_receive_icache_req.read()) and 5575 not (r_cc_receive_dcache_req.read()) and 5564 not (r_cc_receive_dcache_req.read()) and 5576 5565 (p_dspin_m2p.write.read())) 5577 5566 { … … 5613 5602 uint64_t receive_data = p_dspin_m2p.data.read(); 5614 5603 // for data INVAL, wait for dcache to take the request 5615 if (p_dspin_m2p.write.read() and not r_cc_receive_dcache_req.read()) 5604 if (p_dspin_m2p.write.read() and 5605 not r_cc_receive_dcache_req.read() ) 5616 5606 { 5617 5607 // request dcache to handle the INVAL … … 5631 5621 uint64_t receive_data = p_dspin_m2p.data.read(); 5632 5622 // for ins INVAL, wait for icache to take the request 5633 if (p_dspin_m2p.write.read() and not r_cc_receive_icache_req.read()) 5623 if (p_dspin_m2p.write.read() and 5624 not r_cc_receive_icache_req.read() ) 5634 5625 { 5635 5626 // request icache to handle the INVAL … … 5681 5672 // for data INVAL, wait for dcache to take the request and fifo to 5682 5673 // be empty 5683 if ( r_cc_receive_updt_fifo_be.empty() and 5674 if ( r_cc_receive_updt_fifo_be.empty() and 5684 5675 p_dspin_m2p.write.read() ) 5685 5676 { … … 5701 5692 // for ins INVAL, wait for icache to take the request and fifo to be 5702 5693 // empty 5703 if ( r_cc_receive_updt_fifo_be.empty() and 5694 if ( r_cc_receive_updt_fifo_be.empty() and 5704 5695 p_dspin_m2p.write.read() ) 5705 5696 {
Note: See TracChangeset
for help on using the changeset viewer.