- Timestamp:
- Sep 16, 2013, 4:27:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r495 r525 1925 1925 #if DEBUG_MEMC_CONFIG 1926 1926 if(m_debug) 1927 m_trt.print(0);1928 1927 std::cout << " <MEMC " << name() << " CONFIG_TRT_SET> PUT request in TRT:" 1929 1928 << " address = " << std::hex << r_config_address.read() … … 2333 2332 << "CC_SEND req = " << r_read_to_cc_send_req.read() << std::endl 2334 2333 << "CLENAUP req = " <<r_read_to_cleanup_req.read() << std::endl;*/ 2335 if(m_ upt.search_inval(nline, index) or m_upt.is_full() or r_read_to_cc_send_req.read() or r_read_to_cleanup_req.read()) //Check pending inval2334 if(m_ivt.search_inval(nline, index) or m_ivt.is_full() or r_read_to_cc_send_req.read() or r_read_to_cleanup_req.read()) //Check pending inval 2336 2335 { 2337 2336 r_read_fsm = READ_WAIT; … … 2363 2362 //std::cout << "cleanup req (read) on line " << nline << " /on proc " << r_read_copy.read() << std::endl; 2364 2363 2365 m_ upt.set(false,// it's an inval transaction2366 2367 2368 2369 2370 2371 2372 2373 2374 2364 m_ivt.set(false, // it's an inval transaction 2365 false, // it's not a broadcast 2366 false, // it needs a read response 2367 false, // no acknowledge required 2368 m_cmd_read_srcid_fifo.read(), 2369 m_cmd_read_trdid_fifo.read(), 2370 m_cmd_read_pktid_fifo.read(), 2371 nline, 2372 0x1, //Expect only one answer 2373 index); 2375 2374 2376 2375 cmd_read_fifo_get = true; … … 2787 2786 #if DEBUG_MEMC_READ 2788 2787 if(m_debug) 2789 m_trt.print(0);2790 2788 std::cout << " <MEMC " << name() << " READ_TRT_SET> Set a GET in TGT:" 2791 2789 << " address = " << std::hex << m_cmd_read_addr_fifo.read() … … 3089 3087 3090 3088 //std::cout << "WRITE on NCC on line" << std::hex << nline << std::dec << std::endl; 3091 3092 match_inval = m_upt.search_inval(nline, index); 3089 //if there is a matched updt req, we should wait until it is over. Because 3090 //we need the lastest updt data. 3091 match_inval = m_ivt.search_inval(nline, index); 3092 3093 3093 assert ((r_write_count.read() == 1) and "NCC to CC req without copy"); 3094 3094 if(!match_inval and !r_write_to_cc_send_req.read()) … … 3100 3100 r_write_to_cleanup_nline = nline; 3101 3101 3102 m_ upt.set(false, // it's an inval transaction3103 3104 3105 3106 3107 3108 3109 3110 3111 3102 m_ivt.set(false, // it's an inval transaction 3103 false, // it's not a broadcast 3104 true, // it needs no read response 3105 false, // no acknowledge required 3106 m_cmd_write_srcid_fifo.read(), //never read, used for debug 3107 m_cmd_write_trdid_fifo.read(), //never read, used for debug 3108 m_cmd_write_pktid_fifo.read(), //never read, used for debug 3109 nline, 3110 0x1, //Expect only one answer 3111 index); 3112 3112 } 3113 3113 r_write_fsm = WRITE_WAIT; … … 3159 3159 // owner is true when the the first registered copy is the writer itself 3160 3160 bool owner = (((r_write_copy.read() == r_write_srcid.read()) 3161 #if L1_MULTI_CACHE3162 and(r_write_copy_cache.read() ==r_write_pktid.read())3163 #endif3164 3161 ) and not r_write_copy_inst.read()); 3165 3162 … … 3540 3537 } 3541 3538 ///////////////////////// RWT 3542 case WRITE_MISS_IVT_LOCK: // Miss : check UPT3539 case WRITE_MISS_IVT_LOCK: 3543 3540 { 3544 3541 if (r_alloc_ivt_fsm.read() == ALLOC_IVT_WRITE) 3545 3542 { 3546 3543 size_t index; 3547 if(m_ upt.search_inval(m_nline[(addr_t)(r_write_address.read())], index))3544 if(m_ivt.search_inval(m_nline[(addr_t)(r_write_address.read())], index)) 3548 3545 { 3549 3546 r_write_fsm = WRITE_WAIT; … … 3626 3623 } 3627 3624 m_trt.set(r_write_trt_index.read(), 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3625 true, // read request to XRAM 3626 m_nline[(addr_t)(r_write_address.read())], 3627 r_write_srcid.read(), 3628 r_write_trdid.read(), 3629 r_write_pktid.read(), 3630 false, // not a processor read 3631 0, // not a single word 3632 0, // word index 3633 be_vector, 3634 data_vector); 3638 3635 r_write_fsm = WRITE_MISS_XRAM_REQ; 3639 3636 3640 3637 #if DEBUG_MEMC_WRITE 3641 3638 if(m_debug) 3642 m_trt.print(0);3643 3639 std::cout << " <MEMC " << name() << " WRITE_MISS_TRT_SET> Set a new entry in TRT" << std::endl; 3644 3640 #endif … … 3853 3849 #if DEBUG_MEMC_WRITE 3854 3850 if(m_debug) 3855 m_trt.print(0);3856 3851 std::cout << " <MEMC " << name() << " WRITE_BC_DIR_INVAL> Invalidate the directory entry: @ = " 3857 3852 << r_write_address.read() << " / register the put transaction in TRT:" << std::endl; … … 4738 4733 #if DEBUG_MEMC_XRAM_RSP 4739 4734 if(m_debug) 4740 m_trt.print(0);4741 4735 std::cout << " <MEMC " << name() << " XRAM_RSP_TRT_DIRTY>" 4742 4736 << " Set TRT entry for the put transaction" … … 4744 4738 #endif 4745 4739 4746 if( not r_xram_rsp_victim_coherent )4747 std::cout << "a victim coherent not sent trt index =" << r_xram_rsp_trt_index.read() << std::endl;4740 // if( not r_xram_rsp_victim_coherent ) 4741 // std::cout << "a victim coherent not sent trt index =" << r_xram_rsp_trt_index.read() << std::endl; 4748 4742 if(r_xram_rsp_trt_buf.proc_read) r_xram_rsp_fsm = XRAM_RSP_DIR_RSP; 4749 4743 else if(r_xram_rsp_victim_inval.read()) r_xram_rsp_fsm = XRAM_RSP_INVAL; … … 5368 5362 bool match_inval; 5369 5363 5370 match_inval = m_ upt.search_inval(r_cleanup_nline.read(), index);5364 match_inval = m_ivt.search_inval(r_cleanup_nline.read(), index); 5371 5365 assert (match_inval && "VCI MEM CACHE ERROR: In CLEANUP_IVT_LOCK_DATA, NO CORRESPONDING INVAL"); 5372 r_cleanup_read_srcid = m_ upt.srcid(index);5373 r_cleanup_read_trdid = m_ upt.trdid(index);5374 r_cleanup_read_pktid = 0x0 + m_ upt.pktid(index);5375 r_cleanup_read_need_rsp = !m_ upt.need_rsp(index);5366 r_cleanup_read_srcid = m_ivt.srcid(index); 5367 r_cleanup_read_trdid = m_ivt.trdid(index); 5368 r_cleanup_read_pktid = 0x0 + m_ivt.pktid(index); 5369 r_cleanup_read_need_rsp = !m_ivt.need_rsp(index); 5376 5370 r_cleanup_index = index; 5377 5371 … … 5393 5387 case CLEANUP_IVT_CLEAR_DATA://RWT 5394 5388 { 5395 m_ upt.clear(r_cleanup_index.read());5389 m_ivt.clear(r_cleanup_index.read()); 5396 5390 assert ((r_cleanup_read_need_rsp.read() == (r_read_to_cleanup_req.read() && (r_cleanup_nline.read() == r_read_to_cleanup_nline.read()))) && "condition pending read"); 5397 5391 if (r_cleanup_read_need_rsp.read()) … … 5896 5890 if(m_debug) 5897 5891 { 5898 m_trt.print(0);5899 5892 std::cout 5900 5893 << " <MEMC " << name() … … 6553 6546 #if DEBUG_MEMC_CAS 6554 6547 if(m_debug) 6555 m_trt.print(0);6556 6548 std::cout << " <MEMC " << name() << " CAS_BC_DIR_INVAL> Inval DIR & register in TRT:" 6557 6549 << " address = " << m_cmd_cas_addr_fifo.read() << std::endl; … … 6714 6706 if(m_debug) 6715 6707 { 6716 m_trt.print(0);6717 6708 std::cout << " <MEMC " << name() << " CAS_MISS_TRT_SET> Register a GET transaction in TRT" << std::hex 6718 6709 << " / nline = " << m_nline[(addr_t) m_cmd_cas_addr_fifo.read()]
Note: See TracChangeset
for help on using the changeset viewer.