Changeset 355 for branches/v5/modules/vci_cc_vcache_wrapper
- Timestamp:
- Apr 5, 2013, 7:21:36 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v5/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r351 r355 34 34 #define DEBUG_DCACHE 1 35 35 #define DEBUG_ICACHE 1 36 #define DEBUG_CLEANUP 036 #define DEBUG_CLEANUP 1 37 37 38 38 namespace soclib { … … 1488 1488 if (m_ireq.valid) m_cost_ins_miss_frz++; 1489 1489 1490 // coherence interrupt1491 if ( r_cc_receive_icache_req.read() )1492 {1493 r_icache_fsm = ICACHE_CC_CHECK;1494 r_icache_fsm_save = r_icache_fsm.read();1495 break;1496 }1497 1498 1490 #ifdef INSTRUMENTATION 1499 1491 m_cpt_icache_dir_write++; … … 1736 1728 #endif 1737 1729 } 1738 else if( ((r_icache_fsm_save.read() == ICACHE_MISS_WAIT) or 1730 else if( ((r_icache_fsm_save.read() == ICACHE_MISS_SELECT) or 1731 (r_icache_fsm_save.read() == ICACHE_MISS_WAIT) or 1739 1732 (r_icache_fsm_save.read() == ICACHE_MISS_DIR_UPDT)) and 1740 1733 ((r_icache_vci_paddr.read() & mask) == (paddr & mask)) ) // matching … … 3304 3297 { 3305 3298 pt_updt = true; 3306 r_dcache_vci_cas_old 3307 r_dcache_vci_cas_new 3299 r_dcache_vci_cas_old = pte_flags; 3300 r_dcache_vci_cas_new = pte_flags | PTE_L_MASK; 3308 3301 pte_flags = pte_flags | PTE_L_MASK; 3309 3302 r_dcache_tlb_pte_flags = pte_flags; … … 3315 3308 { 3316 3309 pt_updt = true; 3317 r_dcache_vci_cas_old 3318 r_dcache_vci_cas_new 3310 r_dcache_vci_cas_old = pte_flags; 3311 r_dcache_vci_cas_new = pte_flags | PTE_R_MASK; 3319 3312 pte_flags = pte_flags | PTE_R_MASK; 3320 3313 r_dcache_tlb_pte_flags = pte_flags; … … 3828 3821 &found, 3829 3822 &cleanup ); 3823 3830 3824 if ( found ) 3831 3825 { … … 3870 3864 if ( m_dreq.valid) m_cost_data_miss_frz++; 3871 3865 3872 // coherence request (from CC_RECEIVE FSM)3873 if ( r_cc_receive_dcache_req.read() )3874 {3875 r_dcache_fsm = DCACHE_CC_CHECK;3876 r_dcache_fsm_cc_save = r_dcache_fsm.read();3877 break;3878 }3879 3880 3866 size_t way = r_dcache_miss_way.read(); 3881 3867 size_t set = r_dcache_miss_set.read(); … … 3927 3913 { 3928 3914 if ( m_dreq.valid) m_cost_data_miss_frz++; 3929 3930 /**/3931 #if DEBUG_DCACHE3932 if ( m_debug_dcache_fsm )3933 {3934 std::cout << " <PROC " << name()3935 << " r_cc_receive_dcache_req = " << r_cc_receive_dcache_req.read() << std::endl;3936 std::cout << " <PROC " << name()3937 << " r_dcache_miss_inval = " << r_dcache_miss_inval.read() << std::endl;3938 }3939 #endif3940 3915 3941 3916 // coherence request (from CC_RECEIVE FSM) … … 4013 3988 if ( m_dreq.valid) m_cost_data_miss_frz++; 4014 3989 4015 /**/4016 #if DEBUG_DCACHE4017 if ( m_debug_dcache_fsm )4018 {4019 std::cout << " <PROC " << name()4020 << " r_cc_receive_dcache_req = " << r_cc_receive_dcache_req.read() << std::endl;4021 std::cout << " <PROC " << name()4022 << " r_dcache_miss_inval = " << r_dcache_miss_inval.read() << std::endl;4023 }4024 #endif4025 4026 3990 if ( r_vci_rsp_fifo_dcache.rok() ) // one word available 4027 3991 { … … 4065 4029 if ( m_dreq.valid) m_cost_data_miss_frz++; 4066 4030 4067 /**/4068 #if DEBUG_DCACHE4069 if ( m_debug_dcache_fsm )4070 {4071 std::cout << " <PROC " << name()4072 << " r_cc_receive_dcache_req = " << r_cc_receive_dcache_req.read() << std::endl;4073 std::cout << " <PROC " << name()4074 << " r_dcache_miss_inval = " << r_dcache_miss_inval.read() << std::endl;4075 }4076 #endif4077 4078 4031 // coherence request (from CC_RECEIVE FSM) 4079 4032 if ( r_cc_receive_dcache_req.read() ) … … 4420 4373 #endif 4421 4374 } 4422 else if( ((r_dcache_fsm_cc_save == DCACHE_MISS_WAIT) or 4375 else if( ((r_dcache_fsm_cc_save == DCACHE_MISS_SELECT) or 4376 (r_dcache_fsm_cc_save == DCACHE_MISS_WAIT) or 4423 4377 (r_dcache_fsm_cc_save == DCACHE_MISS_DIR_UPDT)) and 4424 4378 ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)) ) // matching … … 5326 5280 case CC_SEND_CLEANUP_1: 5327 5281 { 5328 /**/5329 #if DEBUG_DCACHE5330 if ( m_debug_dcache_fsm )5331 {5332 std::cout << " <PROC " << name()5333 << " r_dcache_cc_send_nline = " << r_dcache_cc_send_nline.read() << std::endl;5334 }5335 #endif5336 5282 // wait for the first flit to be consumed 5337 5283 if (p_dspin_out.read.read()) … … 5342 5288 /////////////////////////// 5343 5289 case CC_SEND_CLEANUP_2: 5344 /**/ 5345 #if DEBUG_DCACHE 5346 if ( m_debug_dcache_fsm ) 5347 { 5348 std::cout << " <PROC " << name() 5349 << " r_dcache_cc_send_nline = " << r_dcache_cc_send_nline.read() << std::endl; 5350 } 5351 #endif 5352 { 5353 assert( p_dspin_out.read.read() and 5354 "The interconnect should accept the second cleanup flit instantly" ); 5355 5290 { 5356 5291 // wait for the second flit to be consumed 5357 5292 if (p_dspin_out.read.read()) … … 5401 5336 case CC_RECEIVE_IDLE: 5402 5337 { 5403 /**/5404 #if DEBUG_DCACHE5405 if ( m_debug_dcache_fsm )5406 {5407 std::cout << " <PROC " << name()5408 << " r_cc_receive_dcache_req = " << r_cc_receive_dcache_req.read() << std::endl;5409 std::cout << " <PROC " << name()5410 << " r_dcache_miss_inval = " << r_dcache_miss_inval.read() << std::endl;5411 }5412 #endif5413 5338 // a coherence request has arrived 5414 5339 if (p_dspin_in.write.read()) … … 5481 5406 case CC_RECEIVE_BRDCAST_HEADER: 5482 5407 { 5483 /**/5484 #if DEBUG_DCACHE5485 if ( m_debug_dcache_fsm )5486 {5487 std::cout << " <PROC " << name()5488 << " r_cc_receive_dcache_req = " << r_cc_receive_dcache_req.read() << std::endl;5489 std::cout << " <PROC " << name()5490 << " r_dcache_miss_inval = " << r_dcache_miss_inval.read() << std::endl;5491 }5492 #endif5493 5408 // no actual data in the HEADER, just skip to second flit 5494 5409 r_cc_receive_fsm = CC_RECEIVE_BRDCAST_NLINE; … … 5498 5413 case CC_RECEIVE_BRDCAST_NLINE: 5499 5414 { 5500 /**/5501 #if DEBUG_DCACHE5502 if ( m_debug_dcache_fsm )5503 {5504 std::cout << " <PROC " << name()5505 << " r_cc_receive_dcache_req = " << r_cc_receive_dcache_req.read() << std::endl;5506 std::cout << " <PROC " << name()5507 << " r_dcache_miss_inval = " << r_dcache_miss_inval.read() << std::endl;5508 }5509 #endif5510 5415 // initialize dspin received data 5511 5416 uint64_t receive_data = p_dspin_in.data.read(); … … 5514 5419 // not to actually post a request to an available cache => need a 5515 5420 // flip_flop to check that ? 5516 if (not (r_cc_receive_icache_req.read()) and not (r_cc_receive_dcache_req.read()) )5421 if (not (r_cc_receive_icache_req.read()) and not (r_cc_receive_dcache_req.read()) and (p_dspin_in.write.read())) 5517 5422 { 5518 5423 // request dcache to handle the BROADCAST … … 5559 5464 uint64_t receive_data = p_dspin_in.data.read(); 5560 5465 // for data INVAL, wait for dcache to take the request 5561 if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) )5466 if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) and (p_dspin_in.write.read())) 5562 5467 { 5563 5468 // request dcache to handle the INVAL … … 5570 5475 } 5571 5476 // for ins INVAL, wait for icache to take the request 5572 if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()) )5477 if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()) and (p_dspin_in.write.read())) 5573 5478 { 5574 5479 // request icache to handle the INVAL … … 5614 5519 // for data INVAL, wait for dcache to take the request and fifo to 5615 5520 // be empty 5616 if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) and r_cc_receive_updt_fifo_be.empty() )5521 if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) and r_cc_receive_updt_fifo_be.empty() and (p_dspin_in.write.read())) 5617 5522 { 5618 5523 r_cc_receive_dcache_nline = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_NLINE); … … 5625 5530 // for ins INVAL, wait for icache to take the request and fifo to be 5626 5531 // empty 5627 if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()) and r_cc_receive_updt_fifo_be.empty() )5532 if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()) and r_cc_receive_updt_fifo_be.empty() and (p_dspin_in.write.read())) 5628 5533 { 5629 5534 r_cc_receive_icache_nline = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_NLINE); … … 5641 5546 case CC_RECEIVE_UPDT_DATA: 5642 5547 { 5643 if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) )5548 if ((r_cc_receive_data_ins.read() == 0) and not (r_cc_receive_dcache_req.read()) and (p_dspin_in.write.read())) 5644 5549 r_cc_receive_dcache_req = true; 5645 if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()) )5550 if ((r_cc_receive_data_ins.read() == 1) and not (r_cc_receive_icache_req.read()) and (p_dspin_in.write.read())) 5646 5551 r_cc_receive_icache_req = true; 5647 5552 … … 5649 5554 uint64_t receive_data = p_dspin_in.data.read(); 5650 5555 // wait for the fifo 5651 if (r_cc_receive_updt_fifo_be.wok() )5556 if (r_cc_receive_updt_fifo_be.wok() and (p_dspin_in.write.read())) 5652 5557 { 5653 5558 cc_receive_updt_fifo_be = DspinDhccpParam::dspin_get(receive_data,DspinDhccpParam::MULTI_UPDT_BE); … … 5980 5885 p_dspin_out.data = dspin_send_data; 5981 5886 p_dspin_out.write = true; 5887 5982 5888 break; 5983 5889 }
Note: See TracChangeset
for help on using the changeset viewer.