Changeset 678 for branches/MESI
- Timestamp:
- Apr 15, 2014, 1:41:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MESI/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r677 r678 1976 1976 else 1977 1977 { 1978 r_multi_ack_fsm = MULTI_ACK_ IVT_LOCK;1978 r_multi_ack_fsm = MULTI_ACK_DIR_REQ; 1979 1979 r_multi_ack_need_data = false; 1980 1980 } … … 2024 2024 { 2025 2025 assert( eop && "the last word has been received in multi ack data"); 2026 r_multi_ack_fsm = MULTI_ACK_ IVT_LOCK;2026 r_multi_ack_fsm = MULTI_ACK_DIR_REQ; 2027 2027 } 2028 2028 … … 2034 2034 { 2035 2035 if(r_alloc_ivt_fsm.read() != ALLOC_IVT_MULTI_ACK) break; 2036 assert( r_alloc_dir_fsm.read() == ALLOC_DIR_MULTI_ACK && " BAD ALLOC_DIR_MULTI_ACK IN MULTI_ACK_IVT_LOCK STATE"); 2036 2037 size_t index = r_multi_ack_ivt_index.read(); 2037 2038 size_t count = m_ivt.count(index); … … 2044 2045 //bool is_valid = m_ivt.is_valid(index); 2045 2046 2046 if(r_multi_ack_miss_updt.read())2047 {2048 r_multi_ack_fsm = MULTI_ACK_DIR_ REQ;2049 }2050 else2051 {2047 // if(r_multi_ack_miss_updt.read()) 2048 //{ 2049 r_multi_ack_fsm = MULTI_ACK_DIR_LOCK; // this way may be bring about the problem of critical path 2050 //} 2051 //else 2052 //{ 2052 2053 bool is_updt = m_ivt.is_update(index); 2053 2054 … … 2055 2056 assert(count == 1 && "there is only one copy in the memc"); 2056 2057 2057 2058 // r_multi_ack_fsm = MULTI_ACK_IVT_CLEAR; 2058 2059 2059 2060 #if DEBUG_MEMC_MULTI_ACK 2060 2061 if(m_debug) 2061 2062 std::cout << " <MEMC " << name() 2062 << " MULTI_ACK_IVT_LOCK> Decrement the responses counter for UPT:"2063 << " MULTI_ACK_IVT_LOCK> " 2063 2064 << " entry = " << r_multi_ack_ivt_index.read() 2064 2065 << " / count = " << std::dec << count << std::endl; 2065 2066 #endif 2066 }2067 2067 break; 2068 2068 } … … 2074 2074 std::cout 2075 2075 << "VCI_MEM_CACHE ERROR " << name() 2076 << " MULTI_ACK_IVT_ LOCKstate"2076 << " MULTI_ACK_IVT_CLEAR state" 2077 2077 << " bad IVT allocation" << std::endl; 2078 2078 … … 2081 2081 2082 2082 m_ivt.clear(r_multi_ack_ivt_index.read()); 2083 r_multi_ack_fsm = MULTI_ACK_ DIR_REQ;2083 r_multi_ack_fsm = MULTI_ACK_RSP; 2084 2084 2085 2085 #if DEBUG_MEMC_MULTI_ACK … … 2097 2097 if(r_alloc_dir_fsm.read() != ALLOC_DIR_MULTI_ACK) break; 2098 2098 2099 r_multi_ack_fsm = MULTI_ACK_ DIR_LOCK;2099 r_multi_ack_fsm = MULTI_ACK_IVT_LOCK; 2100 2100 //std::cout << " MEM_CACHE : CLEANUP_DIR_REQ" << std::endl; 2101 2101 … … 2152 2152 assert( (entry.state == ENTRY_LOCKED) && "mutli rsp check the entry, the line is not locked!!!"); 2153 2153 2154 if(r_multi_ack_miss_updt.read()) //cache L1 has sent the cleanup when it receives the cc_updt request, 2155 { 2156 if(not entry.count) 2157 { 2158 r_multi_ack_fsm = MULTI_ACK_IVT_LOCK; 2159 r_multi_ack_miss_updt = false; 2160 } 2161 else 2162 { 2163 r_multi_ack_fsm = MULTI_ACK_IVT_CHANGE; 2164 } 2154 if(r_multi_ack_miss_updt.read() and entry.count) //cache L1 has sent the cleanup when it receives the cc_updt request, 2155 { 2156 r_multi_ack_fsm = MULTI_ACK_IVT_CHANGE; 2165 2157 } 2166 2158 else if( not entry.count or match_ll) // The line has been already evicted from cache L1 … … 2180 2172 case MULTI_ACK_IVT_CHANGE: // release all locks and retry from beginning 2181 2173 { 2182 if(r_alloc_ivt_fsm.read() != ALLOC_IVT_MULTI_ACK) break; 2183 2174 //if(r_alloc_ivt_fsm.read() != ALLOC_IVT_MULTI_ACK) break; 2175 if(r_alloc_ivt_fsm.read() != ALLOC_IVT_MULTI_ACK ) 2176 { 2177 std::cout 2178 << "VCI_MEM_CACHE ERROR " << name() 2179 << " MULTI_ACK_IVT_CHANGE state" 2180 << " bad IVT allocation" << std::endl; 2181 2182 exit(0); 2183 } 2184 2184 m_ivt.change(r_multi_ack_ivt_index.read()); 2185 2185 #if DEBUG_MEMC_MULTI_ACK … … 2265 2265 2266 2266 assert( r_multi_ack_rsp.read() && "Multi ack: must be send the rsp"); 2267 r_multi_ack_fsm = MULTI_ACK_ RSP;2267 r_multi_ack_fsm = MULTI_ACK_IVT_CLEAR; 2268 2268 #if DEBUG_MEMC_MULTI_ACK 2269 2269 if(m_debug) … … 2399 2399 entry.owner.inst = false; 2400 2400 entry.ptr = 0; 2401 r_multi_ack_fsm = MULTI_ACK_ RSP;2401 r_multi_ack_fsm = MULTI_ACK_IVT_CLEAR; 2402 2402 2403 2403 } … … 2446 2446 if(r_multi_ack_last_free.read()) m_heap.set_full(); 2447 2447 2448 r_multi_ack_fsm = MULTI_ACK_ RSP;2448 r_multi_ack_fsm = MULTI_ACK_IVT_CLEAR; 2449 2449 2450 2450 #if DEBUG_MEMC_MULTI_ACK … … 9880 9880 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9881 9881 9882 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9883 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9882 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9884 9883 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9885 9884 … … 9908 9907 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9909 9908 9910 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9911 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9909 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9912 9910 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9913 9911 … … 9935 9933 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9936 9934 9937 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9938 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9935 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9939 9936 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9940 9937 … … 9965 9962 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9966 9963 9967 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9968 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9964 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9969 9965 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9970 9966 … … 9992 9988 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9993 9989 9994 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9995 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9990 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9996 9991 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9997 9992 … … 10019 10014 if (r_config_fsm.read() != CONFIG_IVT_LOCK) 10020 10015 { 10021 if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 10022 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 10016 if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 10023 10017 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 10024 10018 … … 10048 10042 case ALLOC_IVT_MULTI_ACK: // allocated to MULTI ACK FSM 10049 10043 if ((r_multi_ack_fsm.read() != MULTI_ACK_IVT_LOCK) and 10050 (r_multi_ack_fsm.read() != MULTI_ACK_IVT_CHANGE)) 10044 (r_multi_ack_fsm.read() != MULTI_ACK_DIR_LOCK) and 10045 (r_multi_ack_fsm.read() != MULTI_ACK_DIR_UPDT) and 10046 (r_multi_ack_fsm.read() != MULTI_ACK_HEAP_LOCK) and 10047 (r_multi_ack_fsm.read() != MULTI_ACK_HEAP_WRITE)) 10051 10048 { 10052 10049 if ((r_write_fsm.read() == WRITE_INVAL_IVT_LOCK)) … … 10262 10259 if(((r_multi_ack_fsm.read() != MULTI_ACK_DIR_REQ) and 10263 10260 (r_multi_ack_fsm.read() != MULTI_ACK_DIR_LOCK) and 10261 (r_multi_ack_fsm.read() != MULTI_ACK_IVT_LOCK) and 10264 10262 (r_multi_ack_fsm.read() != MULTI_ACK_DIR_UPDT) and 10265 10263 (r_multi_ack_fsm.read() != MULTI_ACK_HEAP_REQ) and
Note: See TracChangeset
for help on using the changeset viewer.