Changeset 604 for branches/RWT/modules/vci_mem_cache/caba
- Timestamp:
- Dec 17, 2013, 3:21:07 PM (11 years ago)
- Location:
- branches/RWT/modules/vci_mem_cache/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r545 r604 633 633 634 634 void print_stats(bool activity_counters, bool stats); 635 void print_trace( );635 void print_trace( size_t detailled = 0 ); 636 636 void cache_monitor(addr_t addr); 637 637 void start_monitor(addr_t addr, addr_t length); -
branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r545 r604 134 134 "CONFIG_IDLE", 135 135 "CONFIG_LOOP", 136 "CONFIG_WAIT" 136 "CONFIG_WAIT", 137 137 "CONFIG_RSP", 138 138 "CONFIG_DIR_REQ", … … 140 140 "CONFIG_IVT_LOCK", 141 141 "CONFIG_BC_SEND", 142 "CONFIG_INVAL_SEND" 142 "CONFIG_INVAL_SEND", 143 143 "CONFIG_HEAP_REQ", 144 144 "CONFIG_HEAP_SCAN", … … 412 412 m_broadcast_boundaries(0x7C1F), 413 413 414 r_tgt_cmd_fsm("r_tgt_cmd_fsm"),415 416 414 // FIFOs 417 415 m_cmd_read_addr_fifo("m_cmd_read_addr_fifo", 4), … … 438 436 m_cc_receive_to_cleanup_fifo("m_cc_receive_to_cleanup_fifo", 4), 439 437 m_cc_receive_to_multi_ack_fifo("m_cc_receive_to_multi_ack_fifo", 4), 438 439 r_tgt_cmd_fsm("r_tgt_cmd_fsm"), 440 440 441 441 r_config_fsm( "r_config_fsm" ), … … 574 574 r_ixr_cmd_wdata = new sc_signal<data_t>[nwords]; 575 575 576 // Allocation for ODCCP576 // Allocation for RWT 577 577 r_cleanup_data = new sc_signal<data_t>[nwords]; 578 578 r_cleanup_to_ixr_cmd_data = new sc_signal<data_t>[nwords]; … … 679 679 680 680 ////////////////////////////////////////////////// 681 tmpl(void) ::print_trace()682 681 tmpl(void)::print_trace( size_t detailed ) 682 ////////////////////////////////////////////////// 683 683 { 684 684 std::cout << "MEMC " << name() << std::endl; … … 701 701 << " | " << alloc_ivt_fsm_str[r_alloc_ivt_fsm.read()] 702 702 << " | " << alloc_heap_fsm_str[r_alloc_heap_fsm.read()] << std::endl; 703 704 if ( detailed ) m_trt.print(0); 703 705 } 704 706 … … 764 766 << "[037] GET (UNIMPLEMENTED) = " << m_cpt_get << std::endl 765 767 << "[038] WRITE BROADCAST = " << m_cpt_write_broadcast << std::endl 768 << std::endl 769 << "[039] CLEANUP DATA (FLITS) = " << m_cpt_cleanup_data * 16 << std::endl 770 << "[040] NCC TO CC (READ) = " << m_cpt_ncc_to_cc_read << std::endl 771 << "[041] NCC TO CC (WRITE) = " << m_cpt_ncc_to_cc_write << std::endl 772 << "[042] NCC TO CC (TOTAL) = " << m_cpt_ncc_to_cc << std::endl 766 773 << std::endl; 767 774 } … … 976 983 r_tgt_rsp_key_sent = false; 977 984 978 // ODCCP985 // RWT 979 986 r_cleanup_data_index = 0; 980 987 r_cleanup_trdid = 0; … … 1110 1117 size_t xram_rsp_to_cc_send_fifo_srcid = 0; 1111 1118 1119 bool config_rsp_lines_incr = false; 1120 bool config_rsp_lines_cleanup_decr = false; 1121 bool config_rsp_lines_ixr_rsp_decr = false; 1122 1112 1123 bool config_to_cc_send_fifo_put = false; 1113 1124 bool config_to_cc_send_fifo_get = false; … … 1348 1359 if (wdata % (m_words << 2)) lines++; 1349 1360 r_config_cmd_lines = lines; 1350 r_config_rsp_lines = lines;1361 r_config_rsp_lines = 0; 1351 1362 } 1352 1363 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set cmd type … … 1614 1625 bool valid = m_upt.decrement(r_multi_ack_upt_index.read(), count); 1615 1626 1616 /*ODCCP*/ //m_upt.print();1617 1627 1618 1628 if(not valid) … … 1718 1728 // the command for line (n+1). It decrements the r_config_cmd_lines counter until 1719 1729 // the last request has been registered in TRT (for a SYNC), or in IVT (for an INVAL). 1730 // The r_config_rsp_lines counter contains the number of expected responses from 1731 // CLEANUP FSM (inval) or from IXR_RSP FSM (sync). This register is incremented by 1732 // the CONFIG FSM (each time a transaction is requested), and decremented by the 1733 // CLEANUP or IXR_RSP FSMs(each time a response is received. As this register can 1734 // be concurently accessed by those three FSMs, it is implemented as an [incr/decr] 1735 // counter. 1720 1736 // 1721 1737 // - INVAL request: … … 1879 1895 { 1880 1896 r_config_cmd_lines = r_config_cmd_lines.read() - 1; 1881 r_config_rsp_lines = r_config_rsp_lines.read() - 1;1882 1897 r_config_address = r_config_address.read() + (m_words<<2); 1883 1898 r_config_fsm = CONFIG_LOOP; … … 1981 1996 0, // ll_key: unused 1982 1997 true ); // requested by config FSM 1998 config_rsp_lines_incr = true; 1983 1999 r_config_fsm = CONFIG_PUT_REQ; 1984 2000 … … 2031 2047 m_cache_directory.inval( way, set ); 2032 2048 r_config_cmd_lines = r_config_cmd_lines.read() - 1; 2033 r_config_rsp_lines = r_config_rsp_lines.read() - 1;2034 2049 r_config_address = r_config_address.read() + (m_words<<2); 2035 2050 r_config_fsm = CONFIG_LOOP; … … 2067 2082 m_cache_directory.inval( way, set ); 2068 2083 r_config_ivt_index = index; 2084 config_rsp_lines_incr = true; 2069 2085 if ( broadcast ) r_config_fsm = CONFIG_BC_SEND; 2070 2086 else r_config_fsm = CONFIG_INVAL_SEND; … … 3885 3901 nb_copies, 3886 3902 index); 3887 /*ODCCP*/ //m_upt.print();3888 3903 #if DEBUG_MEMC_WRITE 3889 3904 if( m_debug and wok ) … … 4071 4086 //////////////////////// 4072 4087 case IXR_CMD_CLEANUP_IDLE: 4073 /*ODCCP*///std::cout << "IXR_CMD_CLEANUP_IDLE" << std::endl;4074 4088 if (r_read_to_ixr_cmd_req.read()) r_ixr_cmd_fsm = IXR_CMD_READ_TRT; 4075 4089 else if(r_write_to_ixr_cmd_req.read()) r_ixr_cmd_fsm = IXR_CMD_WRITE_TRT; … … 4352 4366 if(p_vci_ixr.cmdack.read()) 4353 4367 { 4354 /*ODCCP*/ //std::cout << "IXR_CMD_CLEANUP_DATA_SEND STATE at cycle : " << std::dec << m_cpt_cycles << std::endl;4355 4368 if(r_ixr_cmd_word.read() == (m_words - 2)) 4356 4369 { 4357 /*ODCCP*/ //std::cout << "IXR_CMD_CLEANUP_DATA_SEND GO TO IXR_CMD_CLEANUP_IDLE" << std::endl;4358 4370 r_ixr_cmd_fsm = IXR_CMD_CLEANUP_IDLE; 4359 4371 r_cleanup_to_ixr_cmd_req = false; … … 4467 4479 { 4468 4480 size_t index = r_ixr_rsp_trt_index.read(); 4469 if (m_trt.is_config(index) ) r_config_rsp_lines = r_config_rsp_lines.read() - 1; 4470 m_trt.erase(index); 4471 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4472 4473 // std::cout << "remove a valid slot in trt index = " << r_ixr_rsp_trt_index.read()<< std::endl; 4481 if (m_trt.is_config(index)) // it's a config transaction 4482 { 4483 config_rsp_lines_ixr_rsp_decr = true; 4484 m_trt.erase(index); 4485 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4486 } 4487 else // not a config transaction 4488 { 4489 m_trt.erase(index); 4490 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4491 } 4492 4474 4493 #if DEBUG_MEMC_IXR_RSP 4475 4494 if(m_debug) … … 5355 5374 case CLEANUP_DIR_WRITE: 5356 5375 { 5357 /*ODCCP*///std::cout << "CLEANUP_DIR_WRITE" << std::endl;5358 5376 // Update the directory entry without heap access 5359 5377 if(r_alloc_dir_fsm.read() != ALLOC_DIR_CLEANUP) … … 5919 5937 "MEMC ERROR in CLEANUP_IVT_CLEAR state"); 5920 5938 5921 r_config_rsp_lines = r_config_rsp_lines.read() - 1;5939 config_rsp_lines_cleanup_decr = true; 5922 5940 } 5923 5941 5924 5942 if ( r_cleanup_need_rsp.read() ) r_cleanup_fsm = CLEANUP_WRITE_RSP; 5925 else if ( r_cleanup_ncc.read() 5943 else if ( r_cleanup_ncc.read() ) r_cleanup_fsm = CLEANUP_IXR_REQ; 5926 5944 else r_cleanup_fsm = CLEANUP_SEND_CLACK; 5927 5945 … … 5947 5965 r_cleanup_to_tgt_rsp_type = true; 5948 5966 5949 if (r_cleanup_ncc.read() )5967 if (r_cleanup_ncc.read() ) 5950 5968 { 5951 5969 r_cleanup_fsm = CLEANUP_IXR_REQ;//need to put data to the XRAM … … 8945 8963 //////////////////////// 8946 8964 case ALLOC_TRT_CLEANUP: 8947 /*ODCCP*///std::cout << "TRT ALLOCATED TO CLEANUP" << std::endl;8948 8965 if(r_cleanup_fsm.read() != CLEANUP_IXR_REQ) 8949 8966 { … … 9294 9311 cas_to_cc_send_fifo_srcid ); 9295 9312 m_cpt_cycles++; 9313 9314 //////////////////////////////////////////////////////////////////////////////////// 9315 // Update r_config_rsp_lines counter. 9316 // The three sources of (increment / decrement) are CONFIG / CLEANUP / IXR_RSP FSMs 9317 //////////////////////////////////////////////////////////////////////////////////// 9318 if ( config_rsp_lines_incr and not 9319 (config_rsp_lines_cleanup_decr or config_rsp_lines_ixr_rsp_decr) ) 9320 { 9321 r_config_rsp_lines = r_config_rsp_lines.read() + 1; 9322 } 9323 if ( not config_rsp_lines_incr and 9324 (config_rsp_lines_cleanup_decr or config_rsp_lines_ixr_rsp_decr) ) 9325 { 9326 r_config_rsp_lines = r_config_rsp_lines.read() - 1; 9327 } 9296 9328 9297 9329 } // end transition() … … 9645 9677 DspinDhccpParam::MULTI_INVAL_SRCID); 9646 9678 9679 // MODIFIED FOR CONFIG INVAL (solution 1 bit in flit multi_inval) 9680 DspinDhccpParam::dspin_set( flit, 9681 1, 9682 DspinDhccpParam::MULTI_INVAL_IS_CONFIG); 9683 9647 9684 DspinDhccpParam::dspin_set( flit, 9648 9685 r_config_to_cc_send_trdid.read(), … … 9723 9760 ///////////////////////////////////// 9724 9761 case CC_SEND_CONFIG_BRDCAST_HEADER: 9762 { 9763 uint64_t flit = 0; 9764 9765 DspinDhccpParam::dspin_set( flit, 9766 m_broadcast_boundaries, 9767 DspinDhccpParam::BROADCAST_BOX); 9768 // MODIFIED FOR CONFIG INVAL (solution 1 bit in flit multi_inval) 9769 DspinDhccpParam::dspin_set( flit, 9770 1, 9771 DspinDhccpParam::MULTI_INVAL_IS_CONFIG); 9772 9773 DspinDhccpParam::dspin_set( flit, 9774 m_cc_global_id, 9775 DspinDhccpParam::BROADCAST_SRCID); 9776 9777 DspinDhccpParam::dspin_set( flit, 9778 1ULL, 9779 DspinDhccpParam::M2P_BC); 9780 p_dspin_m2p.write = true; 9781 p_dspin_m2p.data = flit; 9782 break; 9783 } 9784 ///////////////////////////////////// 9725 9785 case CC_SEND_XRAM_RSP_BRDCAST_HEADER: 9726 9786 case CC_SEND_WRITE_BRDCAST_HEADER:
Note: See TracChangeset
for help on using the changeset viewer.