Changeset 468 for trunk/modules/vci_mem_cache/caba/source/src
- Timestamp:
- Jul 24, 2013, 8:47:40 AM (11 years ago)
- Location:
- trunk/modules/vci_mem_cache
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache
-
Property
svn:mergeinfo
set to
/branches/v5/modules/vci_mem_cache merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r449 r468 99 99 "CC_SEND_WRITE_IDLE", 100 100 "CC_SEND_CAS_IDLE", 101 "CC_SEND_CLEANUP_IDLE",102 101 "CC_SEND_CONFIG_INVAL_HEADER", 103 102 "CC_SEND_CONFIG_INVAL_NLINE", 104 103 "CC_SEND_CONFIG_BRDCAST_HEADER", 105 104 "CC_SEND_CONFIG_BRDCAST_NLINE", 106 "CC_SEND_CLEANUP_ACK",107 105 "CC_SEND_XRAM_RSP_BRDCAST_HEADER", 108 106 "CC_SEND_XRAM_RSP_BRDCAST_NLINE", … … 136 134 "CONFIG_DIR_REQ", 137 135 "CONFIG_DIR_ACCESS", 138 "CONFIG_DIR_ UPT_LOCK",136 "CONFIG_DIR_IVT_LOCK", 139 137 "CONFIG_BC_SEND", 140 138 "CONFIG_BC_WAIT", … … 180 178 "WRITE_MISS_XRAM_REQ", 181 179 "WRITE_BC_TRT_LOCK", 182 "WRITE_BC_ UPT_LOCK",180 "WRITE_BC_IVT_LOCK", 183 181 "WRITE_BC_DIR_INVAL", 184 182 "WRITE_BC_CC_SEND", … … 235 233 "CAS_UPT_NEXT", 236 234 "CAS_BC_TRT_LOCK", 237 "CAS_BC_ UPT_LOCK",235 "CAS_BC_IVT_LOCK", 238 236 "CAS_BC_DIR_INVAL", 239 237 "CAS_BC_CC_SEND", … … 258 256 "CLEANUP_HEAP_CLEAN", 259 257 "CLEANUP_HEAP_FREE", 260 "CLEANUP_ UPT_LOCK",261 "CLEANUP_ UPT_DECREMENT",262 "CLEANUP_ UPT_CLEAR",258 "CLEANUP_IVT_LOCK", 259 "CLEANUP_IVT_DECREMENT", 260 "CLEANUP_IVT_CLEAR", 263 261 "CLEANUP_WRITE_RSP", 264 262 "CLEANUP_CONFIG_ACK", … … 268 266 { 269 267 "ALLOC_DIR_RESET", 268 "ALLOC_DIR_CONFIG", 270 269 "ALLOC_DIR_READ", 271 270 "ALLOC_DIR_WRITE", … … 285 284 { 286 285 "ALLOC_UPT_WRITE", 287 "ALLOC_UPT_XRAM_RSP", 288 "ALLOC_UPT_MULTI_ACK", 289 "ALLOC_UPT_CLEANUP", 290 "ALLOC_UPT_CAS" 286 "ALLOC_UPT_CAS", 287 "ALLOC_UPT_MULTI_ACK" 288 }; 289 const char *alloc_ivt_fsm_str[] = 290 { 291 "ALLOC_IVT_WRITE", 292 "ALLOC_IVT_XRAM_RSP", 293 "ALLOC_IVT_CLEANUP", 294 "ALLOC_IVT_CAS", 295 "ALLOC_IVT_CONFIG" 291 296 }; 292 297 const char *alloc_heap_fsm_str[] = … … 328 333 const size_t trt_lines, // number of TRT entries 329 334 const size_t upt_lines, // number of UPT entries 335 const size_t ivt_lines, // number of IVT entries 330 336 const size_t debug_start_cycle, 331 337 const bool debug_ok) … … 337 343 p_vci_tgt( "p_vci_tgt" ), 338 344 p_vci_ixr( "p_vci_ixr" ), 339 p_dspin_in( "p_dspin_in" ), 340 p_dspin_out( "p_dspin_out" ), 345 p_dspin_p2m( "p_dspin_p2m" ), 346 p_dspin_m2p( "p_dspin_m2p" ), 347 p_dspin_clack( "p_dspin_clack" ), 341 348 342 349 m_seglist( mtp.getSegmentList(tgtid_d) ), … … 355 362 m_upt_lines(upt_lines), 356 363 m_upt(upt_lines), 364 m_ivt(ivt_lines), 357 365 m_cache_directory(nways, nsets, nwords, vci_param_int::N), 358 366 m_cache_data(nways, nsets, nwords), … … 446 454 r_alloc_trt_fsm("r_alloc_trt_fsm"), 447 455 r_alloc_upt_fsm("r_alloc_upt_fsm"), 456 r_alloc_ivt_fsm("r_alloc_ivt_fsm"), 448 457 r_alloc_heap_fsm("r_alloc_heap_fsm"), 449 458 r_alloc_heap_reset_cpt("r_alloc_heap_reset_cpt") … … 623 632 << " | " << ixr_cmd_fsm_str[r_ixr_cmd_fsm.read()] 624 633 << " | " << ixr_rsp_fsm_str[r_ixr_rsp_fsm.read()] 625 << " | " << xram_rsp_fsm_str[r_xram_rsp_fsm ] << std::endl;634 << " | " << xram_rsp_fsm_str[r_xram_rsp_fsm.read()] << std::endl; 626 635 std::cout << " " << alloc_dir_fsm_str[r_alloc_dir_fsm.read()] 627 636 << " | " << alloc_trt_fsm_str[r_alloc_trt_fsm.read()] 628 637 << " | " << alloc_upt_fsm_str[r_alloc_upt_fsm.read()] 638 << " | " << alloc_ivt_fsm_str[r_alloc_ivt_fsm.read()] 629 639 << " | " << alloc_heap_fsm_str[r_alloc_heap_fsm.read()] << std::endl; 630 640 } … … 702 712 r_alloc_trt_fsm = ALLOC_TRT_READ; 703 713 r_alloc_upt_fsm = ALLOC_UPT_WRITE; 714 r_alloc_ivt_fsm = ALLOC_IVT_XRAM_RSP; 704 715 r_ixr_rsp_fsm = IXR_RSP_IDLE; 705 716 r_xram_rsp_fsm = XRAM_RSP_IDLE; … … 714 725 m_trt.init(); 715 726 m_upt.init(); 727 m_ivt.init(); 716 728 m_llsc_table.init(); 717 729 … … 1534 1546 r_config_dir_next_ptr = entry.ptr; 1535 1547 1536 r_config_fsm = CONFIG_DIR_ UPT_LOCK;1548 r_config_fsm = CONFIG_DIR_IVT_LOCK; 1537 1549 } 1538 1550 else if ( entry.valid and // hit & sync command … … 1563 1575 } 1564 1576 ///////////////////////// 1565 case CONFIG_DIR_ UPT_LOCK: // enter this state in case of INVAL command1566 // Try to get both DIR & UPT locks, and return1567 // to LOOP state if UPT full.1568 // Register inval in UPT, and invalidate the1569 // directory if UPT not full.1570 { 1571 if ( r_alloc_ upt_fsm.read() == ALLOC_UPT_CONFIG )1577 case CONFIG_DIR_IVT_LOCK: // enter this state in case of INVAL command 1578 // Try to get both DIR & IVT locks, and return 1579 // to LOOP state if IVT full. 1580 // Register inval in IVT, and invalidate the 1581 // directory if IVT not full. 1582 { 1583 if ( r_alloc_ivt_fsm.read() == ALLOC_IVT_CONFIG ) 1572 1584 { 1573 1585 size_t set = m_y[(addr_t)(r_config_address.read())]; … … 1583 1595 #if DEBUG_MEMC_CONFIG 1584 1596 if(m_debug) 1585 std::cout << " <MEMC " << name() << " CONFIG_DIR_ UPT_LOCK>"1597 std::cout << " <MEMC " << name() << " CONFIG_DIR_IVT_LOCK>" 1586 1598 << " No copies in L1 : inval DIR entry" << std::endl; 1587 1599 #endif 1588 1600 } 1589 else // try to register inval in UPT1601 else // try to register inval in IVT 1590 1602 { 1591 1603 bool wok = false; … … 1598 1610 size_t nb_copies = r_config_dir_count.read(); 1599 1611 1600 wok = m_ upt.set(false, // it's an inval transaction1612 wok = m_ivt.set(false, // it's an inval transaction 1601 1613 broadcast, 1602 1614 false, // no response required … … 1609 1621 index); 1610 1622 1611 if ( wok ) // UPT success => inval DIR slot1623 if ( wok ) // IVT success => inval DIR slot 1612 1624 { 1613 1625 m_cache_directory.inval( way, set ); 1614 r_config_ upt_index = index;1626 r_config_ivt_index = index; 1615 1627 if ( broadcast ) r_config_fsm = CONFIG_BC_SEND; 1616 1628 else r_config_fsm = CONFIG_INV_SEND; … … 1618 1630 #if DEBUG_MEMC_CONFIG 1619 1631 if(m_debug) 1620 std::cout << " <MEMC " << name() << " CONFIG_DIR_ UPT_LOCK>"1621 << " Inval DIR entry and register inval in UPT"1632 std::cout << " <MEMC " << name() << " CONFIG_DIR_IVT_LOCK>" 1633 << " Inval DIR entry and register inval in IVT" 1622 1634 << " : index = " << std::dec << index 1623 1635 << " / broadcast = " << broadcast << std::endl; 1624 1636 #endif 1625 1637 } 1626 else // UPT full => release both DIR and UPT locks1638 else // IVT full => release both DIR and IVT locks 1627 1639 { 1628 1640 r_config_fsm = CONFIG_LOOP; … … 1630 1642 #if DEBUG_MEMC_CONFIG 1631 1643 if(m_debug) 1632 std::cout << " <MEMC " << name() << " CONFIG_DIR_ UPT_LOCK>"1633 << " UPT full : release DIR & UPT locks and retry" << std::endl;1644 std::cout << " <MEMC " << name() << " CONFIG_DIR_IVT_LOCK>" 1645 << " IVT full : release DIR & IVT locks and retry" << std::endl; 1634 1646 #endif 1635 1647 } … … 1646 1658 r_config_to_cc_send_multi_req = false; 1647 1659 r_config_to_cc_send_brdcast_req = true; 1648 r_config_to_cc_send_trdid = r_config_ upt_index.read();1660 r_config_to_cc_send_trdid = r_config_ivt_index.read(); 1649 1661 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 1650 1662 r_cleanup_to_config_ack = false; … … 1686 1698 r_config_to_cc_send_multi_req = true; 1687 1699 r_config_to_cc_send_brdcast_req = false; 1688 r_config_to_cc_send_trdid = r_config_ upt_index.read();1700 r_config_to_cc_send_trdid = r_config_ivt_index.read(); 1689 1701 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 1690 1702 r_multi_ack_to_config_ack = false; … … 1848 1860 switch(r_read_fsm.read()) 1849 1861 { 1850 1851 1852 1862 /////////////// 1863 case READ_IDLE: // waiting a read request 1864 { 1853 1865 if(m_cmd_read_addr_fifo.rok()) 1854 1866 { 1855 1867 1856 1868 #if DEBUG_MEMC_READ 1857 if(m_debug)1858 std::cout << " <MEMC " << name() << " READ_IDLE> Read request"1859 << " : address = " << std::hex << m_cmd_read_addr_fifo.read()1860 << " / srcid = " << m_cmd_read_srcid_fifo.read()1861 << " / trdid = " << m_cmd_read_trdid_fifo.read()1862 << " / pktid = " << m_cmd_read_pktid_fifo.read()1863 << " / nwords = " << std::dec << m_cmd_read_length_fifo.read() << std::endl;1869 if(m_debug) 1870 std::cout << " <MEMC " << name() << " READ_IDLE> Read request" 1871 << " : address = " << std::hex << m_cmd_read_addr_fifo.read() 1872 << " / srcid = " << m_cmd_read_srcid_fifo.read() 1873 << " / trdid = " << m_cmd_read_trdid_fifo.read() 1874 << " / pktid = " << m_cmd_read_pktid_fifo.read() 1875 << " / nwords = " << std::dec << m_cmd_read_length_fifo.read() << std::endl; 1864 1876 #endif 1865 1877 r_read_fsm = READ_DIR_REQ; … … 1961 1973 1962 1974 { 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1975 if(r_alloc_dir_fsm.read() == ALLOC_DIR_READ) 1976 { 1977 // check if this is an instruction read, this means pktid is either 1978 // TYPE_READ_INS_UNC 0bX010 with TSAR encoding 1979 // TYPE_READ_INS_MISS 0bX011 with TSAR encoding 1980 bool inst_read = ((m_cmd_read_pktid_fifo.read() & 0x2) != 0); 1981 // check if this is a cached read, this means pktid is either 1982 // TYPE_READ_DATA_MISS 0bX001 with TSAR encoding 1983 // TYPE_READ_INS_MISS 0bX011 with TSAR encoding 1984 bool cached_read = (m_cmd_read_pktid_fifo.read() & 0x1); 1985 bool is_cnt = r_read_is_cnt.read(); 1986 1987 // read data in the cache 1988 size_t set = m_y[(addr_t)(m_cmd_read_addr_fifo.read())]; 1989 size_t way = r_read_way.read(); 1990 1991 m_cache_data.read_line(way, set, r_read_data); 1992 1993 if(m_monitor_ok) check_monitor( m_cmd_read_addr_fifo.read(), r_read_data[0], true); 1994 1995 // update the cache directory 1996 DirectoryEntry entry; 1997 entry.valid = true; 1998 entry.is_cnt = is_cnt; 1999 entry.dirty = r_read_dirty.read(); 2000 entry.tag = r_read_tag.read(); 2001 entry.lock = r_read_lock.read(); 2002 entry.ptr = r_read_ptr.read(); 2003 2004 if(cached_read) // Cached read => we must update the copies 2005 { 2006 if(!is_cnt) // Not counter mode 2007 { 2008 entry.owner.srcid = m_cmd_read_srcid_fifo.read(); 1997 2009 #if L1_MULTI_CACHE 1998 1999 #endif 2000 2001 2002 2003 2004 2005 2010 entry.owner.cache_id = m_cmd_read_pktid_fifo.read(); 2011 #endif 2012 entry.owner.inst = inst_read; 2013 entry.count = r_read_count.read() + 1; 2014 } 2015 else // Counter mode 2016 { 2017 entry.owner.srcid = 0; 2006 2018 #if L1_MULTI_CACHE 2007 2008 #endif 2009 2010 2011 2012 2013 2014 2015 2019 entry.owner.cache_id = 0; 2020 #endif 2021 entry.owner.inst = false; 2022 entry.count = r_read_count.read() + 1; 2023 } 2024 } 2025 else // Uncached read 2026 { 2027 entry.owner.srcid = r_read_copy.read(); 2016 2028 #if L1_MULTI_CACHE 2017 2018 #endif 2019 2020 2021 2029 entry.owner.cache_id = r_read_copy_cache.read(); 2030 #endif 2031 entry.owner.inst = r_read_copy_inst.read(); 2032 entry.count = r_read_count.read(); 2033 } 2022 2034 2023 2035 #if DEBUG_MEMC_READ 2024 if(m_debug)2025 std::cout << " <MEMC " << name() << " READ_DIR_HIT> Update directory entry:"2026 << " addr = " << std::hex << m_cmd_read_addr_fifo.read()2027 << " / set = " << std::dec << set2028 << " / way = " << way2029 << " / owner_id = " << std::hex << entry.owner.srcid2030 << " / owner_ins = " << std::dec << entry.owner.inst2031 << " / count = " << entry.count2032 << " / is_cnt = " << entry.is_cnt << std::endl;2033 #endif 2034 2035 2036 2037 2038 2036 if(m_debug) 2037 std::cout << " <MEMC " << name() << " READ_DIR_HIT> Update directory entry:" 2038 << " addr = " << std::hex << m_cmd_read_addr_fifo.read() 2039 << " / set = " << std::dec << set 2040 << " / way = " << way 2041 << " / owner_id = " << std::hex << entry.owner.srcid 2042 << " / owner_ins = " << std::dec << entry.owner.inst 2043 << " / count = " << entry.count 2044 << " / is_cnt = " << entry.is_cnt << std::endl; 2045 #endif 2046 2047 m_cache_directory.write(set, way, entry); 2048 r_read_fsm = READ_RSP; 2049 } 2050 break; 2039 2051 } 2040 2052 /////////////////// … … 2750 2762 2751 2763 wok = m_upt.set(true, // it's an update transaction 2752 false, 2753 true, 2754 false, 2764 false, // it's not a broadcast 2765 true, // response required 2766 false, // no acknowledge required 2755 2767 srcid, 2756 2768 trdid, … … 2904 2916 entry.owner.inst) // put the next srcid in the fifo 2905 2917 { 2906 dec_upt_counter 2918 dec_upt_counter = false; 2907 2919 write_to_cc_send_fifo_put = true; 2908 2920 write_to_cc_send_fifo_inst = entry.owner.inst; … … 2957 2969 { 2958 2970 r_write_to_cc_send_multi_req = true; 2959 if(r_write_to_dec.read() or dec_upt_counter) 2971 if(r_write_to_dec.read() or dec_upt_counter) r_write_fsm = WRITE_UPT_DEC; 2960 2972 else r_write_fsm = WRITE_IDLE; 2961 2973 } … … 3200 3212 { 3201 3213 r_write_trt_index = wok_index; 3202 r_write_fsm = WRITE_BC_ UPT_LOCK;3214 r_write_fsm = WRITE_BC_IVT_LOCK; 3203 3215 } 3204 3216 else // wait an empty entry in TRT … … 3217 3229 3218 3230 ////////////////////// 3219 case WRITE_BC_ UPT_LOCK: // register BC transaction in UPT3220 { 3221 if(r_alloc_ upt_fsm.read() == ALLOC_UPT_WRITE)3231 case WRITE_BC_IVT_LOCK: // register BC transaction in IVT 3232 { 3233 if(r_alloc_ivt_fsm.read() == ALLOC_IVT_WRITE) 3222 3234 { 3223 3235 bool wok = false; … … 3229 3241 size_t nb_copies = r_write_count.read(); 3230 3242 3231 wok = m_ upt.set(false, // it's an inval transaction3232 true, 3233 true, 3234 false, 3243 wok = m_ivt.set(false, // it's an inval transaction 3244 true, // it's a broadcast 3245 true, // response required 3246 false, // no acknowledge required 3235 3247 srcid, 3236 3248 trdid, … … 3242 3254 #if DEBUG_MEMC_WRITE 3243 3255 if( m_debug and wok ) 3244 std::cout << " <MEMC " << name() << " WRITE_BC_ UPT_LOCK> Register broadcast inval in UPT"3256 std::cout << " <MEMC " << name() << " WRITE_BC_IVT_LOCK> Register broadcast inval in IVT" 3245 3257 << " / nb_copies = " << r_write_count.read() << std::endl; 3246 3258 #endif … … 3248 3260 3249 3261 if(wok) r_write_fsm = WRITE_BC_DIR_INVAL; 3250 else 3262 else r_write_fsm = WRITE_WAIT; 3251 3263 } 3252 3264 break; … … 3259 3271 // and invalidate the line in directory 3260 3272 if((r_alloc_trt_fsm.read() != ALLOC_TRT_WRITE) or 3261 (r_alloc_upt_fsm.read() != ALLOC_UPT_WRITE) or3262 3273 (r_alloc_ivt_fsm.read() != ALLOC_IVT_WRITE) or 3274 (r_alloc_dir_fsm.read() != ALLOC_DIR_WRITE)) 3263 3275 { 3264 3276 std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_BC_DIR_INVAL state" << std::endl; 3265 std::cout << "bad TRT, DIR, or UPT allocation" << std::endl;3277 std::cout << "bad TRT, DIR, or IVT allocation" << std::endl; 3266 3278 exit(0); 3267 3279 } … … 3791 3803 } 3792 3804 ///////////////////////// 3793 case XRAM_RSP_INVAL_LOCK: // Take the UPT lock to check a possible pending inval3794 { 3795 if(r_alloc_ upt_fsm == ALLOC_UPT_XRAM_RSP)3805 case XRAM_RSP_INVAL_LOCK: // Take the IVT lock to check a possible pending inval 3806 { 3807 if(r_alloc_ivt_fsm == ALLOC_IVT_XRAM_RSP) 3796 3808 { 3797 3809 size_t index = 0; 3798 if(m_ upt.search_inval(r_xram_rsp_trt_buf.nline, index)) // pending inval3810 if(m_ivt.search_inval(r_xram_rsp_trt_buf.nline, index)) // pending inval 3799 3811 { 3800 3812 r_xram_rsp_fsm = XRAM_RSP_INVAL_WAIT; … … 3803 3815 if(m_debug) 3804 3816 std::cout << " <MEMC " << name() << " XRAM_RSP_INVAL_LOCK>" 3805 << " Get acces to UPT, but line invalidation registered"3817 << " Get acces to IVT, but line invalidation registered" 3806 3818 << " / nline = " << std::hex << r_xram_rsp_trt_buf.nline 3807 3819 << " / index = " << std::dec << index << std::endl; … … 3809 3821 3810 3822 } 3811 else if(m_ upt.is_full() and r_xram_rsp_victim_inval.read()) // UPT full3823 else if(m_ivt.is_full() and r_xram_rsp_victim_inval.read()) // IVT full 3812 3824 { 3813 3825 r_xram_rsp_fsm = XRAM_RSP_INVAL_WAIT; … … 3816 3828 if(m_debug) 3817 3829 std::cout << " <MEMC " << name() << " XRAM_RSP_INVAL_LOCK>" 3818 << " Get acces to UPT, but inval required and UPT full" << std::endl;3830 << " Get acces to IVT, but inval required and IVT full" << std::endl; 3819 3831 #endif 3820 3832 } … … 3826 3838 if(m_debug) 3827 3839 std::cout << " <MEMC " << name() << " XRAM_RSP_INVAL_LOCK>" 3828 << " Get acces to UPT" << std::endl;3840 << " Get acces to IVT" << std::endl; 3829 3841 #endif 3830 3842 } … … 3846 3858 /////////////////////// 3847 3859 case XRAM_RSP_DIR_UPDT: // updates the cache (both data & directory) 3848 // and possibly set an inval request in UPT3860 // and possibly set an inval request in IVT 3849 3861 { 3850 3862 // check if this is an instruction read, this means pktid is either … … 3904 3916 m_cache_directory.write(set, way, entry); 3905 3917 3906 // request an invalidattion request in UPT for victim line3918 // request an invalidattion request in IVT for victim line 3907 3919 if(r_xram_rsp_victim_inval.read()) 3908 3920 { … … 3911 3923 size_t count_copies = r_xram_rsp_victim_count.read(); 3912 3924 3913 bool wok = m_ upt.set(false, // it's an inval transaction3925 bool wok = m_ivt.set(false, // it's an inval transaction 3914 3926 broadcast, // set broadcast bit 3915 3927 false, // no response required … … 3922 3934 index); 3923 3935 3924 r_xram_rsp_ upt_index = index;3936 r_xram_rsp_ivt_index = index; 3925 3937 3926 3938 if(!wok) 3927 3939 { 3928 3940 std::cout << "VCI_MEM_CACHE ERROR " << name() << " XRAM_RSP_DIR_UPDT" 3929 << " update_tab entry free but write unsuccessful" << std::endl;3941 << " invalidate_tab entry free but write unsuccessful" << std::endl; 3930 3942 exit(0); 3931 3943 } … … 4036 4048 r_xram_rsp_to_cc_send_brdcast_req = r_xram_rsp_victim_is_cnt.read(); 4037 4049 r_xram_rsp_to_cc_send_nline = r_xram_rsp_victim_nline.read(); 4038 r_xram_rsp_to_cc_send_trdid = r_xram_rsp_ upt_index;4050 r_xram_rsp_to_cc_send_trdid = r_xram_rsp_ivt_index; 4039 4051 xram_rsp_to_cc_send_fifo_srcid = r_xram_rsp_victim_copy.read(); 4040 4052 xram_rsp_to_cc_send_fifo_inst = r_xram_rsp_victim_copy_inst.read(); … … 4252 4264 DspinDhccpParam::dspin_get( 4253 4265 flit, 4254 DspinDhccpParam:: FROM_L1_TYPE);4266 DspinDhccpParam::P2M_TYPE); 4255 4267 4256 4268 r_cleanup_way_index = … … 4381 4393 else // miss : check UPT for a pending invalidation transaction 4382 4394 { 4383 r_cleanup_fsm = CLEANUP_ UPT_LOCK;4395 r_cleanup_fsm = CLEANUP_IVT_LOCK; 4384 4396 } 4385 4397 … … 4839 4851 } 4840 4852 ////////////////////// 4841 case CLEANUP_ UPT_LOCK: // get the lock protecting the UPT to search a pending4853 case CLEANUP_IVT_LOCK: // get the lock protecting the IVT to search a pending 4842 4854 // invalidate transaction matching the cleanup 4843 4855 { 4844 if(r_alloc_ upt_fsm.read() != ALLOC_UPT_CLEANUP) break;4856 if(r_alloc_ivt_fsm.read() != ALLOC_IVT_CLEANUP) break; 4845 4857 4846 4858 size_t index = 0; 4847 4859 bool match_inval; 4848 4860 4849 match_inval = m_ upt.search_inval(r_cleanup_nline.read(), index);4861 match_inval = m_ivt.search_inval(r_cleanup_nline.read(), index); 4850 4862 4851 4863 if ( not match_inval ) // no pending inval … … 4856 4868 if(m_debug) 4857 4869 std::cout << " <MEMC " << name() 4858 << " CLEANUP_ UPT_LOCK> Unexpected cleanup"4859 << " with no corresponding UPT entry:"4870 << " CLEANUP_IVT_LOCK> Unexpected cleanup" 4871 << " with no corresponding IVT entry:" 4860 4872 << " address = " << std::hex 4861 4873 << (r_cleanup_nline.read() *4*m_words) … … 4866 4878 4867 4879 // pending inval 4868 r_cleanup_write_srcid = m_ upt.srcid(index);4869 r_cleanup_write_trdid = m_ upt.trdid(index);4870 r_cleanup_write_pktid = m_ upt.pktid(index);4871 r_cleanup_need_rsp = m_ upt.need_rsp(index);4872 r_cleanup_need_ack = m_ upt.need_ack(index);4880 r_cleanup_write_srcid = m_ivt.srcid(index); 4881 r_cleanup_write_trdid = m_ivt.trdid(index); 4882 r_cleanup_write_pktid = m_ivt.pktid(index); 4883 r_cleanup_need_rsp = m_ivt.need_rsp(index); 4884 r_cleanup_need_ack = m_ivt.need_ack(index); 4873 4885 r_cleanup_index = index; 4874 4886 4875 r_cleanup_fsm = CLEANUP_ UPT_DECREMENT;4887 r_cleanup_fsm = CLEANUP_IVT_DECREMENT; 4876 4888 4877 4889 #if DEBUG_MEMC_CLEANUP 4878 4890 if(m_debug) 4879 4891 std::cout << " <MEMC " << name() 4880 << " CLEANUP_ UPT_LOCK> Cleanup matching pending"4881 << " invalidate transaction on UPT:"4892 << " CLEANUP_IVT_LOCK> Cleanup matching pending" 4893 << " invalidate transaction on IVT:" 4882 4894 << " address = " << std::hex << r_cleanup_nline.read() * m_words * 4 4883 << " / upt_entry = " << index << std::endl;4895 << " / ivt_entry = " << index << std::endl; 4884 4896 #endif 4885 4897 break; 4886 4898 } 4887 4899 /////////////////////////// 4888 case CLEANUP_ UPT_DECREMENT: // decrement response counter in UPT matching entry4889 { 4890 if(r_alloc_ upt_fsm.read() != ALLOC_UPT_CLEANUP)4900 case CLEANUP_IVT_DECREMENT: // decrement response counter in IVT matching entry 4901 { 4902 if(r_alloc_ivt_fsm.read() != ALLOC_IVT_CLEANUP) 4891 4903 { 4892 4904 std::cout 4893 4905 << "VCI_MEM_CACHE ERROR " << name() 4894 << " CLEANUP_ UPT_DECREMENT state" << std::endl4895 << "Bad UPT allocation"4906 << " CLEANUP_IVT_DECREMENT state" << std::endl 4907 << "Bad IVT allocation" 4896 4908 << std::endl; 4897 4909 … … 4900 4912 4901 4913 size_t count = 0; 4902 m_ upt.decrement(r_cleanup_index.read(), count);4914 m_ivt.decrement(r_cleanup_index.read(), count); 4903 4915 4904 4916 if(count == 0) // multi inval transaction completed 4905 4917 { 4906 r_cleanup_fsm = CLEANUP_ UPT_CLEAR;4918 r_cleanup_fsm = CLEANUP_IVT_CLEAR; 4907 4919 } 4908 4920 else // multi inval transaction not completed … … 4913 4925 #if DEBUG_MEMC_CLEANUP 4914 4926 if(m_debug) 4915 std::cout << " <MEMC " << name() << " CLEANUP_ UPT_DECREMENT>"4916 << " Decrement response counter in UPT:"4917 << " UPT_index = " << r_cleanup_index.read()4927 std::cout << " <MEMC " << name() << " CLEANUP_IVT_DECREMENT>" 4928 << " Decrement response counter in IVT:" 4929 << " IVT_index = " << r_cleanup_index.read() 4918 4930 << " / rsp_count = " << count << std::endl; 4919 4931 #endif … … 4921 4933 } 4922 4934 /////////////////////// 4923 case CLEANUP_ UPT_CLEAR: // Clear UPT entry4924 { 4925 if(r_alloc_ upt_fsm.read() != ALLOC_UPT_CLEANUP)4935 case CLEANUP_IVT_CLEAR: // Clear IVT entry 4936 { 4937 if(r_alloc_ivt_fsm.read() != ALLOC_IVT_CLEANUP) 4926 4938 { 4927 4939 std::cout 4928 4940 << "VCI_MEM_CACHE ERROR " << name() 4929 << " CLEANUP_ UPT_CLEAR state" << std::endl4930 << "Bad UPT allocation"4941 << " CLEANUP_IVT_CLEAR state" << std::endl 4942 << "Bad IVT allocation" 4931 4943 << std::endl; 4932 4944 … … 4934 4946 } 4935 4947 4936 m_ upt.clear(r_cleanup_index.read());4948 m_ivt.clear(r_cleanup_index.read()); 4937 4949 4938 4950 if ( r_cleanup_need_rsp.read() ) r_cleanup_fsm = CLEANUP_WRITE_RSP; … … 4943 4955 if(m_debug) 4944 4956 std::cout << " <MEMC " << name() 4945 << " CLEANUP_ UPT_CLEAR> Clear entry in UPT:"4946 << " UPT_index = " << r_cleanup_index.read() << std::endl;4957 << " CLEANUP_IVT_CLEAR> Clear entry in IVT:" 4958 << " IVT_index = " << r_cleanup_index.read() << std::endl; 4947 4959 #endif 4948 4960 break; … … 4989 5001 } 4990 5002 //////////////////////// 4991 case CLEANUP_SEND_CLACK: // acknowledgement to a cleanup command 4992 // on the coherence network (request to the CC_SEND FSM). 4993 // wait if pending request to the CC_SEND FSM 4994 { 4995 if(r_cleanup_to_cc_send_req.read()) break; 4996 4997 r_cleanup_to_cc_send_req = true; 4998 r_cleanup_to_cc_send_set_index = r_cleanup_nline.read() & 0xFFFF; 4999 r_cleanup_to_cc_send_way_index = r_cleanup_way_index.read(); 5000 r_cleanup_to_cc_send_srcid = r_cleanup_srcid.read(); 5001 r_cleanup_to_cc_send_inst = r_cleanup_inst.read(); 5003 case CLEANUP_SEND_CLACK: // acknowledgement to a cleanup command 5004 // on the coherence CLACK network. 5005 { 5006 if(not p_dspin_clack.read) break; 5002 5007 5003 5008 r_cleanup_fsm = CLEANUP_IDLE; … … 5007 5012 std::cout << " <MEMC " << name() 5008 5013 << " CLEANUP_SEND_CLACK> Send the response to a cleanup request:" 5009 << " srcid = " << std::dec << r_cleanup_srcid.read() << std::endl; 5014 << " nline = " << std::hex << r_cleanup_nline.read() 5015 << " / way = " << std::dec << r_cleanup_way.read() 5016 << " / srcid = " << std::dec << r_cleanup_srcid.read() 5017 << std::endl; 5010 5018 #endif 5011 5019 break; … … 5242 5250 !r_cas_to_cc_send_brdcast_req.read()) 5243 5251 { 5244 r_cas_fsm = CAS_UPT_LOCK; // multi update required5252 r_cas_fsm = CAS_UPT_LOCK; // multi update required 5245 5253 } 5246 5254 else … … 5507 5515 { 5508 5516 r_cas_trt_index = wok_index; 5509 r_cas_fsm = CAS_BC_ UPT_LOCK;5517 r_cas_fsm = CAS_BC_IVT_LOCK; 5510 5518 } 5511 5519 else … … 5522 5530 } 5523 5531 ///////////////////// 5524 case CAS_BC_ UPT_LOCK: // register a broadcast inval transaction in UPT5532 case CAS_BC_IVT_LOCK: // register a broadcast inval transaction in IVT 5525 5533 // write data in cache in case of successful registration 5526 5534 { 5527 if(r_alloc_ upt_fsm.read() == ALLOC_UPT_CAS)5535 if(r_alloc_ivt_fsm.read() == ALLOC_IVT_CAS) 5528 5536 { 5529 5537 bool wok = false; … … 5535 5543 size_t nb_copies = r_cas_count.read(); 5536 5544 5537 // register a broadcast inval transaction in UPT5538 wok = m_ upt.set(false, // it's an inval transaction5539 true, 5540 true, 5541 false, 5545 // register a broadcast inval transaction in IVT 5546 wok = m_ivt.set(false, // it's an inval transaction 5547 true, // it's a broadcast 5548 true, // response required 5549 false, // no acknowledge required 5542 5550 srcid, 5543 5551 trdid, … … 5547 5555 index); 5548 5556 5549 if(wok) // UPT not full5557 if(wok) // IVT not full 5550 5558 { 5551 5559 // cache update … … 5573 5581 if(m_debug) 5574 5582 std::cout << " <MEMC " << name() 5575 << " CAS_BC_ UPT_LOCK> Register a broadcast inval transaction in UPT"5583 << " CAS_BC_IVT_LOCK> Register a broadcast inval transaction in IVT" 5576 5584 << " / nline = " << std::hex << nline 5577 5585 << " / count = " << std::dec << nb_copies 5578 << " / upt_index = " << index << std::endl;5579 #endif 5580 } 5581 else // releases the lock protecting UPT5586 << " / ivt_index = " << index << std::endl; 5587 #endif 5588 } 5589 else // releases the lock protecting IVT 5582 5590 { 5583 5591 r_cas_fsm = CAS_WAIT; … … 5590 5598 { 5591 5599 if((r_alloc_trt_fsm.read() == ALLOC_TRT_CAS) and 5592 (r_alloc_upt_fsm.read() == ALLOC_UPT_CAS) and5593 5600 (r_alloc_ivt_fsm.read() == ALLOC_IVT_CAS) and 5601 (r_alloc_dir_fsm.read() == ALLOC_DIR_CAS)) 5594 5602 { 5595 5603 // set TRT … … 5834 5842 // network, used to update or invalidate cache lines in L1 caches. 5835 5843 // 5836 // This fsm is used also to acknowledge CLEANUP a command after request from 5837 // the CLEANUP fsm. 5838 // 5839 // It implements a round-robin priority between the five possible client FSMs 5840 // XRAM_RSP > CAS > CLEANUP > WRITE > CONFIG 5844 // It implements a round-robin priority between the four possible client FSMs 5845 // XRAM_RSP > CAS > WRITE > CONFIG 5841 5846 // 5842 5847 // Each FSM can request the next services: … … 5850 5855 // r_config_to_cc_send_brdcast_req : broadcast-inval 5851 5856 // 5852 // - r_cleanup_to_cc_send_req : cleanup acknowledgement5853 //5854 5857 // An inval request is a double DSPIN flit command containing: 5855 5858 // 1. the index of the line to be invalidated. … … 5894 5897 break; 5895 5898 } 5896 // CLEANUP5897 if (r_cleanup_to_cc_send_req.read())5898 {5899 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;5900 break;5901 }5902 5899 // WRITE 5903 5900 if(m_write_to_cc_send_inst_fifo.rok() or … … 5973 5970 break; 5974 5971 } 5975 // CLEANUP5976 if (r_cleanup_to_cc_send_req.read())5977 {5978 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;5979 break;5980 }5981 5972 // WRITE 5982 5973 if(m_write_to_cc_send_inst_fifo.rok() or … … 6012 6003 break; 6013 6004 } 6014 // CLEANUP6015 if(r_cleanup_to_cc_send_req.read())6016 {6017 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;6018 break;6019 }6020 6005 // WRITE 6021 6006 if(m_write_to_cc_send_inst_fifo.rok() or … … 6065 6050 case CC_SEND_CAS_IDLE: // CLEANUP FSM has highest priority 6066 6051 { 6067 if(r_cleanup_to_cc_send_req.read())6068 {6069 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;6070 break;6071 }6072 6052 if(m_write_to_cc_send_inst_fifo.rok() or 6073 6053 r_write_to_cc_send_multi_req.read()) … … 6124 6104 break; 6125 6105 } 6126 //////////////////////////6127 case CC_SEND_CLEANUP_IDLE: // WRITE FSM has highest priority6128 {6129 // WRITE6130 if(m_write_to_cc_send_inst_fifo.rok() or6131 r_write_to_cc_send_multi_req.read())6132 {6133 r_cc_send_fsm = CC_SEND_WRITE_UPDT_HEADER;6134 m_cpt_update++;6135 break;6136 }6137 if(r_write_to_cc_send_brdcast_req.read())6138 {6139 r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_HEADER;6140 m_cpt_inval++;6141 break;6142 }6143 // CONFIG6144 if(r_config_to_cc_send_multi_req.read())6145 {6146 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;6147 m_cpt_inval++;6148 break;6149 }6150 if(r_config_to_cc_send_brdcast_req.read())6151 {6152 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER;6153 m_cpt_inval++;6154 break;6155 }6156 // XRAM_RSP6157 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or6158 r_xram_rsp_to_cc_send_multi_req.read())6159 {6160 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_HEADER;6161 m_cpt_inval++;6162 break;6163 }6164 if(r_xram_rsp_to_cc_send_brdcast_req.read())6165 {6166 r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_HEADER;6167 m_cpt_inval++;6168 break;6169 }6170 // CAS6171 if(m_cas_to_cc_send_inst_fifo.rok() or6172 r_cas_to_cc_send_multi_req.read())6173 {6174 r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER;6175 m_cpt_update++;6176 break;6177 }6178 if(r_cas_to_cc_send_brdcast_req.read())6179 {6180 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER;6181 m_cpt_inval++;6182 break;6183 }6184 // CLEANUP6185 if(r_cleanup_to_cc_send_req.read())6186 {6187 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;6188 break;6189 }6190 break;6191 }6192 6106 ///////////////////////////////// 6193 6107 case CC_SEND_CONFIG_INVAL_HEADER: // send first flit multi-inval (from CONFIG FSM) … … 6195 6109 if(m_config_to_cc_send_inst_fifo.rok()) 6196 6110 { 6197 if(not p_dspin_ out.read) break;6111 if(not p_dspin_m2p.read) break; 6198 6112 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_NLINE; 6199 6113 break; … … 6206 6120 case CC_SEND_CONFIG_INVAL_NLINE: // send second flit multi-inval (from CONFIG FSM) 6207 6121 { 6208 if(not p_dspin_ out.read) break;6122 if(not p_dspin_m2p.read) break; 6209 6123 m_cpt_inval_mult++; 6210 6124 config_to_cc_send_fifo_get = true; … … 6222 6136 case CC_SEND_CONFIG_BRDCAST_HEADER: // send first flit BC-inval (from CONFIG FSM) 6223 6137 { 6224 if(not p_dspin_ out.read) break;6138 if(not p_dspin_m2p.read) break; 6225 6139 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_NLINE; 6226 6140 break; … … 6229 6143 case CC_SEND_CONFIG_BRDCAST_NLINE: // send second flit BC-inval (from CONFIG FSM) 6230 6144 { 6231 if(not p_dspin_ out.read) break;6145 if(not p_dspin_m2p.read) break; 6232 6146 m_cpt_inval_brdcast++; 6233 6147 r_config_to_cc_send_brdcast_req = false; … … 6242 6156 break; 6243 6157 } 6244 /////////////////////////6245 case CC_SEND_CLEANUP_ACK: // send one flit for a cleanup acknowledgement6246 {6247 if(not p_dspin_out.read) break;6248 6249 r_cleanup_to_cc_send_req = false;6250 r_cc_send_fsm = CC_SEND_CLEANUP_IDLE;6251 6252 #if DEBUG_MEMC_CC_SEND6253 if(m_debug)6254 std::cout << " <MEMC " << name()6255 << " CC_SEND_CLEANUP_ACK> Cleanup Ack for srcid "6256 << std::hex << r_cleanup_to_cc_send_srcid.read() << std::endl;6257 #endif6258 break;6259 }6260 6158 /////////////////////////////////// 6261 6159 case CC_SEND_XRAM_RSP_INVAL_HEADER: // send first flit multi-inval (from XRAM_RSP FSM) … … 6263 6161 if(m_xram_rsp_to_cc_send_inst_fifo.rok()) 6264 6162 { 6265 if(not p_dspin_ out.read) break;6163 if(not p_dspin_m2p.read) break; 6266 6164 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_NLINE; 6267 6165 break; … … 6274 6172 case CC_SEND_XRAM_RSP_INVAL_NLINE: // send second flit multi-inval (from XRAM_RSP FSM) 6275 6173 { 6276 if(not p_dspin_ out.read) break;6174 if(not p_dspin_m2p.read) break; 6277 6175 m_cpt_inval_mult++; 6278 6176 xram_rsp_to_cc_send_fifo_get = true; … … 6282 6180 if(m_debug) 6283 6181 std::cout << " <MEMC " << name() 6284 << " CC_SEND_XRAM_RSP_INVAL_NLINE> BC-Inval for line "6182 << " CC_SEND_XRAM_RSP_INVAL_NLINE> Multicast-Inval for line " 6285 6183 << std::hex << r_xram_rsp_to_cc_send_nline.read() << std::endl; 6286 6184 #endif … … 6290 6188 case CC_SEND_XRAM_RSP_BRDCAST_HEADER: // send first flit broadcast-inval (from XRAM_RSP FSM) 6291 6189 { 6292 if(not p_dspin_ out.read) break;6190 if(not p_dspin_m2p.read) break; 6293 6191 r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_NLINE; 6294 6192 break; … … 6297 6195 case CC_SEND_XRAM_RSP_BRDCAST_NLINE: // send second flit broadcast-inval (from XRAM_RSP FSM) 6298 6196 { 6299 if(not p_dspin_ out.read) break;6197 if(not p_dspin_m2p.read) break; 6300 6198 m_cpt_inval_brdcast++; 6301 6199 r_xram_rsp_to_cc_send_brdcast_req = false; … … 6313 6211 case CC_SEND_WRITE_BRDCAST_HEADER: // send first flit broadcast-inval (from WRITE FSM) 6314 6212 { 6315 if(not p_dspin_ out.read) break;6213 if(not p_dspin_m2p.read) break; 6316 6214 r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_NLINE; 6317 6215 break; … … 6320 6218 case CC_SEND_WRITE_BRDCAST_NLINE: // send second flit broadcast-inval (from WRITE FSM) 6321 6219 { 6322 if(not p_dspin_ out.read) break;6220 if(not p_dspin_m2p.read) break; 6323 6221 6324 6222 m_cpt_inval_brdcast++; … … 6340 6238 if(m_write_to_cc_send_inst_fifo.rok()) 6341 6239 { 6342 if(not p_dspin_ out.read) break;6240 if(not p_dspin_m2p.read) break; 6343 6241 6344 6242 r_cc_send_fsm = CC_SEND_WRITE_UPDT_NLINE; … … 6357 6255 case CC_SEND_WRITE_UPDT_NLINE: // send second flit for a multi-update (from WRITE FSM) 6358 6256 { 6359 if(not p_dspin_ out.read) break;6257 if(not p_dspin_m2p.read) break; 6360 6258 m_cpt_update_mult++; 6361 6259 … … 6374 6272 case CC_SEND_WRITE_UPDT_DATA: // send N data flits for a multi-update (from WRITE FSM) 6375 6273 { 6376 if(not p_dspin_ out.read) break;6274 if(not p_dspin_m2p.read) break; 6377 6275 if(r_cc_send_cpt.read() == (r_write_to_cc_send_count.read()-1)) 6378 6276 { … … 6388 6286 case CC_SEND_CAS_BRDCAST_HEADER: // send first flit broadcast-inval (from CAS FSM) 6389 6287 { 6390 if(not p_dspin_ out.read) break;6288 if(not p_dspin_m2p.read) break; 6391 6289 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_NLINE; 6392 6290 break; … … 6395 6293 case CC_SEND_CAS_BRDCAST_NLINE: // send second flit broadcast-inval (from CAS FSM) 6396 6294 { 6397 if(not p_dspin_ out.read) break;6295 if(not p_dspin_m2p.read) break; 6398 6296 m_cpt_inval_brdcast++; 6399 6297 … … 6414 6312 if(m_cas_to_cc_send_inst_fifo.rok()) 6415 6313 { 6416 if(not p_dspin_ out.read) break;6314 if(not p_dspin_m2p.read) break; 6417 6315 6418 6316 r_cc_send_fsm = CC_SEND_CAS_UPDT_NLINE; … … 6432 6330 case CC_SEND_CAS_UPDT_NLINE: // send second flit for a multi-update (from CAS FSM) 6433 6331 { 6434 if(not p_dspin_ out.read) break;6332 if(not p_dspin_m2p.read) break; 6435 6333 6436 6334 m_cpt_update_mult++; … … 6450 6348 case CC_SEND_CAS_UPDT_DATA: // send first data for a multi-update (from CAS FSM) 6451 6349 { 6452 if(not p_dspin_ out.read) break;6350 if(not p_dspin_m2p.read) break; 6453 6351 6454 6352 if(r_cas_to_cc_send_is_long.read()) … … 6465 6363 case CC_SEND_CAS_UPDT_DATA_HIGH: // send second data for a multi-update (from CAS FSM) 6466 6364 { 6467 if(not p_dspin_ out.read) break;6365 if(not p_dspin_m2p.read) break; 6468 6366 cas_to_cc_send_fifo_get = true; 6469 6367 r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER; … … 6485 6383 case CC_RECEIVE_IDLE: 6486 6384 { 6487 if(not p_dspin_ in.write) break;6385 if(not p_dspin_p2m.write) break; 6488 6386 6489 6387 uint8_t type = 6490 6388 DspinDhccpParam::dspin_get( 6491 p_dspin_ in.data.read(),6492 DspinDhccpParam:: FROM_L1_TYPE);6389 p_dspin_p2m.data.read(), 6390 DspinDhccpParam::P2M_TYPE); 6493 6391 6494 6392 if((type == DspinDhccpParam::TYPE_CLEANUP_DATA) or … … 6516 6414 // write first CLEANUP flit in CC_RECEIVE to CLEANUP fifo 6517 6415 6518 if(not p_dspin_ in.write or not m_cc_receive_to_cleanup_fifo.wok())6416 if(not p_dspin_p2m.write or not m_cc_receive_to_cleanup_fifo.wok()) 6519 6417 break; 6520 6418 6521 assert(not p_dspin_ in.eop.read() and6419 assert(not p_dspin_p2m.eop.read() and 6522 6420 "VCI_MEM_CACHE ERROR in CC_RECEIVE : " 6523 6421 "CLEANUP command must have two flits"); … … 6533 6431 // write second CLEANUP flit in CC_RECEIVE to CLEANUP fifo 6534 6432 6535 if(not p_dspin_ in.write or not m_cc_receive_to_cleanup_fifo.wok())6433 if(not p_dspin_p2m.write or not m_cc_receive_to_cleanup_fifo.wok()) 6536 6434 break; 6537 6435 6538 assert(p_dspin_ in.eop.read() and6436 assert(p_dspin_p2m.eop.read() and 6539 6437 "VCI_MEM_CACHE ERROR in CC_RECEIVE : " 6540 6438 "CLEANUP command must have two flits"); … … 6552 6450 6553 6451 // wait for a WOK in the CC_RECEIVE to MULTI_ACK fifo 6554 if(not p_dspin_ in.write or not m_cc_receive_to_multi_ack_fifo.wok())6452 if(not p_dspin_p2m.write or not m_cc_receive_to_multi_ack_fifo.wok()) 6555 6453 break; 6556 6454 6557 assert(p_dspin_ in.eop.read() and6455 assert(p_dspin_p2m.eop.read() and 6558 6456 "VCI_MEM_CACHE ERROR in CC_RECEIVE : " 6559 6457 "MULTI_ACK command must have one flit"); … … 6965 6863 // ALLOC_UPT FSM 6966 6864 //////////////////////////////////////////////////////////////////////////////////// 6967 // The ALLOC_UPT FSM allocates the access to the Update/Inval Table (UPT), 6968 // with a round robin priority between six FSMs, with the following order: 6969 // CONFIG > MULTI_ACK > WRITE > XRAM_RSP > CLEANUP > CAS 6970 // - The CONFIG FSM initiates an inval transaction and sets a new entry in UPT. 6865 // The ALLOC_UPT FSM allocates the access to the Update Table (UPT), 6866 // with a round robin priority between three FSMs, with the following order: 6867 // WRITE -> CAS -> MULTI_ACK 6868 // - The WRITE FSM initiates update transaction and sets a new entry in UPT. 6869 // - The CAS FSM does the same thing as the WRITE FSM. 6971 6870 // - The MULTI_ACK FSM complete those trasactions and erase the UPT entry. 6972 // - The WRITE FSM initiates update transaction and sets a new entry in UPT.6973 // - The XRAM_RSP FSM initiates an inval transactions and sets a new entry in UPT.6974 // - The CLEANUP FSM decrement an entry in UPT.6975 // - The CAS FSM does the same thing as the WRITE FSM.6976 6871 // The resource is always allocated. 6977 6872 ///////////////////////////////////////////////////////////////////////////////////// 6978 6979 6873 switch(r_alloc_upt_fsm.read()) 6980 6874 { 6981 //////////////////////6982 case ALLOC_UPT_CONFIG: // allocated to CONFIG FSM6983 if (r_config_fsm.read() != CONFIG_DIR_UPT_LOCK)6984 {6985 if(r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK)6986 r_alloc_upt_fsm = ALLOC_UPT_MULTI_ACK;6987 6988 else if((r_write_fsm.read() == WRITE_UPT_LOCK) or6989 (r_write_fsm.read() == WRITE_BC_UPT_LOCK))6990 r_alloc_upt_fsm = ALLOC_UPT_WRITE;6991 6992 else if(r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK)6993 r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP;6994 6995 else if(r_cleanup_fsm.read() == CLEANUP_UPT_LOCK)6996 r_alloc_upt_fsm = ALLOC_UPT_CLEANUP;6997 6998 else if((r_cas_fsm.read() == CAS_UPT_LOCK) or6999 (r_cas_fsm.read() == CAS_BC_UPT_LOCK))7000 r_alloc_upt_fsm = ALLOC_UPT_CAS;7001 }7002 break;7003 7004 6875 ///////////////////////// 7005 case ALLOC_UPT_MULTI_ACK: // allocated to MULTI_ACK FSM 7006 if( (r_multi_ack_fsm.read() != MULTI_ACK_UPT_LOCK) and 7007 (r_multi_ack_fsm.read() != MULTI_ACK_UPT_CLEAR)) 7008 { 7009 if((r_write_fsm.read() == WRITE_UPT_LOCK) or 7010 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) 7011 r_alloc_upt_fsm = ALLOC_UPT_WRITE; 7012 7013 else if(r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 7014 r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 7015 7016 else if(r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) 7017 r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; 7018 7019 else if((r_cas_fsm.read() == CAS_UPT_LOCK) or 7020 (r_cas_fsm.read() == CAS_BC_UPT_LOCK)) 7021 r_alloc_upt_fsm = ALLOC_UPT_CAS; 7022 7023 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 7024 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 7025 } 7026 break; 7027 7028 ///////////////////// 7029 case ALLOC_UPT_WRITE: // allocated to WRITE FSM 7030 if((r_write_fsm.read() != WRITE_UPT_LOCK) and 7031 (r_write_fsm.read() != WRITE_BC_UPT_LOCK)) 7032 { 7033 if(r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 7034 r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 7035 7036 else if(r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) 7037 r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; 7038 7039 else if((r_cas_fsm.read() == CAS_UPT_LOCK) or 7040 (r_cas_fsm.read() == CAS_BC_UPT_LOCK)) 7041 r_alloc_upt_fsm = ALLOC_UPT_CAS; 7042 7043 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 7044 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 7045 7046 else if(r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK) 7047 r_alloc_upt_fsm = ALLOC_UPT_MULTI_ACK; 7048 } 7049 break; 7050 7051 //////////////////////// 7052 case ALLOC_UPT_XRAM_RSP: 7053 if(r_xram_rsp_fsm.read() != XRAM_RSP_INVAL_LOCK) 7054 { 7055 if(r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) 7056 r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; 7057 7058 else if((r_cas_fsm.read() == CAS_UPT_LOCK) or 7059 (r_cas_fsm.read() == CAS_BC_UPT_LOCK)) 7060 r_alloc_upt_fsm = ALLOC_UPT_CAS; 7061 7062 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 7063 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 7064 7065 else if(r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK) 7066 r_alloc_upt_fsm = ALLOC_UPT_MULTI_ACK; 7067 7068 else if((r_write_fsm.read() == WRITE_UPT_LOCK) or 7069 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) 7070 r_alloc_upt_fsm = ALLOC_UPT_WRITE; 7071 } 7072 break; 7073 6876 case ALLOC_UPT_WRITE: // allocated to WRITE FSM 6877 if (r_write_fsm.read() != WRITE_UPT_LOCK) 6878 { 6879 if (r_cas_fsm.read() == CAS_UPT_LOCK) 6880 r_alloc_upt_fsm = ALLOC_UPT_CAS; 6881 6882 else if (r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK) 6883 r_alloc_upt_fsm = ALLOC_UPT_MULTI_ACK; 6884 } 6885 break; 6886 6887 ///////////////////////// 6888 case ALLOC_UPT_CAS: // allocated to CAS FSM 6889 if (r_cas_fsm.read() != CAS_UPT_LOCK) 6890 { 6891 if (r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK) 6892 r_alloc_upt_fsm = ALLOC_UPT_MULTI_ACK; 6893 6894 else if (r_write_fsm.read() == WRITE_UPT_LOCK) 6895 r_alloc_upt_fsm = ALLOC_UPT_WRITE; 6896 } 6897 break; 6898 6899 ///////////////////////// 6900 case ALLOC_UPT_MULTI_ACK: // allocated to MULTI_ACK FSM 6901 if ((r_multi_ack_fsm.read() != MULTI_ACK_UPT_LOCK ) and 6902 (r_multi_ack_fsm.read() != MULTI_ACK_UPT_CLEAR)) 6903 { 6904 if (r_write_fsm.read() == WRITE_UPT_LOCK) 6905 r_alloc_upt_fsm = ALLOC_UPT_WRITE; 6906 6907 else if (r_cas_fsm.read() == CAS_UPT_LOCK) 6908 r_alloc_upt_fsm = ALLOC_UPT_CAS; 6909 } 6910 break; 6911 } // end switch r_alloc_upt_fsm 6912 6913 //////////////////////////////////////////////////////////////////////////////////// 6914 // ALLOC_IVT FSM 6915 //////////////////////////////////////////////////////////////////////////////////// 6916 // The ALLOC_IVT FSM allocates the access to the Invalidate Table (IVT), 6917 // with a round robin priority between five FSMs, with the following order: 6918 // WRITE -> XRAM_RSP -> CLEANUP -> CAS -> CONFIG 6919 // - The WRITE FSM initiates broadcast invalidate transactions and sets a new entry 6920 // in IVT. 6921 // - The CAS FSM does the same thing as the WRITE FSM. 6922 // - The XRAM_RSP FSM initiates broadcast/multicast invalidate transaction and sets 6923 // a new entry in the IVT 6924 // - The CONFIG FSM does the same thing as the XRAM_RSP FSM 6925 // - The CLEANUP FSM complete those trasactions and erase the IVT entry. 6926 // The resource is always allocated. 6927 ///////////////////////////////////////////////////////////////////////////////////// 6928 switch(r_alloc_ivt_fsm.read()) 6929 { 7074 6930 ////////////////////////// 7075 case ALLOC_UPT_CLEANUP: 7076 if((r_cleanup_fsm.read() != CLEANUP_UPT_LOCK ) and 7077 (r_cleanup_fsm.read() != CLEANUP_UPT_DECREMENT)) 7078 { 7079 if((r_cas_fsm.read() == CAS_UPT_LOCK) or 7080 (r_cas_fsm.read() == CAS_BC_UPT_LOCK)) 7081 r_alloc_upt_fsm = ALLOC_UPT_CAS; 7082 7083 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 7084 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 7085 7086 else if(r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK) 7087 r_alloc_upt_fsm = ALLOC_UPT_MULTI_ACK; 7088 7089 else if((r_write_fsm.read() == WRITE_UPT_LOCK) or 7090 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) 7091 r_alloc_upt_fsm = ALLOC_UPT_WRITE; 7092 7093 else if(r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 7094 r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 7095 } 7096 break; 6931 case ALLOC_IVT_WRITE: // allocated to WRITE FSM 6932 if (r_write_fsm.read() != WRITE_BC_IVT_LOCK) 6933 { 6934 if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 6935 r_alloc_ivt_fsm = ALLOC_IVT_XRAM_RSP; 6936 6937 else if (r_cleanup_fsm.read() == CLEANUP_IVT_LOCK) 6938 r_alloc_ivt_fsm = ALLOC_IVT_CLEANUP; 6939 6940 else if (r_cas_fsm.read() == CAS_BC_IVT_LOCK) 6941 r_alloc_ivt_fsm = ALLOC_IVT_CAS; 6942 6943 else if (r_config_fsm.read() == CONFIG_DIR_IVT_LOCK) 6944 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 6945 } 6946 break; 7097 6947 7098 6948 ////////////////////////// 7099 case ALLOC_UPT_CAS: 7100 if((r_cas_fsm.read() != CAS_UPT_LOCK) and 7101 (r_cas_fsm.read() != CAS_BC_UPT_LOCK)) 7102 { 7103 if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 7104 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 7105 7106 else if(r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK) 7107 r_alloc_upt_fsm = ALLOC_UPT_MULTI_ACK; 7108 7109 else if((r_write_fsm.read() == WRITE_UPT_LOCK) or 7110 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) 7111 r_alloc_upt_fsm = ALLOC_UPT_WRITE; 7112 7113 else if(r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 7114 r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 7115 7116 else if(r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) 7117 r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; 7118 } 7119 break; 7120 7121 } // end switch r_alloc_upt_fsm 6949 case ALLOC_IVT_XRAM_RSP: // allocated to XRAM_RSP FSM 6950 if(r_xram_rsp_fsm.read() != XRAM_RSP_INVAL_LOCK) 6951 { 6952 if(r_cleanup_fsm.read() == CLEANUP_IVT_LOCK) 6953 r_alloc_ivt_fsm = ALLOC_IVT_CLEANUP; 6954 6955 else if (r_cas_fsm.read() == CAS_BC_IVT_LOCK) 6956 r_alloc_ivt_fsm = ALLOC_IVT_CAS; 6957 6958 else if (r_config_fsm.read() == CONFIG_DIR_IVT_LOCK) 6959 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 6960 6961 else if (r_write_fsm.read() == WRITE_BC_IVT_LOCK) 6962 r_alloc_ivt_fsm = ALLOC_IVT_WRITE; 6963 } 6964 break; 6965 6966 ////////////////////////// 6967 case ALLOC_IVT_CLEANUP: // allocated to CLEANUP FSM 6968 if ((r_cleanup_fsm.read() != CLEANUP_IVT_LOCK ) and 6969 (r_cleanup_fsm.read() != CLEANUP_IVT_DECREMENT)) 6970 { 6971 if (r_cas_fsm.read() == CAS_BC_IVT_LOCK) 6972 r_alloc_ivt_fsm = ALLOC_IVT_CAS; 6973 6974 else if (r_config_fsm.read() == CONFIG_DIR_IVT_LOCK) 6975 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 6976 6977 else if (r_write_fsm.read() == WRITE_BC_IVT_LOCK) 6978 r_alloc_ivt_fsm = ALLOC_IVT_WRITE; 6979 6980 else if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 6981 r_alloc_ivt_fsm = ALLOC_IVT_XRAM_RSP; 6982 } 6983 break; 6984 6985 ////////////////////////// 6986 case ALLOC_IVT_CAS: // allocated to CAS FSM 6987 if (r_cas_fsm.read() != CAS_BC_IVT_LOCK) 6988 { 6989 if (r_config_fsm.read() == CONFIG_DIR_IVT_LOCK) 6990 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 6991 6992 else if (r_write_fsm.read() == WRITE_BC_IVT_LOCK) 6993 r_alloc_ivt_fsm = ALLOC_IVT_WRITE; 6994 6995 else if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 6996 r_alloc_ivt_fsm = ALLOC_IVT_XRAM_RSP; 6997 6998 else if (r_cleanup_fsm.read() == CLEANUP_IVT_LOCK) 6999 r_alloc_ivt_fsm = ALLOC_IVT_CLEANUP; 7000 } 7001 break; 7002 7003 ////////////////////////// 7004 case ALLOC_IVT_CONFIG: // allocated to CONFIG FSM 7005 if (r_config_fsm.read() != CONFIG_DIR_IVT_LOCK) 7006 { 7007 if (r_write_fsm.read() == WRITE_BC_IVT_LOCK) 7008 r_alloc_ivt_fsm = ALLOC_IVT_WRITE; 7009 7010 else if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) 7011 r_alloc_ivt_fsm = ALLOC_IVT_XRAM_RSP; 7012 7013 else if (r_cleanup_fsm.read() == CLEANUP_IVT_LOCK) 7014 r_alloc_ivt_fsm = ALLOC_IVT_CLEANUP; 7015 7016 else if (r_cas_fsm.read() == CAS_BC_IVT_LOCK) 7017 r_alloc_ivt_fsm = ALLOC_IVT_CAS; 7018 } 7019 break; 7020 7021 } // end switch r_alloc_ivt_fsm 7122 7022 7123 7023 //////////////////////////////////////////////////////////////////////////////////// … … 7149 7049 if ( (r_config_fsm.read() != CONFIG_DIR_REQ) and 7150 7050 (r_config_fsm.read() != CONFIG_DIR_ACCESS) and 7151 (r_config_fsm.read() != CONFIG_DIR_ UPT_LOCK) )7051 (r_config_fsm.read() != CONFIG_DIR_IVT_LOCK) ) 7152 7052 { 7153 7053 if(r_read_fsm.read() == READ_DIR_REQ) … … 7202 7102 (r_write_fsm.read() != WRITE_DIR_HIT) and 7203 7103 (r_write_fsm.read() != WRITE_BC_TRT_LOCK) and 7204 (r_write_fsm.read() != WRITE_BC_ UPT_LOCK) and7104 (r_write_fsm.read() != WRITE_BC_IVT_LOCK) and 7205 7105 (r_write_fsm.read() != WRITE_MISS_TRT_LOCK) and 7206 7106 (r_write_fsm.read() != WRITE_UPT_LOCK) and … … 7238 7138 (r_cas_fsm.read() != CAS_DIR_HIT_WRITE) and 7239 7139 (r_cas_fsm.read() != CAS_BC_TRT_LOCK) and 7240 (r_cas_fsm.read() != CAS_BC_ UPT_LOCK) and7140 (r_cas_fsm.read() != CAS_BC_IVT_LOCK) and 7241 7141 (r_cas_fsm.read() != CAS_MISS_TRT_LOCK) and 7242 7142 (r_cas_fsm.read() != CAS_UPT_LOCK) and … … 7352 7252 if((r_write_fsm.read() != WRITE_MISS_TRT_LOCK) and 7353 7253 (r_write_fsm.read() != WRITE_BC_TRT_LOCK) and 7354 (r_write_fsm.read() != WRITE_BC_ UPT_LOCK))7254 (r_write_fsm.read() != WRITE_BC_IVT_LOCK)) 7355 7255 { 7356 7256 if((r_cas_fsm.read() == CAS_MISS_TRT_LOCK) or … … 7375 7275 if((r_cas_fsm.read() != CAS_MISS_TRT_LOCK) and 7376 7276 (r_cas_fsm.read() != CAS_BC_TRT_LOCK) and 7377 (r_cas_fsm.read() != CAS_BC_ UPT_LOCK))7277 (r_cas_fsm.read() != CAS_BC_IVT_LOCK)) 7378 7278 { 7379 7279 if((r_xram_rsp_fsm.read() == XRAM_RSP_DIR_LOCK) and … … 7665 7565 m_cc_receive_to_cleanup_fifo.update( cc_receive_to_cleanup_fifo_get, 7666 7566 cc_receive_to_cleanup_fifo_put, 7667 p_dspin_ in.data.read() );7567 p_dspin_p2m.data.read() ); 7668 7568 7669 7569 //////////////////////////////////////////////////////////////////////////////////// … … 7673 7573 m_cc_receive_to_multi_ack_fifo.update( cc_receive_to_multi_ack_fifo_get, 7674 7574 cc_receive_to_multi_ack_fifo_put, 7675 p_dspin_ in.data.read() );7575 p_dspin_p2m.data.read() ); 7676 7576 7677 7577 //////////////////////////////////////////////////////////////////////////////////// … … 8015 7915 8016 7916 //////////////////////////////////////////////////////////////////// 8017 // p_dspin_ outport (CC_SEND FSM)7917 // p_dspin_m2p port (CC_SEND FSM) 8018 7918 //////////////////////////////////////////////////////////////////// 8019 7919 8020 p_dspin_ out.write = false;8021 p_dspin_ out.eop = false;8022 p_dspin_ out.data = 0;7920 p_dspin_m2p.write = false; 7921 p_dspin_m2p.eop = false; 7922 p_dspin_m2p.data = 0; 8023 7923 8024 7924 switch(r_cc_send_fsm.read()) … … 8029 7929 case CC_SEND_WRITE_IDLE: 8030 7930 case CC_SEND_CAS_IDLE: 8031 case CC_SEND_CLEANUP_IDLE:8032 7931 { 8033 7932 break; … … 8064 7963 DspinDhccpParam::dspin_set( flit, 8065 7964 multi_inval_type, 8066 DspinDhccpParam:: FROM_MC_TYPE);8067 p_dspin_ out.write = true;8068 p_dspin_ out.data = flit;7965 DspinDhccpParam::M2P_TYPE); 7966 p_dspin_m2p.write = true; 7967 p_dspin_m2p.data = flit; 8069 7968 break; 8070 7969 } … … 8076 7975 r_config_to_cc_send_nline.read(), 8077 7976 DspinDhccpParam::MULTI_INVAL_NLINE); 8078 p_dspin_ out.eop = true;8079 p_dspin_ out.write = true;8080 p_dspin_ out.data = flit;7977 p_dspin_m2p.eop = true; 7978 p_dspin_m2p.write = true; 7979 p_dspin_m2p.data = flit; 8081 7980 break; 8082 7981 } 8083 ////////////////////////8084 case CC_SEND_CLEANUP_ACK:8085 {8086 uint8_t cleanup_ack_type;8087 if(r_cleanup_to_cc_send_inst.read())8088 {8089 cleanup_ack_type = DspinDhccpParam::TYPE_CLEANUP_ACK_INST;8090 }8091 else8092 {8093 cleanup_ack_type = DspinDhccpParam::TYPE_CLEANUP_ACK_DATA;8094 }8095 8096 uint64_t flit = 0;8097 uint64_t dest =8098 r_cleanup_to_cc_send_srcid.read() <<8099 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);8100 8101 DspinDhccpParam::dspin_set(8102 flit,8103 dest,8104 DspinDhccpParam::CLEANUP_ACK_DEST);8105 8106 DspinDhccpParam::dspin_set(8107 flit,8108 r_cleanup_to_cc_send_set_index.read(),8109 DspinDhccpParam::CLEANUP_ACK_SET);8110 8111 DspinDhccpParam::dspin_set(8112 flit,8113 r_cleanup_to_cc_send_way_index.read(),8114 DspinDhccpParam::CLEANUP_ACK_WAY);8115 8116 DspinDhccpParam::dspin_set(8117 flit,8118 cleanup_ack_type,8119 DspinDhccpParam::FROM_MC_TYPE);8120 8121 p_dspin_out.eop = true;8122 p_dspin_out.write = true;8123 p_dspin_out.data = flit;8124 8125 break;8126 }8127 8128 7982 /////////////////////////////////// 8129 7983 case CC_SEND_XRAM_RSP_INVAL_HEADER: … … 8159 8013 DspinDhccpParam::dspin_set( flit, 8160 8014 multi_inval_type, 8161 DspinDhccpParam:: FROM_MC_TYPE);8162 p_dspin_ out.write = true;8163 p_dspin_ out.data = flit;8015 DspinDhccpParam::M2P_TYPE); 8016 p_dspin_m2p.write = true; 8017 p_dspin_m2p.data = flit; 8164 8018 break; 8165 8019 } … … 8173 8027 r_xram_rsp_to_cc_send_nline.read(), 8174 8028 DspinDhccpParam::MULTI_INVAL_NLINE); 8175 p_dspin_ out.eop = true;8176 p_dspin_ out.write = true;8177 p_dspin_ out.data = flit;8029 p_dspin_m2p.eop = true; 8030 p_dspin_m2p.write = true; 8031 p_dspin_m2p.data = flit; 8178 8032 break; 8179 8033 } … … 8197 8051 DspinDhccpParam::dspin_set( flit, 8198 8052 1ULL, 8199 DspinDhccpParam:: FROM_MC_BC);8200 p_dspin_ out.write = true;8201 p_dspin_ out.data = flit;8053 DspinDhccpParam::M2P_BC); 8054 p_dspin_m2p.write = true; 8055 p_dspin_m2p.data = flit; 8202 8056 break; 8203 8057 } … … 8209 8063 r_xram_rsp_to_cc_send_nline.read(), 8210 8064 DspinDhccpParam::BROADCAST_NLINE); 8211 p_dspin_ out.write = true;8212 p_dspin_ out.eop = true;8213 p_dspin_ out.data = flit;8065 p_dspin_m2p.write = true; 8066 p_dspin_m2p.eop = true; 8067 p_dspin_m2p.data = flit; 8214 8068 break; 8215 8069 } … … 8221 8075 r_config_to_cc_send_nline.read(), 8222 8076 DspinDhccpParam::BROADCAST_NLINE); 8223 p_dspin_ out.write = true;8224 p_dspin_ out.eop = true;8225 p_dspin_ out.data = flit;8077 p_dspin_m2p.write = true; 8078 p_dspin_m2p.eop = true; 8079 p_dspin_m2p.data = flit; 8226 8080 break; 8227 8081 } … … 8233 8087 r_write_to_cc_send_nline.read(), 8234 8088 DspinDhccpParam::BROADCAST_NLINE); 8235 p_dspin_ out.write = true;8236 p_dspin_ out.eop = true;8237 p_dspin_ out.data = flit;8089 p_dspin_m2p.write = true; 8090 p_dspin_m2p.eop = true; 8091 p_dspin_m2p.data = flit; 8238 8092 break; 8239 8093 } … … 8245 8099 r_cas_to_cc_send_nline.read(), 8246 8100 DspinDhccpParam::BROADCAST_NLINE); 8247 p_dspin_ out.write = true;8248 p_dspin_ out.eop = true;8249 p_dspin_ out.data = flit;8101 p_dspin_m2p.write = true; 8102 p_dspin_m2p.eop = true; 8103 p_dspin_m2p.data = flit; 8250 8104 break; 8251 8105 } … … 8288 8142 flit, 8289 8143 multi_updt_type, 8290 DspinDhccpParam:: FROM_MC_TYPE);8291 8292 p_dspin_ out.write = true;8293 p_dspin_ out.data = flit;8144 DspinDhccpParam::M2P_TYPE); 8145 8146 p_dspin_m2p.write = true; 8147 p_dspin_m2p.data = flit; 8294 8148 8295 8149 break; … … 8310 8164 DspinDhccpParam::MULTI_UPDT_NLINE); 8311 8165 8312 p_dspin_ out.write = true;8313 p_dspin_ out.data = flit;8166 p_dspin_m2p.write = true; 8167 p_dspin_m2p.data = flit; 8314 8168 8315 8169 break; … … 8337 8191 DspinDhccpParam::MULTI_UPDT_DATA); 8338 8192 8339 p_dspin_ out.write = true;8340 p_dspin_ out.eop = (r_cc_send_cpt.read() == (r_write_to_cc_send_count.read()-1));8341 p_dspin_ out.data = flit;8193 p_dspin_m2p.write = true; 8194 p_dspin_m2p.eop = (r_cc_send_cpt.read() == (r_write_to_cc_send_count.read()-1)); 8195 p_dspin_m2p.data = flit; 8342 8196 8343 8197 break; … … 8381 8235 flit, 8382 8236 multi_updt_type, 8383 DspinDhccpParam:: FROM_MC_TYPE);8384 8385 p_dspin_ out.write = true;8386 p_dspin_ out.data = flit;8237 DspinDhccpParam::M2P_TYPE); 8238 8239 p_dspin_m2p.write = true; 8240 p_dspin_m2p.data = flit; 8387 8241 8388 8242 break; … … 8403 8257 DspinDhccpParam::MULTI_UPDT_NLINE); 8404 8258 8405 p_dspin_ out.write = true;8406 p_dspin_ out.data = flit;8259 p_dspin_m2p.write = true; 8260 p_dspin_m2p.data = flit; 8407 8261 8408 8262 break; … … 8423 8277 DspinDhccpParam::MULTI_UPDT_DATA); 8424 8278 8425 p_dspin_ out.write = true;8426 p_dspin_ out.eop = not r_cas_to_cc_send_is_long.read();8427 p_dspin_ out.data = flit;8279 p_dspin_m2p.write = true; 8280 p_dspin_m2p.eop = not r_cas_to_cc_send_is_long.read(); 8281 p_dspin_m2p.data = flit; 8428 8282 8429 8283 break; … … 8444 8298 DspinDhccpParam::MULTI_UPDT_DATA); 8445 8299 8446 p_dspin_ out.write = true;8447 p_dspin_ out.eop = true;8448 p_dspin_ out.data = flit;8300 p_dspin_m2p.write = true; 8301 p_dspin_m2p.eop = true; 8302 p_dspin_m2p.data = flit; 8449 8303 8450 8304 break; … … 8452 8306 } 8453 8307 8308 //////////////////////////////////////////////////////////////////// 8309 // p_dspin_clack port (CLEANUP FSM) 8310 //////////////////////////////////////////////////////////////////// 8311 8312 switch(r_cleanup_fsm.read()) 8313 { 8314 case CLEANUP_IDLE: 8315 case CLEANUP_GET_NLINE: 8316 case CLEANUP_DIR_REQ: 8317 case CLEANUP_DIR_LOCK: 8318 case CLEANUP_DIR_WRITE: 8319 case CLEANUP_HEAP_REQ: 8320 case CLEANUP_HEAP_LOCK: 8321 case CLEANUP_HEAP_SEARCH: 8322 case CLEANUP_HEAP_CLEAN: 8323 case CLEANUP_HEAP_FREE: 8324 case CLEANUP_IVT_LOCK: 8325 case CLEANUP_IVT_DECREMENT: 8326 case CLEANUP_IVT_CLEAR: 8327 case CLEANUP_WRITE_RSP: 8328 case CLEANUP_CONFIG_ACK: 8329 p_dspin_clack.write = false; 8330 p_dspin_clack.eop = false; 8331 p_dspin_clack.data = 0; 8332 8333 break; 8334 8335 case CLEANUP_SEND_CLACK: 8336 { 8337 uint8_t cleanup_ack_type; 8338 if(r_cleanup_inst.read()) 8339 { 8340 cleanup_ack_type = DspinDhccpParam::TYPE_CLACK_INST; 8341 } 8342 else 8343 { 8344 cleanup_ack_type = DspinDhccpParam::TYPE_CLACK_DATA; 8345 } 8346 8347 uint64_t flit = 0; 8348 uint64_t dest = 8349 r_cleanup_srcid.read() << 8350 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 8351 8352 DspinDhccpParam::dspin_set( 8353 flit, 8354 dest, 8355 DspinDhccpParam::CLACK_DEST); 8356 8357 DspinDhccpParam::dspin_set( 8358 flit, 8359 r_cleanup_nline.read() & 0xFFFF, 8360 DspinDhccpParam::CLACK_SET); 8361 8362 DspinDhccpParam::dspin_set( 8363 flit, 8364 r_cleanup_way_index.read(), 8365 DspinDhccpParam::CLACK_WAY); 8366 8367 DspinDhccpParam::dspin_set( 8368 flit, 8369 cleanup_ack_type, 8370 DspinDhccpParam::CLACK_TYPE); 8371 8372 p_dspin_clack.eop = true; 8373 p_dspin_clack.write = true; 8374 p_dspin_clack.data = flit; 8375 } 8376 break; 8377 } 8378 8454 8379 /////////////////////////////////////////////////////////////////// 8455 // p_dspin_ inport (CC_RECEIVE FSM)8380 // p_dspin_p2m port (CC_RECEIVE FSM) 8456 8381 /////////////////////////////////////////////////////////////////// 8457 p_dspin_in.read = false;8382 // 8458 8383 switch(r_cc_receive_fsm.read()) 8459 8384 { 8460 8385 case CC_RECEIVE_IDLE: 8461 8386 { 8387 p_dspin_p2m.read = false; 8462 8388 break; 8463 8389 } … … 8465 8391 case CC_RECEIVE_CLEANUP_EOP: 8466 8392 { 8467 p_dspin_ in.read = m_cc_receive_to_cleanup_fifo.wok();8393 p_dspin_p2m.read = m_cc_receive_to_cleanup_fifo.wok(); 8468 8394 break; 8469 8395 } 8470 8396 case CC_RECEIVE_MULTI_ACK: 8471 8397 { 8472 p_dspin_ in.read = m_cc_receive_to_multi_ack_fifo.wok();8398 p_dspin_p2m.read = m_cc_receive_to_multi_ack_fifo.wok(); 8473 8399 break; 8474 8400 }
Note: See TracChangeset
for help on using the changeset viewer.