- Timestamp:
- Feb 21, 2012, 7:55:14 PM (13 years ago)
- Location:
- trunk/modules/vci_mem_cache_v4/caba/source
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache_v4/caba/source/include/update_tab_v4.h
r184 r200 15 15 16 16 public: 17 bool valid;// It is a valid pending transaction18 bool update;// It is an update transaction19 bool brdcast;// It is a broadcast invalidate20 bool rsp;// It needs a response to the initiator21 size_t srcid; 22 size_t trdid; 23 size_t pktid; 24 addr_t nline; 25 size_t count; 17 bool valid; // It is a valid pending transaction 18 bool update; // It is an update transaction 19 bool brdcast; // It is a broadcast invalidate 20 bool rsp; // It needs a response to the initiator 21 size_t srcid; // The srcid of the initiator which wrote the data 22 size_t trdid; // The trdid of the initiator which wrote the data 23 size_t pktid; // The pktid of the initiator which wrote the data 24 addr_t nline; // The identifier of the cache line 25 size_t count; // The number of acknowledge responses to receive 26 26 27 27 UpdateTabEntry(){ … … 49 49 valid = i_valid; 50 50 update = i_update; 51 brdcast 52 rsp 51 brdcast = i_brdcast; 52 rsp = i_rsp; 53 53 srcid = i_srcid; 54 54 trdid = i_trdid; -
trunk/modules/vci_mem_cache_v4/caba/source/include/vci_mem_cache_v4.h
r184 r200 146 146 WRITE_NEXT, 147 147 WRITE_DIR_LOCK, 148 WRITE_DIR_ HIT_READ,148 WRITE_DIR_READ, 149 149 WRITE_DIR_HIT, 150 150 WRITE_UPT_LOCK, 151 WRITE_ HEAP_LOCK,151 WRITE_UPT_HEAP_LOCK, 152 152 WRITE_UPT_REQ, 153 WRITE_UP DATE,153 WRITE_UPT_NEXT, 154 154 WRITE_UPT_DEC, 155 155 WRITE_RSP, 156 WRITE_TRT_LOCK, 157 WRITE_TRT_DATA, 158 WRITE_TRT_SET, 156 WRITE_MISS_TRT_LOCK, 157 WRITE_MISS_TRT_DATA, 158 WRITE_MISS_TRT_SET, 159 WRITE_MISS_XRAM_REQ, 160 WRITE_BC_TRT_LOCK, 161 WRITE_BC_UPT_LOCK, 162 WRITE_BC_DIR_INVAL, 163 WRITE_BC_CC_SEND, 164 WRITE_BC_XRAM_REQ, 159 165 WRITE_WAIT, 160 WRITE_XRAM_REQ,161 WRITE_TRT_WRITE_LOCK,162 WRITE_INVAL_LOCK,163 WRITE_DIR_INVAL,164 WRITE_INVAL,165 WRITE_XRAM_SEND,166 166 }; 167 167 … … 211 211 SC_DIR_HIT_WRITE, 212 212 SC_UPT_LOCK, 213 SC_WAIT, 214 SC_HEAP_LOCK, 213 SC_UPT_HEAP_LOCK, 215 214 SC_UPT_REQ, 216 215 SC_UPT_NEXT, 217 SC_ TRT_PUT_LOCK,218 SC_ INVAL_LOCK,219 SC_ DIR_INVAL,220 SC_ INVAL,221 SC_ TRT_PUT_REQ,216 SC_BC_TRT_LOCK, 217 SC_BC_UPT_LOCK, 218 SC_BC_DIR_INVAL, 219 SC_BC_CC_SEND, 220 SC_BC_XRAM_REQ, 222 221 SC_RSP_FAIL, 223 222 SC_RSP_SUCCESS, 224 SC_TRT_GET_LOCK, 225 SC_TRT_GET_SET, 226 SC_TRT_GET_REQ, 223 SC_MISS_TRT_LOCK, 224 SC_MISS_TRT_SET, 225 SC_MISS_XRAM_REQ, 226 SC_WAIT, 227 227 }; 228 228 … … 473 473 sc_signal<data_t> *r_write_data; // data (one cache line) 474 474 sc_signal<be_t> *r_write_be; // one byte enable per word 475 sc_signal<bool> r_write_byte; // is it a byte write475 sc_signal<bool> r_write_byte; // (BE != 0X0) and (BE != 0xF) 476 476 sc_signal<bool> r_write_is_cnt; // is_cnt bit (in directory) 477 477 sc_signal<bool> r_write_lock; // lock bit (in directory) -
trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp
r184 r200 40 40 #define DEBUG_MEMC_READ 1 // detailed trace of READ FSM 41 41 #define DEBUG_MEMC_WRITE 1 // detailed trace of WRITE FSM 42 #define DEBUG_MEMC_SC 0// detailed trace of SC FSM42 #define DEBUG_MEMC_SC 1 // detailed trace of SC FSM 43 43 #define DEBUG_MEMC_IXR_CMD 1 // detailed trace of IXR_RSP FSM 44 44 #define DEBUG_MEMC_IXR_RSP 1 // detailed trace of IXR_RSP FSM 45 45 #define DEBUG_MEMC_XRAM_RSP 1 // detailed trace of XRAM_RSP FSM 46 #define DEBUG_MEMC_INIT_CMD 0// detailed trace of INIT_CMD FSM47 #define DEBUG_MEMC_INIT_RSP 0// detailed trace of INIT_RSP FSM46 #define DEBUG_MEMC_INIT_CMD 1 // detailed trace of INIT_CMD FSM 47 #define DEBUG_MEMC_INIT_RSP 1 // detailed trace of INIT_RSP FSM 48 48 #define DEBUG_MEMC_TGT_CMD 0 // detailed trace of TGT_CMD FSM 49 49 #define DEBUG_MEMC_TGT_RSP 0 // detailed trace of TGT_RSP FSM … … 113 113 "WRITE_NEXT", 114 114 "WRITE_DIR_LOCK", 115 "WRITE_DIR_ HIT_READ",115 "WRITE_DIR_READ", 116 116 "WRITE_DIR_HIT", 117 117 "WRITE_UPT_LOCK", 118 "WRITE_ HEAP_LOCK",118 "WRITE_UPT_HEAP_LOCK", 119 119 "WRITE_UPT_REQ", 120 "WRITE_UP DATE",120 "WRITE_UPT_NEXT", 121 121 "WRITE_UPT_DEC", 122 122 "WRITE_RSP", 123 "WRITE_TRT_LOCK", 124 "WRITE_TRT_DATA", 125 "WRITE_TRT_SET", 123 "WRITE_MISS_TRT_LOCK", 124 "WRITE_MISS_TRT_DATA", 125 "WRITE_MISS_TRT_SET", 126 "WRITE_MISS_XRAM_REQ", 127 "WRITE_BC_TRT_LOCK", 128 "WRITE_BC_UPT_LOCK", 129 "WRITE_BC_DIR_INVAL", 130 "WRITE_BC_CC_SEND", 131 "WRITE_BC_XRAM_REQ", 126 132 "WRITE_WAIT", 127 "WRITE_XRAM_REQ",128 "WRITE_TRT_WRITE_LOCK",129 "WRITE_INVAL_LOCK",130 "WRITE_DIR_INVAL",131 "WRITE_INVAL",132 "WRITE_XRAM_SEND",133 133 }; 134 134 const char *ixr_rsp_fsm_str[] = { … … 170 170 "SC_DIR_HIT_WRITE", 171 171 "SC_UPT_LOCK", 172 "SC_WAIT", 173 "SC_HEAP_LOCK", 172 "SC_UPT_HEAP_LOCK", 174 173 "SC_UPT_REQ", 175 174 "SC_UPT_NEXT", 176 "SC_ TRT_PUT_LOCK",177 "SC_ INVAL_LOCK",178 "SC_ DIR_INVAL",179 "SC_ INVAL",180 "SC_ TRT_PUT_REQ",175 "SC_BC_TRT_LOCK", 176 "SC_BC_UPT_LOCK", 177 "SC_BC_DIR_INVAL", 178 "SC_BC_CC_SEND", 179 "SC_BC_XRAM_REQ", 181 180 "SC_RSP_FAIL", 182 181 "SC_RSP_SUCCESS", 183 "SC_TRT_GET_LOCK", 184 "SC_TRT_GET_SET", 185 "SC_TRT_GET_REQ", 182 "SC_MISS_TRT_LOCK", 183 "SC_MISS_TRT_SET", 184 "SC_MISS_XRAM_REQ", 185 "SC_WAIT", 186 186 }; 187 187 const char *cleanup_fsm_str[] = { … … 289 289 290 290 // FIFOs 291 291 292 m_cmd_read_addr_fifo("m_cmd_read_addr_fifo", 4), 292 293 m_cmd_read_length_fifo("m_cmd_read_length_fifo", 4), … … 316 317 317 318 r_read_fsm("r_read_fsm"), 319 318 320 r_write_fsm("r_write_fsm"), 321 319 322 m_write_to_init_cmd_inst_fifo("m_write_to_init_cmd_inst_fifo",8), 320 323 m_write_to_init_cmd_srcid_fifo("m_write_to_init_cmd_srcid_fifo",8), … … 322 325 m_write_to_init_cmd_cache_id_fifo("m_write_to_init_cmd_cache_id_fifo",8), 323 326 #endif 327 324 328 r_init_rsp_fsm("r_init_rsp_fsm"), 325 329 r_cleanup_fsm("r_cleanup_fsm"), 330 326 331 r_sc_fsm("r_sc_fsm"), 332 327 333 m_sc_to_init_cmd_inst_fifo("m_sc_to_init_cmd_inst_fifo",8), 328 334 m_sc_to_init_cmd_srcid_fifo("m_sc_to_init_cmd_srcid_fifo",8), … … 330 336 m_sc_to_init_cmd_cache_id_fifo("m_sc_to_init_cmd_cache_id_fifo",8), 331 337 #endif 338 332 339 r_ixr_rsp_fsm("r_ixr_rsp_fsm"), 333 340 r_xram_rsp_fsm("r_xram_rsp_fsm"), 341 334 342 m_xram_rsp_to_init_cmd_inst_fifo("m_xram_rsp_to_init_cmd_inst_fifo",8), 335 343 m_xram_rsp_to_init_cmd_srcid_fifo("m_xram_rsp_to_init_cmd_srcid_fifo",8), … … 337 345 m_xram_rsp_to_init_cmd_cache_id_fifo("m_xram_rsp_to_init_cmd_cache_id_fifo",8), 338 346 #endif 347 339 348 r_ixr_cmd_fsm("r_ixr_cmd_fsm"), 349 340 350 r_tgt_rsp_fsm("r_tgt_rsp_fsm"), 351 341 352 r_init_cmd_fsm("r_init_cmd_fsm"), 353 342 354 r_alloc_dir_fsm("r_alloc_dir_fsm"), 343 355 r_alloc_trt_fsm("r_alloc_trt_fsm"), 344 356 r_alloc_upt_fsm("r_alloc_upt_fsm") 357 345 358 { 346 359 assert(IS_POW_OF_2(nsets)); … … 879 892 ///////////////////////////////////////////////////////////////////////// 880 893 // This FSM controls the response to the update or inval coherence 881 // requests sent by the memory cache to the L1 caches :882 // 894 // requests sent by the memory cache to the L1 caches and update the UPT. 895 // 883 896 // It can be update or inval requests initiated by the WRITE FSM, 884 897 // or inval requests initiated by the XRAM_RSP FSM. 898 // It can also be a direct request from the WRITE FSM. 899 // 885 900 // The FSM decrements the proper entry in UPT. 886 901 // It sends a request to the TGT_RSP FSM to complete the pending … … 912 927 { 913 928 std::cout << "VCI_MEM_CACHE ERROR " << name() 914 << " INIT_RSP_IDLE state" << std::endl ;915 std::cout<< "index too large for UPT: "929 << " INIT_RSP_IDLE state" << std::endl 930 << "index too large for UPT: " 916 931 << " / rtrdid = " << p_vci_ini.rtrdid.read() 917 932 << " / UPT size = " << m_update_tab.size() << std::endl; … … 955 970 if ( not valid ) 956 971 { 957 std::cout << "VCI_MEM_CACHE ERROR " << name() << " INIT_RSP_UPT_LOCK state" << std::endl; 958 std::cout << "unsuccessful access to decrement the UPT" << std::endl; 972 std::cout << "VCI_MEM_CACHE ERROR " << name() 973 << " INIT_RSP_UPT_LOCK state" << std::endl 974 << "unsuccessful access to decrement the UPT" << std::endl; 959 975 exit(0); 960 976 } … … 1511 1527 // If the UPT is full, it releases the lock(s) and retry. Then, it sends 1512 1528 // a multi-update request to all owners of the line (but the writer), 1513 // through the INIT_CMD FSM. In case of multi-update transaction, the WRITE FSM1529 // through the INIT_CMD FSM. In case of coherence transaction, the WRITE FSM 1514 1530 // does not respond to the writing processor, as this response will be sent by 1515 1531 // the INIT_RSP FSM when all update responses have been received. … … 1635 1651 if( entry.is_cnt && entry.count ) 1636 1652 { 1637 r_write_fsm = WRITE_DIR_ HIT_READ;1653 r_write_fsm = WRITE_DIR_READ; 1638 1654 } 1639 1655 else 1640 1656 { 1641 if (r_write_byte.read()) r_write_fsm = WRITE_DIR_ HIT_READ;1657 if (r_write_byte.read()) r_write_fsm = WRITE_DIR_READ; 1642 1658 else r_write_fsm = WRITE_DIR_HIT; 1643 1659 } … … 1645 1661 else // miss 1646 1662 { 1647 r_write_fsm = WRITE_ TRT_LOCK;1663 r_write_fsm = WRITE_MISS_TRT_LOCK; 1648 1664 } 1649 1665 … … 1652 1668 { 1653 1669 std::cout << " <MEMC.WRITE_DIR_LOCK> Check the directory: " 1654 << " address = " << r_write_address.read()1670 << " address = " << std::hex << r_write_address.read() 1655 1671 << " hit = " << entry.valid 1656 1672 << " count = " << std::dec << entry.count … … 1661 1677 break; 1662 1678 } 1663 //////////////////// ////1664 case WRITE_DIR_ HIT_READ: // read the cache and complete the buffer when be!=0xF1679 //////////////////// 1680 case WRITE_DIR_READ: // read the cache and complete the buffer when be!=0xF 1665 1681 { 1666 1682 // update local buffer … … 1684 1700 1685 1701 // test if a coherence broadcast is required 1686 if( r_write_is_cnt.read() && r_write_count.read() ) r_write_fsm = WRITE_ TRT_WRITE_LOCK;1687 else r_write_fsm = WRITE_DIR_HIT;1702 if( r_write_is_cnt.read() && r_write_count.read() ) r_write_fsm = WRITE_BC_TRT_LOCK; 1703 else r_write_fsm = WRITE_DIR_HIT; 1688 1704 1689 1705 #if DEBUG_MEMC_WRITE … … 1692 1708 if( r_write_is_cnt.read() && r_write_count.read() ) 1693 1709 { 1694 std::cout << " <MEMC.WRITE_DIR_ HIT_READ> Read the cache to complete local buffer /"1710 std::cout << " <MEMC.WRITE_DIR_READ> Read the cache to complete local buffer /" 1695 1711 << " coherence broadcast required" << std::endl; 1696 1712 } 1697 1713 else 1698 1714 { 1699 std::cout << " <MEMC.WRITE_DIR_ HIT_READ> Read the cache to complete local buffer"1715 std::cout << " <MEMC.WRITE_DIR_READ> Read the cache to complete local buffer" 1700 1716 << std::endl; 1701 1717 } … … 1705 1721 } 1706 1722 /////////////////// 1707 case WRITE_DIR_HIT: // update the cache (data & directory)1723 case WRITE_DIR_HIT: // update the cache directory 1708 1724 { 1709 1725 // update directory with Dirty bit … … 1727 1743 m_cache_directory.write(set, way, entry); 1728 1744 1729 // owner is true when the writer is the owner1745 // owner is true when the the first registered copy is the writer itself 1730 1746 bool owner = (((r_write_copy.read() == r_write_srcid.read()) 1731 1747 #if L1_MULTI_CACHE … … 1737 1753 bool no_update = (r_write_count.read()==0) || ( owner && (r_write_count.read()==1)); 1738 1754 1739 // write data in the cache if no transaction on the coherence network1755 // write data in the cache if no coherence transaction 1740 1756 if( no_update ) 1741 1757 { … … 1747 1763 1748 1764 if ( owner ) r_write_count = r_write_count.read() - 1; 1749 r_write_to_dec = false;1750 1765 1751 1766 if ( no_update ) // Write transaction completed … … 1757 1772 if( !r_write_to_init_cmd_multi_req.read() && 1758 1773 !r_write_to_init_cmd_brdcast_req.read() ) r_write_fsm = WRITE_UPT_LOCK; 1759 else r_write_fsm = WRITE_WAIT;1774 else r_write_fsm = WRITE_WAIT; 1760 1775 } 1761 1776 … … 1779 1794 break; 1780 1795 } 1781 //////////////////// /1796 //////////////////// 1782 1797 case WRITE_UPT_LOCK: // Try to register the update request in UPT 1783 1798 { … … 1818 1833 std::cout << " <MEMC.WRITE_UPT_LOCK> Register the multicast update in UPT / " 1819 1834 << " nb_copies = " << r_write_count.read() << std::endl; 1820 //m_update_tab.print();1821 1835 } 1822 1836 } 1823 1837 #endif 1824 1838 r_write_upt_index = index; 1825 // releases the lock protecting the Update Table and the Directoryif no entry...1826 if ( wok ) r_write_fsm = WRITE_ HEAP_LOCK;1839 // releases the lock protecting UPT and the DIR if no entry... 1840 if ( wok ) r_write_fsm = WRITE_UPT_HEAP_LOCK; 1827 1841 else r_write_fsm = WRITE_WAIT; 1828 1842 } … … 1830 1844 } 1831 1845 ///////////////////// 1832 case WRITE_ HEAP_LOCK:1846 case WRITE_UPT_HEAP_LOCK: // get access to heap 1833 1847 { 1834 1848 if( r_alloc_heap_fsm.read() == ALLOC_HEAP_WRITE ) … … 1838 1852 if( m_debug_write_fsm ) 1839 1853 { 1840 std::cout << " <MEMC.WRITE_ HEAP_LOCK> Get acces to the HEAP" << std::endl;1854 std::cout << " <MEMC.WRITE_UPT_HEAP_LOCK> Get acces to the HEAP" << std::endl; 1841 1855 } 1842 1856 #endif … … 1846 1860 } 1847 1861 ////////////////// 1848 case WRITE_UPT_REQ: 1849 { 1850 if ( r_alloc_heap_fsm.read() != ALLOC_HEAP_WRITE ) 1851 { 1852 std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_UPT_REQ state" << std::endl; 1853 std::cout << "bad HEAP allocation" << std::endl; 1854 exit(0); 1855 } 1856 1862 case WRITE_UPT_REQ: // prepare the request to INIT_CMD FSM 1863 // and write the first srcid in the FIFO 1864 // send the request if only one copy 1865 { 1857 1866 if( !r_write_to_init_cmd_multi_req.read() && 1858 !r_write_to_init_cmd_brdcast_req.read() ) 1867 !r_write_to_init_cmd_brdcast_req.read() ) // no pending coherence request 1859 1868 { 1860 1869 r_write_to_init_cmd_brdcast_req = false; … … 1864 1873 r_write_to_init_cmd_count = r_write_word_count.read(); 1865 1874 1866 for(size_t i=0; i<m_words ; i++) 1867 { 1868 r_write_to_init_cmd_be[i]=r_write_be[i].read(); 1869 } 1875 for(size_t i=0; i<m_words ; i++) r_write_to_init_cmd_be[i]=r_write_be[i].read(); 1870 1876 1871 1877 size_t min = r_write_word_index.read(); 1872 1878 size_t max = r_write_word_index.read() + r_write_word_count.read(); 1873 for (size_t i=min ; i<max ; i++) 1879 for (size_t i=min ; i<max ; i++) r_write_to_init_cmd_data[i] = r_write_data[i]; 1874 1880 1875 1881 if( (r_write_copy.read() != r_write_srcid.read()) or … … 1879 1885 r_write_copy_inst.read() ) 1880 1886 { 1881 // We put the first copyin the fifo1887 // put the first srcid in the fifo 1882 1888 write_to_init_cmd_fifo_put = true; 1883 1889 write_to_init_cmd_fifo_inst = r_write_copy_inst.read(); … … 1893 1899 else 1894 1900 { 1895 r_write_fsm = WRITE_UPDATE; 1901 r_write_fsm = WRITE_UPT_NEXT; 1902 r_write_to_dec = false; 1903 1896 1904 } 1897 1905 } 1898 1906 else 1899 1907 { 1900 r_write_fsm = WRITE_UPDATE; 1901 } 1902 } 1903 break; 1904 } 1905 ////////////////// 1906 case WRITE_UPDATE: // send a multi-update request to INIT_CMD fsm 1907 { 1908 if ( r_alloc_heap_fsm.read() != ALLOC_HEAP_WRITE ) 1909 { 1910 std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_UPDATE state" << std::endl; 1911 std::cout << "bad HEAP allocation" << std::endl; 1912 exit(0); 1913 } 1914 1908 r_write_fsm = WRITE_UPT_NEXT; 1909 r_write_to_dec = false; 1910 } 1911 } 1912 break; 1913 } 1914 /////////////////// 1915 case WRITE_UPT_NEXT: // continue the multi-update request to INIT_CMD fsm 1916 // when there is copies in the heap. 1917 // if one copy in the heap is the writer itself 1918 // the corresponding SRCID should not be written in the fifo, 1919 // but the UPT counter must be decremented. 1920 // As this decrement is done in the WRITE_UPT_DEC state, 1921 // after the last copy has been found, the decrement request 1922 // must be registered in the r_write_to_dec flip-flop. 1923 { 1915 1924 HeapEntry entry = m_heap.read(r_write_ptr.read()); 1916 write_to_init_cmd_fifo_inst = entry.owner.inst;1917 write_to_init_cmd_fifo_srcid = entry.owner.srcid;1918 #if L1_MULTI_CACHE1919 write_to_init_cmd_fifo_cache_id = entry.owner.cache_id;1920 #endif1921 1925 1922 bool dec_upt_counter = r_write_to_dec.read(); 1926 bool dec_upt_counter; // = r_write_to_dec.read(); 1927 1923 1928 if( (entry.owner.srcid != r_write_srcid.read()) or 1924 1929 #if L1_MULTI_CACHE 1925 1930 (entry.owner.cache_id != r_write_pktid.read()) or 1926 1931 #endif 1927 entry.owner.inst) 1928 { 1929 write_to_init_cmd_fifo_put = true; 1932 entry.owner.inst) // put te next srcid in the fifo 1933 { 1934 dec_upt_counter = false; 1935 write_to_init_cmd_fifo_put = true; 1936 write_to_init_cmd_fifo_inst = entry.owner.inst; 1937 write_to_init_cmd_fifo_srcid = entry.owner.srcid; 1938 #if L1_MULTI_CACHE 1939 write_to_init_cmd_fifo_cache_id = entry.owner.cache_id; 1940 #endif 1930 1941 } 1931 else 1942 else // the UPT counter must be decremented 1932 1943 { 1933 1944 dec_upt_counter = true; 1934 1945 } 1935 r_write_to_dec = dec_upt_counter; 1936 1937 if( m_write_to_init_cmd_inst_fifo.wok() ) 1938 { 1939 r_write_ptr = entry.next; 1940 if( entry.next == r_write_ptr.read() ) // last copy 1941 { 1942 r_write_to_init_cmd_multi_req = true; 1943 if(dec_upt_counter) r_write_fsm = WRITE_UPT_DEC; 1944 else r_write_fsm = WRITE_IDLE; 1945 } 1946 else 1947 { 1948 r_write_fsm = WRITE_UPDATE; 1949 } 1946 1947 // register the possible UPT decrement request 1948 r_write_to_dec = dec_upt_counter or r_write_to_dec.read(); 1949 1950 if( not m_write_to_init_cmd_inst_fifo.wok() ) 1951 { 1952 std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_UPT_NEXT state" << std::endl 1953 << "The write_to_cmd_write_fifo should not be full" << std::endl 1954 << "as the depth should be larger than the max number of copies" << std::endl; 1955 exit(0); 1956 } 1957 1958 r_write_ptr = entry.next; 1959 1960 if( entry.next == r_write_ptr.read() ) // last copy 1961 { 1962 r_write_to_init_cmd_multi_req = true; 1963 if( r_write_to_dec.read() or dec_upt_counter) r_write_fsm = WRITE_UPT_DEC; 1964 else r_write_fsm = WRITE_IDLE; 1950 1965 } 1951 else1952 {1953 r_write_fsm = WRITE_UPDATE;1954 }1955 1966 break; 1956 1967 } 1957 1968 ////////////////// 1958 case WRITE_UPT_DEC: // Post another coherence update request 1969 case WRITE_UPT_DEC: // If the initial writer has a copy, it should not 1970 // receive an update request, but the counter in the 1971 // update table must be decremented by the INIT_RSP FSM. 1959 1972 { 1960 1973 if ( !r_write_to_init_rsp_req.read() ) … … 1983 1996 r_write_to_tgt_rsp_trdid = r_write_trdid.read(); 1984 1997 r_write_to_tgt_rsp_pktid = r_write_pktid.read(); 1985 r_write_fsm 1986 } 1987 break; 1988 } 1989 //////////////////// 1990 case WRITE_ TRT_LOCK: // Miss : check Transaction Table1998 r_write_fsm = WRITE_IDLE; 1999 } 2000 break; 2001 } 2002 ///////////////////////// 2003 case WRITE_MISS_TRT_LOCK: // Miss : check Transaction Table 1991 2004 { 1992 2005 if ( r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE ) … … 1996 2009 if( m_debug_write_fsm ) 1997 2010 { 1998 std::cout << " <MEMC.WRITE_ TRT_LOCK> Check the TRT" << std::endl;2011 std::cout << " <MEMC.WRITE_MISS_TRT_LOCK> Check the TRT" << std::endl; 1999 2012 } 2000 2013 #endif … … 2009 2022 { 2010 2023 r_write_trt_index = hit_index; 2011 r_write_fsm = WRITE_ TRT_DATA;2024 r_write_fsm = WRITE_MISS_TRT_DATA; 2012 2025 m_cpt_write_miss++; 2013 2026 } … … 2015 2028 { 2016 2029 r_write_trt_index = wok_index; 2017 r_write_fsm = WRITE_ TRT_SET;2030 r_write_fsm = WRITE_MISS_TRT_SET; 2018 2031 m_cpt_write_miss++; 2019 2032 } … … 2039 2052 break; 2040 2053 } 2041 /////////////////// 2042 case WRITE_ TRT_SET: // register a new transaction in TRT (Write Buffer)2054 //////////////////////// 2055 case WRITE_MISS_TRT_SET: // register a new transaction in TRT (Write Buffer) 2043 2056 { 2044 2057 if ( r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE ) … … 2064 2077 be_vector, 2065 2078 data_vector); 2066 r_write_fsm = WRITE_ XRAM_REQ;2079 r_write_fsm = WRITE_MISS_XRAM_REQ; 2067 2080 2068 2081 #if DEBUG_MEMC_WRITE 2069 2082 if( m_debug_write_fsm ) 2070 2083 { 2071 std::cout << " <MEMC.WRITE_ TRT_SET> Set a new entry in TRT" << std::endl;2084 std::cout << " <MEMC.WRITE_MISS_TRT_SET> Set a new entry in TRT" << std::endl; 2072 2085 } 2073 2086 #endif … … 2075 2088 break; 2076 2089 } 2077 //////////////////// 2078 case WRITE_ TRT_DATA: // update an entry in TRT (Write Buffer)2090 ///////////////////////// 2091 case WRITE_MISS_TRT_DATA: // update an entry in TRT (used as a Write Buffer) 2079 2092 { 2080 2093 if ( r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE ) … … 2097 2110 if( m_debug_write_fsm ) 2098 2111 { 2099 std::cout << " <MEMC.WRITE_ TRT_DATA> Modify an existing entry in TRT" << std::endl;2112 std::cout << " <MEMC.WRITE_MISS_TRT_DATA> Modify an existing entry in TRT" << std::endl; 2100 2113 m_transaction_tab.print( r_write_trt_index.read() ); 2101 2114 } … … 2104 2117 break; 2105 2118 } 2106 //////////////////// 2107 case WRITE_ XRAM_REQ: // send arequest to IXR_CMD FSM2119 ///////////////////////// 2120 case WRITE_MISS_XRAM_REQ: // send a GET request to IXR_CMD FSM 2108 2121 { 2109 2122 if ( !r_write_to_ixr_cmd_req ) … … 2118 2131 if( m_debug_write_fsm ) 2119 2132 { 2120 std::cout << " <MEMC.WRITE_ XRAM_REQ> Post arequest to the IXR_CMD FSM" << std::endl;2121 } 2122 #endif 2123 } 2124 break; 2125 } 2126 /////////////////////// ///2127 case WRITE_ TRT_WRITE_LOCK:// Check TRT not full2133 std::cout << " <MEMC.WRITE_MISS_XRAM_REQ> Post a GET request to the IXR_CMD FSM" << std::endl; 2134 } 2135 #endif 2136 } 2137 break; 2138 } 2139 /////////////////////// 2140 case WRITE_BC_TRT_LOCK: // Check TRT not full 2128 2141 { 2129 2142 if ( r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE ) … … 2134 2147 { 2135 2148 r_write_trt_index = wok_index; 2136 r_write_fsm = WRITE_ INVAL_LOCK;2149 r_write_fsm = WRITE_BC_UPT_LOCK; 2137 2150 } 2138 2151 else // wait an empty entry in TRT … … 2144 2157 if( m_debug_write_fsm ) 2145 2158 { 2146 std::cout << " <MEMC.WRITE_ TRT_WRITE_LOCK> Check TRT : wok = "2147 << wok << " index = " << wok_index << std::endl;2159 std::cout << " <MEMC.WRITE_BC_TRT_LOCK> Check TRT : wok = " 2160 << wok << " / index = " << wok_index << std::endl; 2148 2161 } 2149 2162 #endif … … 2152 2165 } 2153 2166 ////////////////////// 2154 case WRITE_ INVAL_LOCK:2167 case WRITE_BC_UPT_LOCK: // register BC transaction in UPT 2155 2168 { 2156 2169 if ( r_alloc_upt_fsm.read() == ALLOC_UPT_WRITE ) … … 2179 2192 if ( wok ) 2180 2193 { 2181 std::cout << " <MEMC.WRITE_ INVAL_LOCK> Register the broadcast inval in UPT / "2194 std::cout << " <MEMC.WRITE_BC_UPT_LOCK> Register the broadcast inval in UPT / " 2182 2195 << " nb_copies = " << r_write_count.read() << std::endl; 2183 //m_update_tab.print();2184 2196 } 2185 2197 } … … 2187 2199 r_write_upt_index = index; 2188 2200 2189 if ( wok ) r_write_fsm = WRITE_ DIR_INVAL;2201 if ( wok ) r_write_fsm = WRITE_BC_DIR_INVAL; 2190 2202 else r_write_fsm = WRITE_WAIT; 2191 2203 } 2192 2204 break; 2193 2205 } 2194 ///////////////////// 2195 case WRITE_ DIR_INVAL: // Register a put transaction to XRAM in TRT2206 //////////////////////// 2207 case WRITE_BC_DIR_INVAL: // Register a put transaction to XRAM in TRT 2196 2208 // and invalidate the line in directory 2197 2209 { … … 2200 2212 (r_alloc_dir_fsm.read() != ALLOC_DIR_WRITE ) ) 2201 2213 { 2202 std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_ DIR_INVAL state" << std::endl;2214 std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_BC_DIR_INVAL state" << std::endl; 2203 2215 std::cout << "bad TRT, DIR, or UPT allocation" << std::endl; 2204 2216 exit(0); … … 2239 2251 if( m_debug_write_fsm ) 2240 2252 { 2241 std::cout << " <MEMC.WRITE_ DIR_INVAL> Invalidate the directory entry: @ = "2253 std::cout << " <MEMC.WRITE_BC_DIR_INVAL> Invalidate the directory entry: @ = " 2242 2254 << r_write_address.read() << " / register the put transaction in TRT:" << std::endl; 2243 2255 } 2244 2256 #endif 2245 r_write_fsm = WRITE_ INVAL;2246 break; 2247 } 2248 ///////////////// 2249 case WRITE_ INVAL: // Post a coherence broadcast request to INIT_CMD FSM2257 r_write_fsm = WRITE_BC_CC_SEND; 2258 break; 2259 } 2260 ////////////////////// 2261 case WRITE_BC_CC_SEND: // Post a coherence broadcast request to INIT_CMD FSM 2250 2262 { 2251 2263 if ( !r_write_to_init_cmd_multi_req.read() && !r_write_to_init_cmd_brdcast_req.read() ) … … 2263 2275 r_write_to_init_cmd_data[i] = 0; 2264 2276 } 2265 r_write_fsm = WRITE_ XRAM_SEND;2277 r_write_fsm = WRITE_BC_XRAM_REQ; 2266 2278 2267 2279 #if DEBUG_MEMC_WRITE 2268 2280 if( m_debug_write_fsm ) 2269 2281 { 2270 std::cout << " <MEMC.WRITE_ INVAL> Post a broadcast request to INIT_CMD FSM" << std::endl;2271 } 2272 #endif 2273 } 2274 break; 2275 } 2276 ///////////////////// 2277 case WRITE_ XRAM_SEND: // Post a put request to IXR_CMD FSM2282 std::cout << " <MEMC.WRITE_BC_CC_SEND> Post a broadcast request to INIT_CMD FSM" << std::endl; 2283 } 2284 #endif 2285 } 2286 break; 2287 } 2288 /////////////////////// 2289 case WRITE_BC_XRAM_REQ: // Post a put request to IXR_CMD FSM 2278 2290 { 2279 2291 if ( !r_write_to_ixr_cmd_req ) … … 2291 2303 if( m_debug_write_fsm ) 2292 2304 { 2293 std::cout << " <MEMC.WRITE_ XRAM_SEND> Post a put request to IXR_CMD FSM" << std::endl;2305 std::cout << " <MEMC.WRITE_BC_XRAM_REQ> Post a put request to IXR_CMD FSM" << std::endl; 2294 2306 } 2295 2307 #endif … … 2303 2315 /////////////////////////////////////////////////////////////////////// 2304 2316 // The IXR_CMD fsm controls the command packets to the XRAM : 2305 // - It sends a single cell VCI getrequest to the XRAM in case of MISS2317 // - It sends a single cell VCI read request to the XRAM in case of MISS 2306 2318 // posted by the READ, WRITE or SC FSMs : the TRDID field contains 2307 2319 // the Transaction Tab index. … … 2345 2357 else if ( r_xram_rsp_to_ixr_cmd_req ) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA; 2346 2358 break; 2347 ///////////////////////// 2359 ///////////////////////// // send a get request to XRAM 2348 2360 case IXR_CMD_READ_NLINE: 2349 2361 if ( p_vci_ixr.cmdack ) … … 2355 2367 if( m_debug_ixr_cmd_fsm ) 2356 2368 { 2357 std::cout << " <MEMC.IXR_CMD_READ_NLINE> Send a get request to xram" ;2369 std::cout << " <MEMC.IXR_CMD_READ_NLINE> Send a get request to xram" << std::endl; 2358 2370 } 2359 2371 #endif … … 2361 2373 break; 2362 2374 ////////////////////////// 2363 case IXR_CMD_WRITE_NLINE: 2375 case IXR_CMD_WRITE_NLINE: // send a put or get command to XRAM 2364 2376 if ( p_vci_ixr.cmdack ) 2365 2377 { … … 2380 2392 if( m_debug_ixr_cmd_fsm ) 2381 2393 { 2382 std::cout << " <MEMC.IXR_CMD_WRITE_NLINE> Send a put request to xram" ;2394 std::cout << " <MEMC.IXR_CMD_WRITE_NLINE> Send a put request to xram" << std::endl; 2383 2395 } 2384 2396 #endif … … 2392 2404 if( m_debug_ixr_cmd_fsm ) 2393 2405 { 2394 std::cout << " <MEMC.IXR_CMD_WRITE_NLINE> Send a get request to xram" ;2406 std::cout << " <MEMC.IXR_CMD_WRITE_NLINE> Send a get request to xram" << std::endl; 2395 2407 } 2396 2408 #endif … … 2399 2411 break; 2400 2412 ////////////////////// 2401 case IXR_CMD_SC_NLINE: 2413 case IXR_CMD_SC_NLINE: // send a put or get command to XRAM 2402 2414 if ( p_vci_ixr.cmdack ) 2403 2415 { … … 2418 2430 if( m_debug_ixr_cmd_fsm ) 2419 2431 { 2420 std::cout << " <MEMC.IXR_CMD_SC_NLINE> Send a put request to xram" ;2432 std::cout << " <MEMC.IXR_CMD_SC_NLINE> Send a put request to xram" << std::endl; 2421 2433 } 2422 2434 #endif … … 2430 2442 if( m_debug_ixr_cmd_fsm ) 2431 2443 { 2432 std::cout << " <MEMC.IXR_CMD_SC_NLINE> Send a get request to xram" ;2444 std::cout << " <MEMC.IXR_CMD_SC_NLINE> Send a get request to xram" << std::endl; 2433 2445 } 2434 2446 #endif … … 2437 2449 break; 2438 2450 //////////////////////// 2439 case IXR_CMD_XRAM_DATA: 2451 case IXR_CMD_XRAM_DATA: // send a put command to XRAM 2440 2452 if ( p_vci_ixr.cmdack ) 2441 2453 { … … 2454 2466 if( m_debug_ixr_cmd_fsm ) 2455 2467 { 2456 std::cout << " <MEMC.IXR_CMD_XRAM_DATA> Send a put request to xram" ;2468 std::cout << " <MEMC.IXR_CMD_XRAM_DATA> Send a put request to xram" << std::endl; 2457 2469 } 2458 2470 #endif … … 2483 2495 switch ( r_ixr_rsp_fsm.read() ) 2484 2496 { 2485 ////////////////// /2497 ////////////////// 2486 2498 case IXR_RSP_IDLE: // test if it's a get or a put transaction 2487 2499 { … … 3751 3763 3752 3764 if ( entry.valid ) r_sc_fsm = SC_DIR_HIT_READ; 3753 else r_sc_fsm = SC_TRT_GET_LOCK;3765 else r_sc_fsm = SC_MISS_TRT_LOCK; 3754 3766 3755 3767 #if DEBUG_MEMC_SC … … 3820 3832 break; 3821 3833 } 3822 ///// 3834 ////////////////////// 3823 3835 case SC_DIR_HIT_WRITE: // write data in the cache 3824 3836 // and test if a coherence request is required … … 3838 3850 if ( r_sc_is_cnt.read() ) 3839 3851 { 3840 r_sc_fsm = SC_ TRT_PUT_LOCK; // broadcast invalidate required3852 r_sc_fsm = SC_BC_TRT_LOCK; // broadcast invalidate required 3841 3853 } 3842 3854 else if( !r_sc_to_init_cmd_multi_req.read() && … … 3893 3905 { 3894 3906 r_sc_upt_index = index; 3895 r_sc_fsm = SC_ HEAP_LOCK;3907 r_sc_fsm = SC_UPT_HEAP_LOCK; 3896 3908 } 3897 3909 else // releases the locks protecting UPT and DIR if no entry … … 3926 3938 } 3927 3939 ////////////////// 3928 case SC_ HEAP_LOCK: // lock the heap3940 case SC_UPT_HEAP_LOCK: // lock the heap 3929 3941 { 3930 3942 if( r_alloc_heap_fsm.read() == ALLOC_HEAP_SC ) … … 3934 3946 if( m_debug_sc_fsm ) 3935 3947 { 3936 std::cout << " <MEMC.SC_ HEAP_LOCK> Get access to the heap" << std::endl;3948 std::cout << " <MEMC.SC_UPT_HEAP_LOCK> Get access to the heap" << std::endl; 3937 3949 } 3938 3950 #endif … … 4039 4051 } 4040 4052 ///////////////////// 4041 case SC_ TRT_PUT_LOCK: // check the TRT to register a PUT transaction4053 case SC_BC_TRT_LOCK: // check the TRT to register a PUT transaction 4042 4054 { 4043 4055 if( r_alloc_trt_fsm.read() == ALLOC_TRT_SC ) … … 4069 4081 { 4070 4082 r_sc_trt_index = wok_index; 4071 r_sc_fsm = SC_ INVAL_LOCK;4083 r_sc_fsm = SC_BC_UPT_LOCK; 4072 4084 } 4073 4085 else … … 4084 4096 } 4085 4097 /////////////////// 4086 case SC_ INVAL_LOCK: // Register a broadcast inval transaction in UPT4098 case SC_BC_UPT_LOCK: // Register a broadcast inval transaction in UPT 4087 4099 { 4088 4100 if ( r_alloc_upt_fsm.read() == ALLOC_UPT_SC ) … … 4110 4122 { 4111 4123 r_sc_upt_index = index; 4112 r_sc_fsm = SC_ DIR_INVAL;4124 r_sc_fsm = SC_BC_DIR_INVAL; 4113 4125 #if DEBUG_MEMC_SC 4114 4126 if( m_debug_sc_fsm ) 4115 4127 { 4116 std::cout << " <MEMC.SC_ INVAL_LOCK> Register a broadcast inval transaction in UPT"4128 std::cout << " <MEMC.SC_BC_UPT_LOCK> Register a broadcast inval transaction in UPT" 4117 4129 << " / nline = " << nline 4118 4130 << " / count = " << nb_copies … … 4129 4141 } 4130 4142 ////////////////// 4131 case SC_ DIR_INVAL: // Register the PUT transaction in TRT, and inval the DIR entry4143 case SC_BC_DIR_INVAL: // Register the PUT transaction in TRT, and inval the DIR entry 4132 4144 { 4133 4145 if ( (r_alloc_trt_fsm.read() == ALLOC_TRT_SC ) && … … 4166 4178 m_cache_directory.write(set, way, entry); 4167 4179 4168 r_sc_fsm = SC_ INVAL;4180 r_sc_fsm = SC_BC_CC_SEND; 4169 4181 4170 4182 #if DEBUG_MEMC_SC 4171 4183 if( m_debug_sc_fsm ) 4172 4184 { 4173 std::cout << " <MEMC.SC_ DIR_INVAL> Register the PUT in TRT and invalidate DIR entry"4185 std::cout << " <MEMC.SC_BC_DIR_INVAL> Register the PUT in TRT and invalidate DIR entry" 4174 4186 << " / nline = " << std::hex << m_nline[(vci_addr_t)(m_cmd_sc_addr_fifo.read())] 4175 4187 << " / set = " << std::dec << set << " / way = " << way << std::endl; … … 4179 4191 else 4180 4192 { 4181 assert(false and "LOCK ERROR in SC_FSM, STATE = SC_ DIR_INVAL");4182 } 4183 break; 4184 } 4185 ////////////// 4186 case SC_ INVAL: // Request the broadcast inval to INIT_CMD FSM4193 assert(false and "LOCK ERROR in SC_FSM, STATE = SC_BC_DIR_INVAL"); 4194 } 4195 break; 4196 } 4197 /////////////////// 4198 case SC_BC_CC_SEND: // Request the broadcast inval to INIT_CMD FSM 4187 4199 { 4188 4200 if ( !r_sc_to_init_cmd_multi_req.read() && … … 4196 4208 r_sc_to_init_cmd_wdata = 0; 4197 4209 4198 r_sc_fsm = SC_ TRT_PUT_REQ;4210 r_sc_fsm = SC_BC_XRAM_REQ; 4199 4211 } 4200 4212 break; 4201 4213 } 4202 4214 //////////////////// 4203 case SC_ TRT_PUT_REQ: // request the IXR FSM to start a put transaction4215 case SC_BC_XRAM_REQ: // request the IXR FSM to start a put transaction 4204 4216 { 4205 4217 if ( !r_sc_to_ixr_cmd_req ) … … 4216 4228 if( m_debug_sc_fsm ) 4217 4229 { 4218 std::cout << " <MEMC.SC_ TRT_PUT_REQ> Request a PUT transaction to IXR_CMD FSM" << std::hex4230 std::cout << " <MEMC.SC_BC_XRAM_REQ> Request a PUT transaction to IXR_CMD FSM" << std::hex 4219 4231 << " / nline = " << m_nline[(vci_addr_t)m_cmd_sc_addr_fifo.read()] 4220 4232 << " / trt_index = " << r_sc_trt_index.read() << std::endl; … … 4224 4236 else 4225 4237 { 4226 std::cout << "MEM_CACHE, SC_ TRT_PUT_REQ state : request should not have been previously set"4238 std::cout << "MEM_CACHE, SC_BC_XRAM_REQ state : request should not have been previously set" 4227 4239 << std::endl; 4228 4240 } … … 4276 4288 } 4277 4289 ///////////////////// 4278 case SC_ TRT_GET_LOCK: // cache miss : request access to transaction Table4290 case SC_MISS_TRT_LOCK: // cache miss : request access to transaction Table 4279 4291 { 4280 4292 if( r_alloc_trt_fsm.read() == ALLOC_TRT_SC ) … … 4290 4302 if( m_debug_sc_fsm ) 4291 4303 { 4292 std::cout << " <MEMC.SC_ TRT_GET_LOCK> Check TRT state"4304 std::cout << " <MEMC.SC_MISS_TRT_LOCK> Check TRT state" 4293 4305 << " / hit_read = " << hit_read 4294 4306 << " / hit_write = " << hit_write … … 4305 4317 { 4306 4318 r_sc_trt_index = index; 4307 r_sc_fsm = SC_ TRT_GET_SET;4319 r_sc_fsm = SC_MISS_TRT_SET; 4308 4320 } 4309 4321 } … … 4311 4323 } 4312 4324 //////////////////// 4313 case SC_ TRT_GET_SET: // register the GET transaction in TRT4325 case SC_MISS_TRT_SET: // register the GET transaction in TRT 4314 4326 { 4315 4327 if( r_alloc_trt_fsm.read() == ALLOC_TRT_SC ) … … 4336 4348 be_vector, 4337 4349 data_vector); 4338 r_sc_fsm = SC_ TRT_GET_REQ;4350 r_sc_fsm = SC_MISS_XRAM_REQ; 4339 4351 4340 4352 #if DEBUG_MEMC_SC 4341 4353 if( m_debug_sc_fsm ) 4342 4354 { 4343 std::cout << " <MEMC.SC_ TRT_GET_SET> Register a GET transaction in TRT" << std::hex4355 std::cout << " <MEMC.SC_MISS_TRT_SET> Register a GET transaction in TRT" << std::hex 4344 4356 << " / nline = " << m_nline[(vci_addr_t)m_cmd_sc_addr_fifo.read()] 4345 4357 << " / trt_index = " << r_sc_trt_index.read() << std::endl; … … 4349 4361 break; 4350 4362 } 4351 //////////////////// 4352 case SC_ TRT_GET_REQ: // request the IXR_CMD FSM to fetch the missing line4363 ////////////////////// 4364 case SC_MISS_XRAM_REQ: // request the IXR_CMD FSM to fetch the missing line 4353 4365 { 4354 4366 if ( !r_sc_to_ixr_cmd_req ) … … 4363 4375 if( m_debug_sc_fsm ) 4364 4376 { 4365 std::cout << " <MEMC.SC_ TRT_GET_REQ> Request a GET transaction to IXR_CMD FSM" << std::hex4377 std::cout << " <MEMC.SC_MISS_XRAM_REQ> Request a GET transaction to IXR_CMD FSM" << std::hex 4366 4378 << " / nline = " << m_nline[(vci_addr_t)m_cmd_sc_addr_fifo.read()] 4367 4379 << " / trt_index = " << r_sc_trt_index.read() << std::endl; … … 4377 4389 // INIT_CMD FSM 4378 4390 ////////////////////////////////////////////////////////////////////////////// 4379 // The INIT_CMD fsm controls the VCI CMD initiator port , used to update4380 // or invalidate cache lines in L1 caches.4391 // The INIT_CMD fsm controls the VCI CMD initiator port on the coherence 4392 // network, used to update or invalidate cache lines in L1 caches. 4381 4393 // 4382 4394 // It implements a round-robin priority between the three possible client FSMs … … 4959 4971 { 4960 4972 if ((r_write_fsm.read() == WRITE_UPT_LOCK) || 4961 (r_write_fsm.read() == WRITE_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE;4973 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE; 4962 4974 else if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 4963 4975 else if (r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; 4964 4976 else if ((r_sc_fsm.read() == SC_UPT_LOCK) || 4965 (r_sc_fsm.read() == SC_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC;4977 (r_sc_fsm.read() == SC_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC; 4966 4978 } 4967 4979 break; … … 4970 4982 case ALLOC_UPT_WRITE: 4971 4983 if ( (r_write_fsm.read() != WRITE_UPT_LOCK) && 4972 (r_write_fsm.read() != WRITE_ INVAL_LOCK))4984 (r_write_fsm.read() != WRITE_BC_UPT_LOCK)) 4973 4985 { 4974 4986 if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 4975 4987 else if (r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; 4976 4988 else if ((r_sc_fsm.read() == SC_UPT_LOCK) || 4977 (r_sc_fsm.read() == SC_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC;4989 (r_sc_fsm.read() == SC_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC; 4978 4990 else if (r_init_rsp_fsm.read() == INIT_RSP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_INIT_RSP; 4979 4991 } … … 4986 4998 if (r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; 4987 4999 else if ((r_sc_fsm.read() == SC_UPT_LOCK) || 4988 (r_sc_fsm.read() == SC_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC;5000 (r_sc_fsm.read() == SC_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC; 4989 5001 else if (r_init_rsp_fsm.read() == INIT_RSP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_INIT_RSP; 4990 5002 else if ((r_write_fsm.read() == WRITE_UPT_LOCK) || 4991 (r_write_fsm.read() == WRITE_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE;5003 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE; 4992 5004 } 4993 5005 break; … … 4998 5010 { 4999 5011 if ((r_sc_fsm.read() == SC_UPT_LOCK) || 5000 (r_sc_fsm.read() == SC_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC;5012 (r_sc_fsm.read() == SC_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_SC; 5001 5013 else if (r_init_rsp_fsm.read() == INIT_RSP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_INIT_RSP; 5002 5014 else if ((r_write_fsm.read() == WRITE_UPT_LOCK) || 5003 (r_write_fsm.read() == WRITE_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE;5015 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE; 5004 5016 else if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 5005 5017 } … … 5009 5021 case ALLOC_UPT_SC: 5010 5022 if( (r_sc_fsm.read() != SC_UPT_LOCK) && 5011 (r_sc_fsm.read() != SC_ INVAL_LOCK))5023 (r_sc_fsm.read() != SC_BC_UPT_LOCK)) 5012 5024 { 5013 5025 if (r_init_rsp_fsm.read() == INIT_RSP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_INIT_RSP; 5014 5026 else if ((r_write_fsm.read() == WRITE_UPT_LOCK) || 5015 (r_write_fsm.read() == WRITE_ INVAL_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE;5027 (r_write_fsm.read() == WRITE_BC_UPT_LOCK)) r_alloc_upt_fsm = ALLOC_UPT_WRITE; 5016 5028 else if (r_xram_rsp_fsm.read() == XRAM_RSP_INVAL_LOCK) r_alloc_upt_fsm = ALLOC_UPT_XRAM_RSP; 5017 5029 else if (r_cleanup_fsm.read() == CLEANUP_UPT_LOCK) r_alloc_upt_fsm = ALLOC_UPT_CLEANUP; … … 5054 5066 ///////////////////// 5055 5067 case ALLOC_DIR_WRITE: 5056 if ( ( (r_write_fsm.read() != WRITE_DIR_LOCK)&&5057 (r_write_fsm.read() != WRITE_ TRT_LOCK)&&5058 (r_write_fsm.read() != WRITE_DIR_ HIT_READ) &&5068 if ( ((r_write_fsm.read() != WRITE_DIR_LOCK) && 5069 (r_write_fsm.read() != WRITE_MISS_TRT_LOCK) && 5070 (r_write_fsm.read() != WRITE_DIR_READ) && 5059 5071 (r_write_fsm.read() != WRITE_DIR_HIT) && 5060 (r_write_fsm.read() != WRITE_ TRT_WRITE_LOCK) &&5061 (r_write_fsm.read() != WRITE_ INVAL_LOCK) &&5072 (r_write_fsm.read() != WRITE_BC_TRT_LOCK) && 5073 (r_write_fsm.read() != WRITE_BC_UPT_LOCK) && 5062 5074 (r_write_fsm.read() != WRITE_UPT_LOCK) && 5063 (r_write_fsm.read() != WRITE_ HEAP_LOCK))5075 (r_write_fsm.read() != WRITE_UPT_HEAP_LOCK)) 5064 5076 || 5065 ( (r_write_fsm.read() == WRITE_ HEAP_LOCK) &&5077 ( (r_write_fsm.read() == WRITE_UPT_HEAP_LOCK) && 5066 5078 (r_alloc_heap_fsm.read() == ALLOC_HEAP_WRITE) ) 5067 5079 || 5068 ( (r_write_fsm.read() == WRITE_ TRT_LOCK) &&5080 ( (r_write_fsm.read() == WRITE_MISS_TRT_LOCK) && 5069 5081 (r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE) ) ) 5070 5082 { … … 5081 5093 (r_sc_fsm.read() != SC_DIR_HIT_READ ) && 5082 5094 (r_sc_fsm.read() != SC_DIR_HIT_WRITE ) && 5083 // (r_sc_fsm.read() != SC_ TRT_GET_LOCK ) &&5084 (r_sc_fsm.read() != SC_ TRT_PUT_LOCK) &&5085 (r_sc_fsm.read() != SC_ INVAL_LOCK) &&5095 // (r_sc_fsm.read() != SC_MISS_TRT_LOCK ) && 5096 (r_sc_fsm.read() != SC_BC_TRT_LOCK) && 5097 (r_sc_fsm.read() != SC_BC_UPT_LOCK) && 5086 5098 (r_sc_fsm.read() != SC_UPT_LOCK) && 5087 (r_sc_fsm.read() != SC_ HEAP_LOCK))5099 (r_sc_fsm.read() != SC_UPT_HEAP_LOCK)) 5088 5100 || 5089 ( (r_sc_fsm.read() == SC_ HEAP_LOCK) &&5101 ( (r_sc_fsm.read() == SC_UPT_HEAP_LOCK) && 5090 5102 (r_alloc_heap_fsm.read() == ALLOC_HEAP_SC) ) 5091 5103 || 5092 ( (r_sc_fsm.read() == SC_ TRT_GET_LOCK ) &&5104 ( (r_sc_fsm.read() == SC_MISS_TRT_LOCK ) && 5093 5105 (r_alloc_trt_fsm.read() == ALLOC_TRT_SC) ) ) 5094 5106 { … … 5142 5154 if ( r_read_fsm.read() != READ_TRT_LOCK ) 5143 5155 { 5144 if ((r_write_fsm.read() == WRITE_ TRT_LOCK) ||5145 (r_write_fsm.read() == WRITE_ TRT_WRITE_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE;5146 else if ((r_sc_fsm.read() == SC_ TRT_GET_LOCK) ||5147 (r_sc_fsm.read() == SC_ TRT_PUT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC;5156 if ((r_write_fsm.read() == WRITE_MISS_TRT_LOCK) || 5157 (r_write_fsm.read() == WRITE_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE; 5158 else if ((r_sc_fsm.read() == SC_MISS_TRT_LOCK) || 5159 (r_sc_fsm.read() == SC_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC; 5148 5160 else if (r_xram_rsp_fsm.read() == XRAM_RSP_TRT_COPY) r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP; 5149 5161 else if ( (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_ERASE) || … … 5153 5165 ///////////////////// 5154 5166 case ALLOC_TRT_WRITE: 5155 if ( (r_write_fsm.read() != WRITE_ TRT_LOCK) &&5156 (r_write_fsm.read() != WRITE_ TRT_WRITE_LOCK) &&5157 (r_write_fsm.read() != WRITE_ INVAL_LOCK))5158 { 5159 if ((r_sc_fsm.read() == SC_ TRT_GET_LOCK) ||5160 (r_sc_fsm.read() == SC_ TRT_PUT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC;5167 if ( (r_write_fsm.read() != WRITE_MISS_TRT_LOCK) && 5168 (r_write_fsm.read() != WRITE_BC_TRT_LOCK) && 5169 (r_write_fsm.read() != WRITE_BC_UPT_LOCK)) 5170 { 5171 if ((r_sc_fsm.read() == SC_MISS_TRT_LOCK) || 5172 (r_sc_fsm.read() == SC_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC; 5161 5173 else if (r_xram_rsp_fsm.read() == XRAM_RSP_TRT_COPY) r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP; 5162 5174 else if ( (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_ERASE) || … … 5167 5179 //////////////////// 5168 5180 case ALLOC_TRT_SC: 5169 if ( (r_sc_fsm.read() != SC_ TRT_GET_LOCK) &&5170 (r_sc_fsm.read() != SC_ TRT_PUT_LOCK) &&5171 (r_sc_fsm.read() != SC_ INVAL_LOCK))5181 if ( (r_sc_fsm.read() != SC_MISS_TRT_LOCK) && 5182 (r_sc_fsm.read() != SC_BC_TRT_LOCK) && 5183 (r_sc_fsm.read() != SC_BC_UPT_LOCK)) 5172 5184 { 5173 5185 if (r_xram_rsp_fsm.read() == XRAM_RSP_TRT_COPY) r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP; … … 5175 5187 (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ)) r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP; 5176 5188 else if (r_read_fsm.read() == READ_TRT_LOCK) r_alloc_trt_fsm = ALLOC_TRT_READ; 5177 else if ((r_write_fsm.read() == WRITE_ TRT_LOCK) ||5178 (r_write_fsm.read() == WRITE_ TRT_WRITE_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE;5189 else if ((r_write_fsm.read() == WRITE_MISS_TRT_LOCK) || 5190 (r_write_fsm.read() == WRITE_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE; 5179 5191 } 5180 5192 break; … … 5187 5199 (r_ixr_rsp_fsm.read() == IXR_RSP_TRT_READ)) r_alloc_trt_fsm = ALLOC_TRT_IXR_RSP; 5188 5200 else if (r_read_fsm.read() == READ_TRT_LOCK) r_alloc_trt_fsm = ALLOC_TRT_READ; 5189 else if ((r_write_fsm.read() == WRITE_ TRT_LOCK) ||5190 (r_write_fsm.read() == WRITE_ TRT_WRITE_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE;5191 else if ((r_sc_fsm.read() == SC_ TRT_GET_LOCK) ||5192 (r_sc_fsm.read() == SC_ TRT_PUT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC;5201 else if ((r_write_fsm.read() == WRITE_MISS_TRT_LOCK) || 5202 (r_write_fsm.read() == WRITE_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE; 5203 else if ((r_sc_fsm.read() == SC_MISS_TRT_LOCK) || 5204 (r_sc_fsm.read() == SC_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC; 5193 5205 } 5194 5206 break; … … 5198 5210 (r_ixr_rsp_fsm.read() != IXR_RSP_TRT_READ) ) { 5199 5211 if (r_read_fsm.read() == READ_TRT_LOCK) r_alloc_trt_fsm = ALLOC_TRT_READ; 5200 else if ((r_write_fsm.read() == WRITE_ TRT_LOCK) ||5201 (r_write_fsm.read() == WRITE_ TRT_WRITE_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE;5202 else if ((r_sc_fsm.read() == SC_ TRT_GET_LOCK) ||5203 (r_sc_fsm.read() == SC_ TRT_PUT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC;5212 else if ((r_write_fsm.read() == WRITE_MISS_TRT_LOCK) || 5213 (r_write_fsm.read() == WRITE_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_WRITE; 5214 else if ((r_sc_fsm.read() == SC_MISS_TRT_LOCK) || 5215 (r_sc_fsm.read() == SC_BC_TRT_LOCK)) r_alloc_trt_fsm = ALLOC_TRT_SC; 5204 5216 else if (r_xram_rsp_fsm.read() == XRAM_RSP_TRT_COPY) r_alloc_trt_fsm = ALLOC_TRT_XRAM_RSP; 5205 5217 } … … 5219 5231 switch ( r_alloc_heap_fsm.read() ) 5220 5232 { 5221 5222 //////////////////// 5223 case ALLOC_HEAP_READ: 5233 //////////////////// 5234 case ALLOC_HEAP_READ: 5224 5235 if ( (r_read_fsm.read() != READ_HEAP_LOCK) && 5225 5236 (r_read_fsm.read() != READ_HEAP_ERASE) ) 5226 5237 { 5227 if (r_write_fsm.read() == WRITE_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_WRITE;5228 else if (r_sc_fsm.read() == SC_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_SC;5229 else if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP;5230 else if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE)r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;5238 if (r_write_fsm.read() == WRITE_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_WRITE; 5239 else if (r_sc_fsm.read() == SC_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_SC; 5240 else if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP; 5241 else if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE) r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 5231 5242 } 5232 5243 break; 5233 5244 5234 5245 ///////////////////// 5235 case ALLOC_HEAP_WRITE:5236 if ( (r_write_fsm.read() != WRITE_ HEAP_LOCK) &&5246 case ALLOC_HEAP_WRITE: 5247 if ( (r_write_fsm.read() != WRITE_UPT_HEAP_LOCK) && 5237 5248 (r_write_fsm.read() != WRITE_UPT_REQ) && 5238 (r_write_fsm.read() != WRITE_UP DATE) )5239 { 5240 if (r_sc_fsm.read() == SC_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_SC;5241 else if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP;5242 else if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE)r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;5243 else if (r_read_fsm.read() == READ_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_READ;5249 (r_write_fsm.read() != WRITE_UPT_NEXT) ) 5250 { 5251 if (r_sc_fsm.read() == SC_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_SC; 5252 else if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP; 5253 else if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE) r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 5254 else if (r_read_fsm.read() == READ_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_READ; 5244 5255 } 5245 5256 break; 5246 5257 5247 5258 //////////////////// 5248 case ALLOC_HEAP_SC:5249 if ( (r_sc_fsm.read() != SC_ HEAP_LOCK) &&5259 case ALLOC_HEAP_SC: 5260 if ( (r_sc_fsm.read() != SC_UPT_HEAP_LOCK) && 5250 5261 (r_sc_fsm.read() != SC_UPT_REQ ) && 5251 5262 (r_sc_fsm.read() != SC_UPT_NEXT) ) 5252 5263 { 5253 if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK) 5254 else if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE) 5255 else if (r_read_fsm.read() == READ_HEAP_LOCK) 5256 else if (r_write_fsm.read() == WRITE_ HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_WRITE;5264 if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP; 5265 else if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE) r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 5266 else if (r_read_fsm.read() == READ_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_READ; 5267 else if (r_write_fsm.read() == WRITE_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_WRITE; 5257 5268 } 5258 5269 break; 5259 5270 5260 5271 /////////////////////// 5261 case ALLOC_HEAP_CLEANUP:5272 case ALLOC_HEAP_CLEANUP: 5262 5273 if ( (r_cleanup_fsm.read() != CLEANUP_HEAP_LOCK) && 5263 5274 (r_cleanup_fsm.read() != CLEANUP_HEAP_SEARCH)&& 5264 5275 (r_cleanup_fsm.read() != CLEANUP_HEAP_CLEAN) ) 5265 5276 { 5266 if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE)r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP;5267 else if (r_read_fsm.read() == READ_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_READ;5268 else if (r_write_fsm.read() == WRITE_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_WRITE;5269 else if (r_sc_fsm.read() == SC_HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_SC;5277 if (r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_ERASE) r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 5278 else if (r_read_fsm.read() == READ_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_READ; 5279 else if (r_write_fsm.read() == WRITE_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_WRITE; 5280 else if (r_sc_fsm.read() == SC_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_SC; 5270 5281 } 5271 5282 break; 5272 5283 //////////////////////// 5273 case ALLOC_HEAP_XRAM_RSP:5284 case ALLOC_HEAP_XRAM_RSP: 5274 5285 if ( r_xram_rsp_fsm.read() != XRAM_RSP_HEAP_ERASE ) 5275 5286 { 5276 if (r_read_fsm.read() == READ_HEAP_LOCK) 5277 else if (r_write_fsm.read() == WRITE_ HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_WRITE;5278 else if (r_sc_fsm.read() == SC_ HEAP_LOCK)r_alloc_heap_fsm = ALLOC_HEAP_SC;5279 else if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK) 5287 if (r_read_fsm.read() == READ_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_READ; 5288 else if (r_write_fsm.read() == WRITE_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_WRITE; 5289 else if (r_sc_fsm.read() == SC_UPT_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_SC; 5290 else if (r_cleanup_fsm.read() == CLEANUP_HEAP_LOCK) r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP; 5280 5291 } 5281 5292 break;
Note: See TracChangeset
for help on using the changeset viewer.