- Timestamp:
- Dec 17, 2013, 3:21:07 PM (11 years ago)
- Location:
- branches/RWT
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/communication/dspin_dhccp_param/caba/source/include/dspin_dhccp_param.h
r477 r604 94 94 * 95 95 * flit 1 96 * ---------------------------------------------------------------------------------------------- 97 * EOP:0 | DEST(14 bits) | X (4 bits) | MEMC_ID(14 bits) | UPDT_INDEX(4 bits) | TYPE:0b1X | BC:098 * ---------------------------------------------------------------------------------------------- 99 * | X: 0 DATA |100 * | 1 INST |96 * ------------------------------------------------------------------------------------------------------------------ 97 * EOP:0 | DEST(14 bits) | X (3 bits) | IS_CONFIG (1 bit) | MEMC_ID(14 bits) | UPDT_INDEX(4 bits) | TYPE:0b1X | BC:0 98 * ------------------------------------------------------------------------------------------------------------------ 99 * | X: 0 DATA | 100 * | 1 INST | 101 101 * flit 2 102 102 * ---------------------------------------------------------------------------------------------- … … 182 182 static const uint8_t CLEANUP_DATA_UPDT_SHIFT = 0; 183 183 static const uint64_t CLEANUP_DATA_UPDT_MASK = ((1ULL<<32)-1); 184 static const uint8_t CLEANUP_NCC_SHIFT = 5;185 static const uint64_t CLEANUP_NCC_MASK = 1;184 static const uint8_t CLEANUP_NCC_SHIFT = 5; 185 static const uint64_t CLEANUP_NCC_MASK = 1; 186 186 187 187 static const uint8_t MULTI_ACK_DEST_SHIFT = CLEANUP_DEST_SHIFT; … … 205 205 static const uint8_t MULTI_INVAL_NLINE_SHIFT = 0; 206 206 static const uint64_t MULTI_INVAL_NLINE_MASK = ((1ULL<<NLINE_WIDTH)-1); 207 static const uint8_t MULTI_INVAL_IS_CONFIG_SHIFT = 21; 208 static const uint64_t MULTI_INVAL_IS_CONFIG_MASK = 1; 207 209 208 210 static const uint8_t MULTI_UPDT_DEST_SHIFT = MULTI_INVAL_DEST_SHIFT; … … 300 302 MULTI_INVAL_UPDT_INDEX, 301 303 MULTI_INVAL_NLINE, 304 MULTI_INVAL_IS_CONFIG, 302 305 303 306 MULTI_UPDT_DEST, … … 343 346 GET_FIELD(flit,MULTI_INVAL_UPDT_INDEX); 344 347 GET_FIELD(flit,MULTI_INVAL_NLINE); 348 GET_FIELD(flit,MULTI_INVAL_IS_CONFIG); 345 349 GET_FIELD(flit,MULTI_UPDT_DEST); 346 350 GET_FIELD(flit,MULTI_UPDT_SRCID); … … 385 389 SET_FIELD(flit,value,MULTI_INVAL_UPDT_INDEX); 386 390 SET_FIELD(flit,value,MULTI_INVAL_NLINE); 391 SET_FIELD(flit,value,MULTI_INVAL_IS_CONFIG); 387 392 SET_FIELD(flit,value,MULTI_UPDT_DEST); 388 393 SET_FIELD(flit,value,MULTI_UPDT_SRCID); -
branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h
r577 r604 604 604 605 605 // communication between CC_RECEIVE FSM and DCACHE FSM 606 sc_signal<bool> r_cc_receive_dcache_req; // cc_receive to dcache request 607 sc_signal<int> r_cc_receive_dcache_type; // cc_receive type of request 608 sc_signal<size_t> r_cc_receive_dcache_way; // cc_receive to dcache way 609 sc_signal<size_t> r_cc_receive_dcache_set; // cc_receive to dcache set 610 sc_signal<size_t> r_cc_receive_dcache_updt_tab_idx; // cc_receive update table index 611 sc_signal<paddr_t> r_cc_receive_dcache_nline; // cache line physical address 606 sc_signal<bool> r_cc_receive_dcache_req; // cc_receive to dcache request 607 sc_signal<int> r_cc_receive_dcache_type; // cc_receive type of request 608 sc_signal<size_t> r_cc_receive_dcache_way; // cc_receive to dcache way 609 sc_signal<size_t> r_cc_receive_dcache_set; // cc_receive to dcache set 610 sc_signal<size_t> r_cc_receive_dcache_updt_tab_idx; // cc_receive update table index 611 sc_signal<paddr_t> r_cc_receive_dcache_nline; // cache line physical address 612 sc_signal<bool> r_cc_receive_dcache_inval_is_config; // inval from memcache is config 612 613 613 614 /////////////////////////////////// -
branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r577 r604 2297 2297 { 2298 2298 2299 2299 2300 if ( r_mmu_mode.read() & DATA_TLB_MASK ) // DTLB activated 2300 2301 { … … 5366 5367 #endif 5367 5368 } 5368 5369 if (cache_state == CACHE_SLOT_STATE_VALID_CC) 5369 // If the line is coherente we send a classic CLEANUP 5370 // If the type of inval request from Memcache is configuration 5371 // (software), we send a classic CLEANUP 5372 if (cache_state == CACHE_SLOT_STATE_VALID_CC or r_cc_receive_dcache_inval_is_config.read()) 5370 5373 { 5371 5374 r_dcache.write_dir( way, … … 5388 5391 r_dcache_cc_send_type = CC_TYPE_CLEANUP; 5389 5392 // MODIFIER POUR DIRTY BIT // 5390 if (cache_state == CACHE_SLOT_STATE_VALID_NCC )5393 if (cache_state == CACHE_SLOT_STATE_VALID_NCC and not r_cc_receive_dcache_inval_is_config.read()) 5391 5394 { 5392 5395 r_dcache_cc_cleanup_line_ncc = true; 5393 5396 if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY) or r_dcache_dirty_save.read() or dirty_save) //must send data 5394 //if (true) //must send data5395 5397 { 5396 5398 r_dcache_cc_cleanup_updt_data = true; … … 6309 6311 case CC_RECEIVE_DATA_INVAL_HEADER: 6310 6312 { 6313 // initialize dspin received data 6314 uint64_t receive_data = p_dspin_m2p.data.read(); 6311 6315 // sample updt tab index in the HEADER, then skip to second flit 6312 6316 r_cc_receive_fsm = CC_RECEIVE_DATA_INVAL_NLINE; 6317 r_cc_receive_dcache_inval_is_config = DspinDhccpParam::dspin_get(receive_data, 6318 DspinDhccpParam::MULTI_INVAL_IS_CONFIG); 6313 6319 break; 6314 6320 } -
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: -
branches/RWT/modules/vci_mem_cache/include/soclib/mem_cache.h
r434 r604 31 31 { 32 32 MEMC_LOCK, 33 MEMC_CMD_TYPE,34 33 MEMC_ADDR_LO, 35 34 MEMC_ADDR_HI, 36 MEMC_BUF_LENGTH 35 MEMC_BUF_LENGTH, 36 MEMC_CMD_TYPE 37 37 }; 38 38
Note: See TracChangeset
for help on using the changeset viewer.