Changeset 677 for branches/MESI/modules/vci_mem_cache/caba/source/src
- Timestamp:
- Apr 14, 2014, 2:15:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MESI/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r676 r677 135 135 "MULTI_ACK_HEAP_LOCK", 136 136 "MULTI_ACK_HEAP_WRITE", 137 "MULTI_ACK_ WAIT"137 "MULTI_ACK_IVT_CHANGE" 138 138 }; 139 139 const char *config_fsm_str[] = … … 1112 1112 r_tgt_cmd_to_tgt_rsp_req = false; 1113 1113 1114 r_read_to_cc_send_multi_req = false; 1115 r_read_to_cc_send_brdcast_req = false; 1114 1116 r_read_to_tgt_rsp_req = false; 1115 1117 r_read_to_ixr_cmd_req = false; 1116 r_read_to_cc_send_req = false;1117 1118 r_read_to_cleanup_req = false; 1118 1119 r_read_to_multi_ack_req = false; … … 2155 2156 if(not entry.count) 2156 2157 { 2158 r_multi_ack_fsm = MULTI_ACK_IVT_LOCK; 2157 2159 r_multi_ack_miss_updt = false; 2158 2160 } 2159 r_multi_ack_fsm = MULTI_ACK_WAIT; 2161 else 2162 { 2163 r_multi_ack_fsm = MULTI_ACK_IVT_CHANGE; 2164 } 2160 2165 } 2161 2166 else if( not entry.count or match_ll) // The line has been already evicted from cache L1 … … 2173 2178 } 2174 2179 ///////////// 2175 case MULTI_ACK_WAIT: // release all locks and retry from beginning 2176 { 2177 2180 case MULTI_ACK_IVT_CHANGE: // release all locks and retry from beginning 2181 { 2182 if(r_alloc_ivt_fsm.read() != ALLOC_IVT_MULTI_ACK) break; 2183 2184 m_ivt.change(r_multi_ack_ivt_index.read()); 2178 2185 #if DEBUG_MEMC_MULTI_ACK 2179 2186 if(m_debug) 2180 2187 { 2181 2188 std::cout << " <MEMC " << name() 2182 << " MULTI_ACK_ WAIT> Release all locks" << std::endl;2183 } 2184 #endif 2185 r_multi_ack_fsm = MULTI_ACK_I VT_LOCK;2189 << " MULTI_ACK_IVT_CHANGE> multi ack miss, count is 1, change ivt state" << std::endl; 2190 } 2191 #endif 2192 r_multi_ack_fsm = MULTI_ACK_IDLE; 2186 2193 break; 2187 2194 } … … 3234 3241 r_read_to_cc_send_brdcast_req = not multi_req; 3235 3242 r_read_to_cc_send_nline = nline; 3236 r_read_to_cc_send_srcid = m_cmd_read_srcid_fifo.read();3237 r_read_to_cc_send_is_shared = r_read_state.read() == ENTRY_SHARED;3243 //r_read_to_cc_send_srcid = m_cmd_read_srcid_fifo.read(); 3244 //r_read_to_cc_send_is_shared = r_read_state.read() == ENTRY_SHARED; 3238 3245 3239 3246 if(r_read_need_block.read()) … … 3442 3449 false, // multi_inval 3443 3450 true, // it needs a read response 3444 true, // acknowledge required3451 false, // acknowledge required 3445 3452 m_cmd_read_srcid_fifo.read(), 3446 3453 m_cmd_read_trdid_fifo.read(), … … 6635 6642 << " CLEANUP_LOCKED_IVT_LOCK> :" 6636 6643 << "/ is_updt =" << m_ivt.is_update(index) 6644 << "/ is_change =" << m_ivt.is_change(index) 6637 6645 << "/ match =" << match_inval 6638 6646 << "/ need rsp =" << m_ivt.need_rsp(index) … … 6641 6649 #endif 6642 6650 6643 r_cleanup_locked_srcid = m_ivt.srcid(index); 6644 r_cleanup_locked_trdid = m_ivt.trdid(index); 6645 r_cleanup_locked_pktid = m_ivt.pktid(index); 6646 r_cleanup_locked_index = index; 6647 r_cleanup_locked_is_updt = m_ivt.is_update(index); 6648 6649 if( not m_ivt.is_update(index)) 6650 { 6651 r_cleanup_fsm = CLEANUP_LOCKED_IVT_DECREMENT; 6651 r_cleanup_locked_srcid = m_ivt.srcid(index); 6652 r_cleanup_locked_trdid = m_ivt.trdid(index); 6653 r_cleanup_locked_pktid = m_ivt.pktid(index); 6654 r_cleanup_locked_index = index; 6655 r_cleanup_locked_is_updt = m_ivt.is_update(index); 6656 r_cleanup_locked_is_change = m_ivt.is_change(index); 6657 6658 if( m_ivt.is_update(index) and not m_ivt.is_change(index)) 6659 { 6660 r_cleanup_fsm = CLEANUP_LOCKED_IVT_CLEAR; 6652 6661 } 6653 6662 else 6654 6663 { 6655 r_cleanup_fsm = CLEANUP_LOCKED_IVT_ CLEAR;6664 r_cleanup_fsm = CLEANUP_LOCKED_IVT_DECREMENT; 6656 6665 } 6657 6666 … … 6705 6714 size_t match_cas_multi_inval = r_cas_to_cleanup_req.read() and 6706 6715 (r_cas_to_cleanup_nline.read() == r_cleanup_nline.read()); 6716 6717 bool match_ll = ((r_cleanup_locked_pktid.read() & 0x07) == TYPE_LL); 6707 6718 DirectoryEntry entry; 6708 6719 entry.is_cnt = false; 6709 6720 entry.lock = r_cleanup_lock.read(); 6710 entry.dirty = r_cleanup_dirty.read() ;6721 entry.dirty = r_cleanup_dirty.read() or r_cleanup_contains_data.read(); 6711 6722 entry.tag = r_cleanup_tag.read(); 6712 6723 entry.ptr = r_cleanup_ptr.read(); … … 6728 6739 } 6729 6740 6730 if(r_cleanup_locked_is_updt.read()) //cleanup req cross with multi ack rsp. here, just decrements the count and remains the state. 6731 { 6741 if(r_cleanup_locked_is_updt.read() and not r_cleanup_locked_is_change.read()) //cleanup req cross with multi ack rsp. here, just decrements the count and remains the state. 6742 { 6743 assert(r_cleanup_count.read() == 1 && " only one copy when cleanup fsm receives a req for is_updt command"); 6732 6744 entry.state = r_cleanup_state.read(); //cross with cc updt cmd, don't modify the state 6733 6745 entry.count = 0; … … 6735 6747 entry.owner.inst = 0; 6736 6748 r_cleanup_fsm = CLEANUP_SEND_CLACK; 6749 } 6750 else if(r_cleanup_locked_is_updt.read() and r_cleanup_locked_is_change.read()) 6751 { 6752 entry.state = ENTRY_SHARED; 6753 if(match_ll) 6754 { 6755 entry.count = 0; 6756 entry.owner.srcid = 0; 6757 } 6758 else 6759 { 6760 entry.count = 1; 6761 entry.owner.srcid = r_cleanup_locked_srcid.read(); 6762 } 6763 6764 if((r_cleanup_locked_pktid.read() & 0x7) == 0x03) 6765 { 6766 entry.owner.inst = true; 6767 } 6768 else 6769 { 6770 entry.owner.inst = false; 6771 } 6772 6773 r_cleanup_fsm = CLEANUP_LOCKED_RSP; 6774 m_ivt.clear(r_cleanup_locked_index.read()); 6737 6775 } 6738 6776 else // cas, getm, one copy updated in dir … … 6781 6819 r_cleanup_to_tgt_rsp_nline = r_cleanup_nline.read(); 6782 6820 6783 r_cleanup_to_tgt_rsp_pktid = 0x8 + r_cleanup_locked_pktid.read(); // there is not a brdcast for cas operation. in cache L1, the line can be in M state 6784 6785 if(r_read_to_cleanup_req.read() and (r_read_to_cleanup_nline.read() == r_cleanup_nline.read())) // rsp for LL or pheriph 6821 if(r_cleanup_locked_is_change.read() and r_cleanup_locked_is_updt.read()) 6822 { 6823 r_cleanup_to_tgt_rsp_pktid = r_cleanup_locked_pktid.read(); // rsp for is_updt in shared state 6824 } 6825 else 6826 { 6827 6828 r_cleanup_to_tgt_rsp_pktid = 0x8 + r_cleanup_locked_pktid.read(); // there is not a brdcast for cas operation. in cache L1, the line can be in M state 6829 } 6830 6831 if(r_read_to_multi_ack_req.read() and (r_read_to_multi_ack_nline.read() == r_cleanup_nline.read()) and // rsp for LL or pheriph 6832 (r_cleanup_locked_is_change.read() and r_cleanup_locked_is_updt.read())) 6833 { 6834 r_cleanup_to_tgt_rsp_ll_key = r_read_to_multi_ack_ll_key.read(); 6835 r_cleanup_to_tgt_rsp_length = r_read_to_multi_ack_length.read(); 6836 r_cleanup_to_tgt_rsp_first_word = r_read_to_multi_ack_first_word.read(); 6837 r_read_to_multi_ack_req = false; 6838 } 6839 else if(r_read_to_cleanup_req.read() and (r_read_to_cleanup_nline.read() == r_cleanup_nline.read())) // rsp for LL or pheriph 6786 6840 { 6787 6841 r_cleanup_to_tgt_rsp_ll_key = r_read_to_cleanup_ll_key.read(); … … 6820 6874 << " <MEMC " << name() 6821 6875 << " CLEANUP_LOCKED_RSP>" 6822 << " type rsp =" << r_cleanup_locked_pktid.read()6823 << " r_read_to_cleanup_req =" << r_read_to_cleanup_req.read()6824 << " r_read_to_cleanup_length =" << r_read_to_cleanup_length.read()6825 << " r_read_to_cleanup_first_word =" << r_read_to_cleanup_first_word.read()6876 << " type rsp =" << r_cleanup_locked_pktid.read() 6877 << " r_read_to_cleanup_req =" << r_read_to_cleanup_req.read() 6878 << " r_read_to_cleanup_length =" << r_read_to_cleanup_length.read() 6879 << " r_read_to_cleanup_first_word =" << r_read_to_cleanup_first_word.read() 6826 6880 << std::endl; 6827 6881 } … … 7267 7321 } 7268 7322 //std::cout << "cleanup with a non coherent ligne in trt index = " << index << std::endl; 7269 r_cleanup_to_ixr_cmd_srcid = r_cleanup_srcid.read();7323 //r_cleanup_to_ixr_cmd_srcid = r_cleanup_srcid.read(); 7270 7324 r_cleanup_to_ixr_cmd_index = index; 7271 r_cleanup_to_ixr_cmd_pktid = r_cleanup_pktid.read();7272 r_cleanup_to_ixr_cmd_nline = r_cleanup_nline.read();7325 //r_cleanup_to_ixr_cmd_pktid = r_cleanup_pktid.read(); 7326 //r_cleanup_to_ixr_cmd_nline = r_cleanup_nline.read(); 7273 7327 //r_cleanup_to_ixr_cmd_l1_dirty_ncc = r_cleanup_contains_data.read(); 7274 7328 r_cleanup_fsm = CLEANUP_SEND_CLACK; … … 9826 9880 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9827 9881 9828 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9882 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9883 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9829 9884 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9830 9885 … … 9853 9908 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9854 9909 9855 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9910 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9911 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9856 9912 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9857 9913 … … 9879 9935 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9880 9936 9881 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9937 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9938 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9882 9939 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9883 9940 … … 9908 9965 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9909 9966 9910 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9967 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9968 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9911 9969 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9912 9970 … … 9934 9992 r_alloc_ivt_fsm = ALLOC_IVT_CONFIG; 9935 9993 9936 else if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 9994 else if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 9995 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9937 9996 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9938 9997 … … 9960 10019 if (r_config_fsm.read() != CONFIG_IVT_LOCK) 9961 10020 { 9962 if (r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) 10021 if ((r_multi_ack_fsm.read() == MULTI_ACK_IVT_LOCK) or 10022 (r_multi_ack_fsm.read() == MULTI_ACK_IVT_CHANGE)) 9963 10023 r_alloc_ivt_fsm = ALLOC_IVT_MULTI_ACK; 9964 10024 … … 9987 10047 ////////////////////////// 9988 10048 case ALLOC_IVT_MULTI_ACK: // allocated to MULTI ACK FSM 9989 if (r_multi_ack_fsm.read() != MULTI_ACK_IVT_LOCK) 10049 if ((r_multi_ack_fsm.read() != MULTI_ACK_IVT_LOCK) and 10050 (r_multi_ack_fsm.read() != MULTI_ACK_IVT_CHANGE)) 9990 10051 { 9991 10052 if ((r_write_fsm.read() == WRITE_INVAL_IVT_LOCK)) … … 11517 11578 11518 11579 DspinDhccpParam::dspin_set( flit, 11519 m_cc_global_id + 0xff,11580 m_cc_global_id, 11520 11581 DspinDhccpParam::BROADCAST_SRCID); 11521 11582 … … 11539 11600 11540 11601 DspinDhccpParam::dspin_set( flit, 11541 m_cc_global_id + 0xff,11602 m_cc_global_id, 11542 11603 DspinDhccpParam::BROADCAST_SRCID); 11543 11604 … … 11558 11619 DspinDhccpParam::BROADCAST_BOX); 11559 11620 11560 DspinDhccpParam::dspin_set( flit,11561 r_read_to_cc_send_srcid.read(), // send the srcid itself which demands the request getM11562 DspinDhccpParam::BROADCAST_SRCID);11563 11564 DspinDhccpParam::dspin_set( flit,11565 r_read_to_cc_send_is_shared.read(), // send the actuel line state in memcache11566 DspinDhccpParam::BRDCAST_IS_SHARED);11621 // DspinDhccpParam::dspin_set( flit, 11622 // r_read_to_cc_send_srcid.read(), // send the srcid itself which demands the request getM 11623 // DspinDhccpParam::BROADCAST_SRCID); 11624 11625 // DspinDhccpParam::dspin_set( flit, 11626 // r_read_to_cc_send_is_shared.read(), // send the actuel line state in memcache 11627 // DspinDhccpParam::BRDCAST_IS_SHARED); 11567 11628 11568 11629 DspinDhccpParam::dspin_set( flit,
Note: See TracChangeset
for help on using the changeset viewer.