Changeset 362 for branches/v5/modules/vci_mem_cache
- Timestamp:
- Apr 10, 2013, 12:58:52 PM (12 years ago)
- Location:
- branches/v5/modules/vci_mem_cache/caba/source
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v5/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r351 r362 782 782 sc_signal<int> r_tgt_rsp_fsm; 783 783 sc_signal<size_t> r_tgt_rsp_cpt; 784 sc_signal<bool> r_tgt_rsp_key_sent; 784 785 785 786 //////////////////////////////////////////////////// -
branches/v5/modules/vci_mem_cache/caba/source/include/xram_transaction.h
r307 r362 78 78 wdata.assign(source.wdata.begin(),source.wdata.end()); 79 79 rerror = source.rerror; 80 ll_key = source.ll_key; 80 81 } 81 82 -
branches/v5/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r354 r362 729 729 r_alloc_heap_reset_cpt = 0; 730 730 731 r_tgt_rsp_key_sent = false; 732 731 733 // Activity counters 732 734 m_cpt_cycles = 0; … … 6195 6197 case TGT_RSP_READ: // send the response to a read 6196 6198 { 6197 if (p_vci_tgt.rspack)6199 if ( p_vci_tgt.rspack ) 6198 6200 { 6199 6201 6200 6202 #if DEBUG_MEMC_TGT_RSP 6201 if(m_debug_tgt_rsp_fsm) 6202 { 6203 std::cout << " <MEMC " << name() << ".TGT_RSP_READ> Read response" 6204 << " / rsrcid = " << std::dec << r_read_to_tgt_rsp_srcid.read() 6205 << " / rtrdid = " << r_read_to_tgt_rsp_trdid.read() 6206 << " / rpktid = " << r_read_to_tgt_rsp_pktid.read() 6207 << " / rdata = " << std::hex << r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read() 6208 << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl; 6209 } 6210 #endif 6211 if(r_tgt_rsp_cpt.read() == (r_read_to_tgt_rsp_word.read() +r_read_to_tgt_rsp_length-1)) 6212 { 6213 r_tgt_rsp_fsm = TGT_RSP_READ_IDLE; 6203 if( m_debug_tgt_rsp_fsm ) 6204 { 6205 std::cout 6206 << " <MEMC " << name() << ".TGT_RSP_READ> Read response" 6207 << " / rsrcid = " << std::dec << r_read_to_tgt_rsp_srcid.read() 6208 << " / rtrdid = " << r_read_to_tgt_rsp_trdid.read() 6209 << " / rpktid = " << r_read_to_tgt_rsp_pktid.read() 6210 << " / rdata = " << std::hex << r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read() 6211 << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl; 6212 } 6213 #endif 6214 6215 uint32_t last_word_idx = r_read_to_tgt_rsp_word.read() + r_read_to_tgt_rsp_length.read() - 1; 6216 bool is_last_word = (r_tgt_rsp_cpt.read() == last_word_idx); 6217 bool is_ll = ((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL); 6218 6219 if ( (is_last_word and not is_ll) or (r_tgt_rsp_key_sent.read() and is_ll)) 6220 { 6221 // Last word in case of READ or second flit in case if LL 6222 r_tgt_rsp_key_sent = false; 6214 6223 r_read_to_tgt_rsp_req = false; 6224 r_tgt_rsp_fsm = TGT_RSP_READ_IDLE; 6215 6225 } 6216 6226 else 6217 6227 { 6218 r_tgt_rsp_cpt = r_tgt_rsp_cpt.read() + 1; 6219 } 6220 } 6221 break; 6222 } 6223 /////////////////// 6228 if (is_ll) 6229 { 6230 r_tgt_rsp_key_sent = true; // Send second flit of ll 6231 } 6232 else 6233 { 6234 r_tgt_rsp_cpt = r_tgt_rsp_cpt.read() + 1; // Send next word of read 6235 } 6236 } 6237 } 6238 break; 6239 } 6240 ////////////////// 6224 6241 case TGT_RSP_WRITE: // send the write acknowledge 6225 6242 { … … 6285 6302 case TGT_RSP_XRAM: // send the response after XRAM access 6286 6303 { 6287 if (p_vci_tgt.rspack)6304 if ( p_vci_tgt.rspack ) 6288 6305 { 6289 6306 6290 6307 #if DEBUG_MEMC_TGT_RSP 6291 if(m_debug_tgt_rsp_fsm) 6292 { 6293 std::cout << " <MEMC " << name() << ".TGT_RSP_XRAM> Response following XRAM access" 6294 << " / rsrcid = " << std::dec << r_xram_rsp_to_tgt_rsp_srcid.read() 6295 << " / rtrdid = " << r_xram_rsp_to_tgt_rsp_trdid.read() 6296 << " / rpktid = " << r_xram_rsp_to_tgt_rsp_pktid.read() 6297 << " / rdata = " << std::hex << r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read() 6298 << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl; 6299 } 6300 #endif 6301 if((r_tgt_rsp_cpt.read() == 6302 (r_xram_rsp_to_tgt_rsp_word.read() +r_xram_rsp_to_tgt_rsp_length.read()-1)) 6303 || r_xram_rsp_to_tgt_rsp_rerror.read()) 6304 { 6305 r_tgt_rsp_fsm = TGT_RSP_XRAM_IDLE; 6308 if( m_debug_tgt_rsp_fsm ) 6309 { 6310 std::cout 6311 << " <MEMC " << name() << ".TGT_RSP_XRAM> Response following XRAM access" 6312 << " / rsrcid = " << std::dec << r_xram_rsp_to_tgt_rsp_srcid.read() 6313 << " / rtrdid = " << r_xram_rsp_to_tgt_rsp_trdid.read() 6314 << " / rpktid = " << r_xram_rsp_to_tgt_rsp_pktid.read() 6315 << " / rdata = " << std::hex << r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read() 6316 << " / cpt = " << std::dec << r_tgt_rsp_cpt.read() << std::endl; 6317 } 6318 #endif 6319 uint32_t last_word_idx = r_xram_rsp_to_tgt_rsp_word.read() + r_xram_rsp_to_tgt_rsp_length.read() - 1; 6320 bool is_last_word = (r_tgt_rsp_cpt.read() == last_word_idx); 6321 bool is_ll = ((r_xram_rsp_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL); 6322 bool is_error = r_xram_rsp_to_tgt_rsp_rerror.read(); 6323 6324 if (((is_last_word or is_error) and not is_ll) or 6325 (r_tgt_rsp_key_sent.read() and is_ll)) 6326 { 6327 // Last word sent in case of READ or second flit sent in case if LL 6328 r_tgt_rsp_key_sent = false; 6306 6329 r_xram_rsp_to_tgt_rsp_req = false; 6330 r_tgt_rsp_fsm = TGT_RSP_XRAM_IDLE; 6307 6331 } 6308 6332 else 6309 6333 { 6310 r_tgt_rsp_cpt = r_tgt_rsp_cpt.read() + 1; 6334 if (is_ll) 6335 { 6336 r_tgt_rsp_key_sent = true; // Send second flit of ll 6337 } 6338 else 6339 { 6340 r_tgt_rsp_cpt = r_tgt_rsp_cpt.read() + 1; // Send next word of read 6341 } 6311 6342 } 6312 6343 } … … 7287 7318 7288 7319 case TGT_RSP_READ: 7289 p_vci_tgt.rspval = true; 7290 if(((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL) 7291 && (r_tgt_rsp_cpt.read() == (r_read_to_tgt_rsp_word.read() +r_read_to_tgt_rsp_length-1))) 7292 p_vci_tgt.rdata = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()-1].read(); 7293 else if((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL) 7294 p_vci_tgt.rdata = r_read_to_tgt_rsp_ll_key.read(); 7320 { 7321 uint32_t last_word_idx = r_read_to_tgt_rsp_word.read() + r_read_to_tgt_rsp_length - 1; 7322 bool is_last_word = (r_tgt_rsp_cpt.read() == last_word_idx); 7323 bool is_ll = ((r_read_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL); 7324 7325 p_vci_tgt.rspval = true; 7326 7327 if ( is_ll and not r_tgt_rsp_key_sent.read() ) 7328 { 7329 // LL response first flit 7330 p_vci_tgt.rdata = r_read_to_tgt_rsp_ll_key.read(); 7331 } 7295 7332 else 7296 p_vci_tgt.rdata = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 7297 p_vci_tgt.rsrcid = r_read_to_tgt_rsp_srcid.read(); 7298 p_vci_tgt.rtrdid = r_read_to_tgt_rsp_trdid.read(); 7299 p_vci_tgt.rpktid = r_read_to_tgt_rsp_pktid.read(); 7300 p_vci_tgt.rerror = 0; 7301 p_vci_tgt.reop = (r_tgt_rsp_cpt.read() == (r_read_to_tgt_rsp_word.read() +r_read_to_tgt_rsp_length-1)); 7302 break; 7333 { 7334 // LL response second flit or READ response 7335 p_vci_tgt.rdata = r_read_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 7336 } 7337 7338 p_vci_tgt.rsrcid = r_read_to_tgt_rsp_srcid.read(); 7339 p_vci_tgt.rtrdid = r_read_to_tgt_rsp_trdid.read(); 7340 p_vci_tgt.rpktid = r_read_to_tgt_rsp_pktid.read(); 7341 p_vci_tgt.rerror = 0; 7342 p_vci_tgt.reop = (is_last_word and not is_ll) or (r_tgt_rsp_key_sent.read() and is_ll); 7343 break; 7344 } 7303 7345 7304 7346 case TGT_RSP_WRITE: … … 7336 7378 7337 7379 case TGT_RSP_XRAM: 7338 p_vci_tgt.rspval = true; 7339 if(((r_xram_rsp_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL) 7340 && (r_tgt_rsp_cpt.read() == (r_xram_rsp_to_tgt_rsp_word.read() +r_xram_rsp_to_tgt_rsp_length-1))) 7341 p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_ll_key.read(); 7342 else 7343 p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 7344 p_vci_tgt.rsrcid = r_xram_rsp_to_tgt_rsp_srcid.read(); 7345 p_vci_tgt.rtrdid = r_xram_rsp_to_tgt_rsp_trdid.read(); 7346 p_vci_tgt.rpktid = r_xram_rsp_to_tgt_rsp_pktid.read(); 7347 p_vci_tgt.rerror = r_xram_rsp_to_tgt_rsp_rerror.read(); 7348 p_vci_tgt.reop = ((r_tgt_rsp_cpt.read() 7349 == (r_xram_rsp_to_tgt_rsp_word.read() +r_xram_rsp_to_tgt_rsp_length.read()-1)) 7350 || r_xram_rsp_to_tgt_rsp_rerror.read()); 7351 break; 7380 { 7381 uint32_t last_word_idx = r_xram_rsp_to_tgt_rsp_word.read() + r_xram_rsp_to_tgt_rsp_length.read() - 1; 7382 bool is_last_word = (r_tgt_rsp_cpt.read() == last_word_idx); 7383 bool is_ll = ((r_xram_rsp_to_tgt_rsp_pktid.read() & 0x7) == TYPE_LL); 7384 bool is_error = r_xram_rsp_to_tgt_rsp_rerror.read(); 7385 7386 p_vci_tgt.rspval = true; 7387 7388 if( is_ll and not r_tgt_rsp_key_sent.read() ) { 7389 // LL response first flit 7390 p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_ll_key.read(); 7391 } 7392 else { 7393 // LL response second flit or READ response 7394 p_vci_tgt.rdata = r_xram_rsp_to_tgt_rsp_data[r_tgt_rsp_cpt.read()].read(); 7395 } 7396 7397 p_vci_tgt.rsrcid = r_xram_rsp_to_tgt_rsp_srcid.read(); 7398 p_vci_tgt.rtrdid = r_xram_rsp_to_tgt_rsp_trdid.read(); 7399 p_vci_tgt.rpktid = r_xram_rsp_to_tgt_rsp_pktid.read(); 7400 p_vci_tgt.rerror = is_error; 7401 p_vci_tgt.reop = (((is_last_word or is_error) and not is_ll) or 7402 (r_tgt_rsp_key_sent.read() and is_ll)); 7403 break; 7404 } 7352 7405 7353 7406 case TGT_RSP_INIT:
Note: See TracChangeset
for help on using the changeset viewer.