Changeset 442 for branches/v5/modules/vci_mem_cache/caba
- Timestamp:
- Jul 17, 2013, 12:13:51 PM (11 years ago)
- Location:
- branches/v5/modules/vci_mem_cache/caba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v5/modules/vci_mem_cache/caba/metadata/vci_mem_cache.sd
r441 r442 5 5 __version__ = "$Revision: 295 $" 6 6 7 Module('caba:vci_mem_cache _branch',7 Module('caba:vci_mem_cache', 8 8 classname = 'soclib::caba::VciMemCache', 9 9 … … 48 48 Port('caba:vci_target' , 'p_vci_tgt'), 49 49 Port('caba:vci_initiator', 'p_vci_ixr'), 50 Port('caba:dspin_ p2m',50 Port('caba:dspin_input', 51 51 'p_dspin_p2m', 52 52 dspin_data_size = parameter.Reference('dspin_in_width') 53 53 ), 54 Port('caba:dspin_ m2p',54 Port('caba:dspin_output', 55 55 'p_dspin_m2p', 56 56 dspin_data_size = parameter.Reference('dspin_out_width') 57 57 ), 58 Port('caba:dspin_ clack',58 Port('caba:dspin_output', 59 59 'p_dspin_clack', 60 60 dspin_data_size = parameter.Reference('dspin_out_width') -
branches/v5/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r441 r442 125 125 CC_SEND_WRITE_IDLE, 126 126 CC_SEND_CAS_IDLE, 127 CC_SEND_CLEANUP_IDLE,128 127 CC_SEND_CONFIG_INVAL_HEADER, 129 128 CC_SEND_CONFIG_INVAL_NLINE, 130 129 CC_SEND_CONFIG_BRDCAST_HEADER, 131 130 CC_SEND_CONFIG_BRDCAST_NLINE, 132 CC_SEND_CLEANUP_ACK,133 131 CC_SEND_XRAM_RSP_BRDCAST_HEADER, 134 132 CC_SEND_XRAM_RSP_BRDCAST_NLINE, … … 790 788 sc_signal<size_t> r_cleanup_to_tgt_rsp_pktid; // transaction pktid 791 789 792 // Buffer between CLEANUP fsm and CC_SEND fsm (acknowledge a cleanup command from L1)793 sc_signal<bool> r_cleanup_to_cc_send_req; // valid request794 sc_signal<size_t> r_cleanup_to_cc_send_srcid; // L1 srcid795 sc_signal<size_t> r_cleanup_to_cc_send_set_index; // L1 set index796 sc_signal<size_t> r_cleanup_to_cc_send_way_index; // L1 way index797 sc_signal<bool> r_cleanup_to_cc_send_inst; // Instruction Cleanup Ack798 799 790 /////////////////////////////////////////////////////// 800 791 // Registers controlled by CAS fsm -
branches/v5/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r441 r442 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", … … 4254 4252 DspinDhccpParam::dspin_get( 4255 4253 flit, 4256 DspinDhccpParam:: FROM_L1_TYPE);4254 DspinDhccpParam::P2M_TYPE); 4257 4255 4258 4256 r_cleanup_way_index = … … 4992 4990 //////////////////////// 4993 4991 case CLEANUP_SEND_CLACK: // acknowledgement to a cleanup command 4994 // on the coherence network (request to the CC_SEND FSM). 4995 // wait if pending request to the CC_SEND FSM 4996 { 4997 if(r_cleanup_to_cc_send_req.read()) break; 4998 4999 r_cleanup_to_cc_send_req = true; 5000 r_cleanup_to_cc_send_set_index = r_cleanup_nline.read() & 0xFFFF; 5001 r_cleanup_to_cc_send_way_index = r_cleanup_way_index.read(); 5002 r_cleanup_to_cc_send_srcid = r_cleanup_srcid.read(); 5003 r_cleanup_to_cc_send_inst = r_cleanup_inst.read(); 4992 // on the coherence CLACK network. 4993 { 4994 if(not p_dspin_clack.read) break; 5004 4995 5005 4996 r_cleanup_fsm = CLEANUP_IDLE; … … 5844 5835 // network, used to update or invalidate cache lines in L1 caches. 5845 5836 // 5846 // This fsm is used also to acknowledge CLEANUP a command after request from 5847 // the CLEANUP fsm. 5848 // 5849 // It implements a round-robin priority between the five possible client FSMs 5850 // XRAM_RSP > CAS > CLEANUP > WRITE > CONFIG 5837 // It implements a round-robin priority between the four possible client FSMs 5838 // XRAM_RSP > CAS > WRITE > CONFIG 5851 5839 // 5852 5840 // Each FSM can request the next services: … … 5860 5848 // r_config_to_cc_send_brdcast_req : broadcast-inval 5861 5849 // 5862 // - r_cleanup_to_cc_send_req : cleanup acknowledgement5863 //5864 5850 // An inval request is a double DSPIN flit command containing: 5865 5851 // 1. the index of the line to be invalidated. … … 5904 5890 break; 5905 5891 } 5906 // CLEANUP5907 if (r_cleanup_to_cc_send_req.read())5908 {5909 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;5910 break;5911 }5912 5892 // WRITE 5913 5893 if(m_write_to_cc_send_inst_fifo.rok() or … … 5983 5963 break; 5984 5964 } 5985 // CLEANUP5986 if (r_cleanup_to_cc_send_req.read())5987 {5988 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;5989 break;5990 }5991 5965 // WRITE 5992 5966 if(m_write_to_cc_send_inst_fifo.rok() or … … 6022 5996 break; 6023 5997 } 6024 // CLEANUP6025 if(r_cleanup_to_cc_send_req.read())6026 {6027 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;6028 break;6029 }6030 5998 // WRITE 6031 5999 if(m_write_to_cc_send_inst_fifo.rok() or … … 6075 6043 case CC_SEND_CAS_IDLE: // CLEANUP FSM has highest priority 6076 6044 { 6077 if(r_cleanup_to_cc_send_req.read())6078 {6079 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;6080 break;6081 }6082 6045 if(m_write_to_cc_send_inst_fifo.rok() or 6083 6046 r_write_to_cc_send_multi_req.read()) … … 6130 6093 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER; 6131 6094 m_cpt_inval++; 6132 break;6133 }6134 break;6135 }6136 //////////////////////////6137 case CC_SEND_CLEANUP_IDLE: // WRITE FSM has highest priority6138 {6139 // WRITE6140 if(m_write_to_cc_send_inst_fifo.rok() or6141 r_write_to_cc_send_multi_req.read())6142 {6143 r_cc_send_fsm = CC_SEND_WRITE_UPDT_HEADER;6144 m_cpt_update++;6145 break;6146 }6147 if(r_write_to_cc_send_brdcast_req.read())6148 {6149 r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_HEADER;6150 m_cpt_inval++;6151 break;6152 }6153 // CONFIG6154 if(r_config_to_cc_send_multi_req.read())6155 {6156 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER;6157 m_cpt_inval++;6158 break;6159 }6160 if(r_config_to_cc_send_brdcast_req.read())6161 {6162 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER;6163 m_cpt_inval++;6164 break;6165 }6166 // XRAM_RSP6167 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or6168 r_xram_rsp_to_cc_send_multi_req.read())6169 {6170 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_HEADER;6171 m_cpt_inval++;6172 break;6173 }6174 if(r_xram_rsp_to_cc_send_brdcast_req.read())6175 {6176 r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_HEADER;6177 m_cpt_inval++;6178 break;6179 }6180 // CAS6181 if(m_cas_to_cc_send_inst_fifo.rok() or6182 r_cas_to_cc_send_multi_req.read())6183 {6184 r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER;6185 m_cpt_update++;6186 break;6187 }6188 if(r_cas_to_cc_send_brdcast_req.read())6189 {6190 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER;6191 m_cpt_inval++;6192 break;6193 }6194 // CLEANUP6195 if(r_cleanup_to_cc_send_req.read())6196 {6197 r_cc_send_fsm = CC_SEND_CLEANUP_ACK;6198 6095 break; 6199 6096 } … … 6249 6146 << " CC_SEND_CONFIG_BRDCAST_NLINE> BC-Inval for line " 6250 6147 << std::hex << r_config_to_cc_send_nline.read() << std::endl; 6251 #endif6252 break;6253 }6254 /////////////////////////6255 case CC_SEND_CLEANUP_ACK: // send one flit for a cleanup acknowledgement6256 {6257 if(not p_dspin_m2p.read) break;6258 6259 r_cleanup_to_cc_send_req = false;6260 r_cc_send_fsm = CC_SEND_CLEANUP_IDLE;6261 6262 #if DEBUG_MEMC_CC_SEND6263 if(m_debug)6264 std::cout << " <MEMC " << name()6265 << " CC_SEND_CLEANUP_ACK> Cleanup Ack for srcid "6266 << std::hex << r_cleanup_to_cc_send_srcid.read() << std::endl;6267 6148 #endif 6268 6149 break; … … 6500 6381 DspinDhccpParam::dspin_get( 6501 6382 p_dspin_p2m.data.read(), 6502 DspinDhccpParam:: FROM_L1_TYPE);6383 DspinDhccpParam::P2M_TYPE); 6503 6384 6504 6385 if((type == DspinDhccpParam::TYPE_CLEANUP_DATA) or … … 8041 7922 case CC_SEND_WRITE_IDLE: 8042 7923 case CC_SEND_CAS_IDLE: 8043 case CC_SEND_CLEANUP_IDLE:8044 7924 { 8045 7925 break; … … 8076 7956 DspinDhccpParam::dspin_set( flit, 8077 7957 multi_inval_type, 8078 DspinDhccpParam:: FROM_MC_TYPE);7958 DspinDhccpParam::M2P_TYPE); 8079 7959 p_dspin_m2p.write = true; 8080 7960 p_dspin_m2p.data = flit; … … 8093 7973 break; 8094 7974 } 8095 ////////////////////////8096 case CC_SEND_CLEANUP_ACK:8097 {8098 uint8_t cleanup_ack_type;8099 if(r_cleanup_to_cc_send_inst.read())8100 {8101 cleanup_ack_type = DspinDhccpParam::TYPE_CLEANUP_ACK_INST;8102 }8103 else8104 {8105 cleanup_ack_type = DspinDhccpParam::TYPE_CLEANUP_ACK_DATA;8106 }8107 8108 uint64_t flit = 0;8109 uint64_t dest =8110 r_cleanup_to_cc_send_srcid.read() <<8111 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S);8112 8113 DspinDhccpParam::dspin_set(8114 flit,8115 dest,8116 DspinDhccpParam::CLEANUP_ACK_DEST);8117 8118 DspinDhccpParam::dspin_set(8119 flit,8120 r_cleanup_to_cc_send_set_index.read(),8121 DspinDhccpParam::CLEANUP_ACK_SET);8122 8123 DspinDhccpParam::dspin_set(8124 flit,8125 r_cleanup_to_cc_send_way_index.read(),8126 DspinDhccpParam::CLEANUP_ACK_WAY);8127 8128 DspinDhccpParam::dspin_set(8129 flit,8130 cleanup_ack_type,8131 DspinDhccpParam::FROM_MC_TYPE);8132 8133 p_dspin_m2p.eop = true;8134 p_dspin_m2p.write = true;8135 p_dspin_m2p.data = flit;8136 8137 break;8138 }8139 8140 7975 /////////////////////////////////// 8141 7976 case CC_SEND_XRAM_RSP_INVAL_HEADER: … … 8171 8006 DspinDhccpParam::dspin_set( flit, 8172 8007 multi_inval_type, 8173 DspinDhccpParam:: FROM_MC_TYPE);8008 DspinDhccpParam::M2P_TYPE); 8174 8009 p_dspin_m2p.write = true; 8175 8010 p_dspin_m2p.data = flit; … … 8209 8044 DspinDhccpParam::dspin_set( flit, 8210 8045 1ULL, 8211 DspinDhccpParam:: FROM_MC_BC);8046 DspinDhccpParam::M2P_BC); 8212 8047 p_dspin_m2p.write = true; 8213 8048 p_dspin_m2p.data = flit; … … 8300 8135 flit, 8301 8136 multi_updt_type, 8302 DspinDhccpParam:: FROM_MC_TYPE);8137 DspinDhccpParam::M2P_TYPE); 8303 8138 8304 8139 p_dspin_m2p.write = true; … … 8393 8228 flit, 8394 8229 multi_updt_type, 8395 DspinDhccpParam:: FROM_MC_TYPE);8230 DspinDhccpParam::M2P_TYPE); 8396 8231 8397 8232 p_dspin_m2p.write = true; … … 8464 8299 } 8465 8300 8301 //////////////////////////////////////////////////////////////////// 8302 // p_dspin_clack port (CLEANUP FSM) 8303 //////////////////////////////////////////////////////////////////// 8304 8305 switch(r_cleanup_fsm.read()) 8306 { 8307 case CLEANUP_IDLE: 8308 case CLEANUP_GET_NLINE: 8309 case CLEANUP_DIR_REQ: 8310 case CLEANUP_DIR_LOCK: 8311 case CLEANUP_DIR_WRITE: 8312 case CLEANUP_HEAP_REQ: 8313 case CLEANUP_HEAP_LOCK: 8314 case CLEANUP_HEAP_SEARCH: 8315 case CLEANUP_HEAP_CLEAN: 8316 case CLEANUP_HEAP_FREE: 8317 case CLEANUP_IVT_LOCK: 8318 case CLEANUP_IVT_DECREMENT: 8319 case CLEANUP_IVT_CLEAR: 8320 case CLEANUP_WRITE_RSP: 8321 case CLEANUP_CONFIG_ACK: 8322 p_dspin_clack.write = false; 8323 p_dspin_clack.eop = false; 8324 p_dspin_clack.data = 0; 8325 8326 break; 8327 8328 case CLEANUP_SEND_CLACK: 8329 { 8330 uint8_t cleanup_ack_type; 8331 if(r_cleanup_inst.read()) 8332 { 8333 cleanup_ack_type = DspinDhccpParam::TYPE_CLACK_INST; 8334 } 8335 else 8336 { 8337 cleanup_ack_type = DspinDhccpParam::TYPE_CLACK_DATA; 8338 } 8339 8340 uint64_t flit = 0; 8341 uint64_t dest = 8342 r_cleanup_srcid.read() << 8343 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 8344 8345 DspinDhccpParam::dspin_set( 8346 flit, 8347 dest, 8348 DspinDhccpParam::CLACK_DEST); 8349 8350 DspinDhccpParam::dspin_set( 8351 flit, 8352 r_cleanup_nline.read() & 0xFFFF, 8353 DspinDhccpParam::CLACK_SET); 8354 8355 DspinDhccpParam::dspin_set( 8356 flit, 8357 r_cleanup_way_index.read(), 8358 DspinDhccpParam::CLACK_WAY); 8359 8360 DspinDhccpParam::dspin_set( 8361 flit, 8362 cleanup_ack_type, 8363 DspinDhccpParam::CLACK_TYPE); 8364 8365 p_dspin_clack.eop = true; 8366 p_dspin_clack.write = true; 8367 p_dspin_clack.data = flit; 8368 } 8369 break; 8370 } 8371 8466 8372 /////////////////////////////////////////////////////////////////// 8467 8373 // p_dspin_p2m port (CC_RECEIVE FSM) 8468 8374 /////////////////////////////////////////////////////////////////// 8469 p_dspin_p2m.read = false;8375 // 8470 8376 switch(r_cc_receive_fsm.read()) 8471 8377 { 8472 8378 case CC_RECEIVE_IDLE: 8473 8379 { 8380 p_dspin_p2m.read = false; 8474 8381 break; 8475 8382 }
Note: See TracChangeset
for help on using the changeset viewer.