Changeset 403 for trunk/modules/vci_mem_cache
- Timestamp:
- Jun 6, 2013, 9:42:29 PM (11 years ago)
- Location:
- trunk/modules/vci_mem_cache/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r395 r403 106 106 CC_RECEIVE_IDLE, 107 107 CC_RECEIVE_CLEANUP, 108 CC_RECEIVE_CLEANUP_EOP, 108 109 CC_RECEIVE_MULTI_ACK 109 110 }; … … 496 497 GenericFifo<data_t> m_cmd_cas_wdata_fifo; 497 498 498 // Fifo between INIT_RSPfsm and CLEANUP fsm499 // Fifo between CC_RECEIVE fsm and CLEANUP fsm 499 500 GenericFifo<uint64_t> m_cc_receive_to_cleanup_fifo; 500 501 501 // Fifo between INIT_RSPfsm and MULTI_ACK fsm502 // Fifo between CC_RECEIVE fsm and MULTI_ACK fsm 502 503 GenericFifo<uint64_t> m_cc_receive_to_multi_ack_fifo; 503 504 -
trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r395 r403 84 84 "CC_RECEIVE_IDLE", 85 85 "CC_RECEIVE_CLEANUP", 86 "CC_RECEIVE_CLEANUP_EOP", 86 87 "CC_RECEIVE_MULTI_ACK" 87 88 }; … … 1097 1098 switch(r_multi_ack_fsm.read()) 1098 1099 { 1100 /////////////////// 1099 1101 case MULTI_ACK_IDLE: 1100 1102 { 1101 1103 bool multi_ack_fifo_rok = m_cc_receive_to_multi_ack_fifo.rok(); 1102 1104 1103 // None Multicast Acknowledgement received and 1104 // none WRITE FSM UPT decrement request 1105 if( not multi_ack_fifo_rok and 1106 not r_write_to_multi_ack_req.read()) 1107 { 1108 break; 1109 } 1110 1111 // WRITE FSM request to decrement update table response counter 1112 // Priority to Multicast Acknowledgement priority 1105 // No CC_RECEIVE FSM request and no WRITE FSM request 1106 if( not multi_ack_fifo_rok and not r_write_to_multi_ack_req.read()) break; 1107 1108 // handling WRITE FSM request to decrement update table response counter 1109 // if no CC_RECEIVE FSM request 1113 1110 if(not multi_ack_fifo_rok) 1114 1111 { … … 1120 1117 } 1121 1118 1122 // Multicast Acknowledgement received1119 // Handling CC_RECEIVE FSM request 1123 1120 uint64_t flit = m_cc_receive_to_multi_ack_fifo.read(); 1124 1121 … … 1126 1123 DspinDhccpParam::dspin_get(flit, DspinDhccpParam::MULTI_ACK_UPDT_INDEX); 1127 1124 1128 bool eop = 1129 (DspinDhccpParam::dspin_get(flit, DspinDhccpParam::FROM_L1_EOP) == 0x1); 1130 1131 if(updt_index >= m_upt.size()) 1132 { 1133 std::cout 1134 << "VCI_MEM_CACHE ERROR " << name() 1135 << " MULTI_ACK_IDLE state" << std::endl 1136 << "index too large for UPT: " 1137 << std::dec 1138 << " / UPT index = " << updt_index 1139 << " / UPT size = " << m_upt.size() 1140 << std::endl; 1141 1142 exit(0); 1143 } 1144 1145 if(not eop) 1146 { 1147 std::cout 1148 << "VCI_MEM_CACHE ERROR " << name() 1149 << " MULTI_ACK_IDLE state" << std::endl 1150 << "A Multicast Acknowledgement must be an one flit packet" 1151 << std::endl; 1152 1153 exit(0); 1154 } 1125 assert( (updt_index < m_upt.size()) and 1126 "VCI_MEM_CACHE ERROR in MULTI_ACK_IDLE : index too large for UPT"); 1155 1127 1156 1128 cc_receive_to_multi_ack_fifo_get = true; … … 1171 1143 } 1172 1144 1145 //////////////////////// 1173 1146 case MULTI_ACK_UPT_LOCK: 1174 1147 { … … 1214 1187 } 1215 1188 1189 ///////////////////////// 1216 1190 case MULTI_ACK_UPT_CLEAR: 1217 1191 { … … 1258 1232 } 1259 1233 1234 ///////////////////////// 1260 1235 case MULTI_ACK_WRITE_RSP: 1261 1236 { … … 3751 3726 switch(r_cleanup_fsm.read()) 3752 3727 { 3753 case CLEANUP_IDLE:3754 {3755 // Get first DSPIN flit of the CLEANUP command3728 ////////////////// 3729 case CLEANUP_IDLE: // Get first DSPIN flit of the CLEANUP command 3730 { 3756 3731 if(not m_cc_receive_to_cleanup_fifo.rok()) break; 3757 3732 … … 3776 3751 DspinDhccpParam::dspin_get( 3777 3752 flit, 3778 DspinDhccpParam::CLEANUP_NLINE_MSB) 3779 << 32; 3753 DspinDhccpParam::CLEANUP_NLINE_MSB) << 32; 3780 3754 3781 3755 r_cleanup_inst = (type == DspinDhccpParam::TYPE_CLEANUP_INST); … … 3794 3768 m_cpt_cleanup++; 3795 3769 cc_receive_to_cleanup_fifo_get = true; 3796 r_cleanup_fsm = CLEANUP_GET_NLINE;3770 r_cleanup_fsm = CLEANUP_GET_NLINE; 3797 3771 3798 3772 #if DEBUG_MEMC_CLEANUP … … 3810 3784 } 3811 3785 3812 case CLEANUP_GET_NLINE:3813 {3814 // Get second flit of cleanup command3786 /////////////////////// 3787 case CLEANUP_GET_NLINE: // GET second DSPIN flit of the cleanup command 3788 { 3815 3789 if(not m_cc_receive_to_cleanup_fifo.rok()) break; 3816 3790 3817 3791 uint64_t flit = m_cc_receive_to_cleanup_fifo.read(); 3818 3792 3819 addr_t nline = 3820 r_cleanup_nline.read() | 3793 addr_t nline = r_cleanup_nline.read() | 3821 3794 DspinDhccpParam::dspin_get(flit, DspinDhccpParam::CLEANUP_NLINE_LSB); 3822 3795 3823 bool eop =3824 DspinDhccpParam::dspin_get(flit, DspinDhccpParam::FROM_L1_EOP) == 0x1;3825 3826 assert(3827 eop &&3828 "VCI_MEM_CACHE ERROR: "3829 "CLEANUP command must have exactly two flits");3830 3831 3796 cc_receive_to_cleanup_fifo_get = true; 3832 r_cleanup_nline = nline;3833 r_cleanup_fsm = CLEANUP_DIR_REQ;3797 r_cleanup_nline = nline; 3798 r_cleanup_fsm = CLEANUP_DIR_REQ; 3834 3799 3835 3800 #if DEBUG_MEMC_CLEANUP … … 3847 3812 } 3848 3813 3814 ///////////////////// 3849 3815 case CLEANUP_DIR_REQ: 3850 3816 { … … 3865 3831 } 3866 3832 3833 ////////////////////// 3867 3834 case CLEANUP_DIR_LOCK: 3868 3835 { … … 3946 3913 } 3947 3914 3915 /////////////////////// 3948 3916 case CLEANUP_DIR_WRITE: 3949 3917 { … … 4020 3988 } 4021 3989 3990 ////////////////////// 4022 3991 case CLEANUP_HEAP_REQ: 4023 3992 { … … 4039 4008 } 4040 4009 4010 ////////////////////// 4041 4011 case CLEANUP_HEAP_LOCK: 4042 4012 { … … 4198 4168 } 4199 4169 4170 //////////////////////// 4200 4171 case CLEANUP_HEAP_SEARCH: 4201 4172 { … … 5969 5940 switch(r_cc_receive_fsm.read()) 5970 5941 { 5942 ///////////////////// 5971 5943 case CC_RECEIVE_IDLE: 5972 5944 { … … 5993 5965 assert( 5994 5966 false && 5995 "VCI_MEM_CACHE ERROR: Incorrect type in coherence request from " 5996 "L1 Cache"); 5967 "VCI_MEM_CACHE ERROR: Illegal type in coherence request"); 5997 5968 5998 5969 break; 5999 5970 } 6000 case CC_RECEIVE_CLEANUP: 6001 { 6002 // wait for a valid cleanup flit 6003 // wait for a WOK in the CC_RECEIVE to CLEANUP fifo 5971 //////////////////////// 5972 case CC_RECEIVE_CLEANUP: // write first CLEANUP flit in CC_RECEIVE to CLEANUP fifo 5973 { 6004 5974 if(not p_dspin_in.write or not m_cc_receive_to_cleanup_fifo.wok()) break; 6005 5975 6006 bool eop = ( 6007 DspinDhccpParam::dspin_get( 6008 p_dspin_in.data.read(), 6009 DspinDhccpParam::FROM_L1_EOP) 6010 == 0x1); 5976 assert( not p_dspin_in.eop.read() and 5977 "VCI_MEM_CACHE ERROR in CC_RECEIVE : CLEANUP command must have two flits"); 6011 5978 6012 5979 cc_receive_to_cleanup_fifo_put = true; 6013 if(eop) 6014 { 6015 r_cc_receive_fsm = CC_RECEIVE_IDLE; 6016 } 5980 r_cc_receive_fsm = CC_RECEIVE_CLEANUP_EOP; 6017 5981 6018 5982 break; 6019 5983 } 5984 //////////////////////////// 5985 case CC_RECEIVE_CLEANUP_EOP: // write second CLEANUP flit in CC_RECEIVE to CLEANUP fifo 5986 { 5987 if(not p_dspin_in.write or not m_cc_receive_to_cleanup_fifo.wok()) break; 5988 5989 assert( p_dspin_in.eop.read() and 5990 "VCI_MEM_CACHE ERROR in CC_RECEIVE : CLEANUP command must have two flits"); 5991 5992 cc_receive_to_cleanup_fifo_put = true; 5993 r_cc_receive_fsm = CC_RECEIVE_IDLE; 5994 5995 break; 5996 } 5997 5998 ////////////////////////// 6020 5999 case CC_RECEIVE_MULTI_ACK: 6021 6000 { 6022 // wait for a valid multicast acknowledgement flit6023 6001 // wait for a WOK in the CC_RECEIVE to MULTI_ACK fifo 6024 6002 if(not p_dspin_in.write or not m_cc_receive_to_multi_ack_fifo.wok()) break; 6025 6003 6026 bool eop = ( 6027 DspinDhccpParam::dspin_get( 6028 p_dspin_in.data.read(), 6029 DspinDhccpParam::FROM_L1_EOP) 6030 == 0x1); 6004 assert( p_dspin_in.eop.read() and 6005 "VCI_MEM_CACHE ERROR in CC_RECEIVE : MULTI_ACK command must have one flit"); 6031 6006 6032 6007 cc_receive_to_multi_ack_fifo_put = true; 6033 if(eop) 6034 { 6035 r_cc_receive_fsm = CC_RECEIVE_IDLE; 6036 } 6037 6008 r_cc_receive_fsm = CC_RECEIVE_IDLE; 6038 6009 break; 6039 }6040 default:6041 {6042 assert(6043 false &&6044 "VCI_MEM_CACHE ERROR: Invalid state in CC_RECEIVE FSM");6045 6010 } 6046 6011 } … … 7398 7363 7399 7364 //////////////////////////////////////////////////////////////////// 7400 // Initiator command signals on thep_dspin_out port (CC_SEND FSM)7365 // p_dspin_out port (CC_SEND FSM) 7401 7366 //////////////////////////////////////////////////////////////////// 7402 7367 7403 7368 p_dspin_out.write = false; 7369 p_dspin_out.eop = false; 7404 7370 p_dspin_out.data = 0; 7405 7371 7406 7372 switch(r_cc_send_fsm.read()) 7407 7373 { 7408 7374 /////////////////////////// 7409 7375 case CC_SEND_XRAM_RSP_IDLE: 7410 7376 case CC_SEND_WRITE_IDLE: … … 7413 7379 break; 7414 7380 7381 //////////////////////// 7415 7382 case CC_SEND_CLEANUP_ACK: 7416 7383 { … … 7432 7399 DspinDhccpParam::dspin_set( 7433 7400 flit, 7434 1ULL,7435 DspinDhccpParam::FROM_MC_EOP);7436 7437 DspinDhccpParam::dspin_set(7438 flit,7439 7401 dest, 7440 7402 DspinDhccpParam::CLEANUP_ACK_DEST); … … 7455 7417 DspinDhccpParam::FROM_MC_TYPE); 7456 7418 7419 p_dspin_out.eop = true; 7457 7420 p_dspin_out.write = true; 7458 7421 p_dspin_out.data = flit; … … 7461 7424 } 7462 7425 7426 /////////////////////////////////// 7463 7427 case CC_SEND_XRAM_RSP_INVAL_HEADER: 7464 7428 { … … 7506 7470 } 7507 7471 7472 ////////////////////////////////// 7508 7473 case CC_SEND_XRAM_RSP_INVAL_NLINE: 7509 7474 { 7510 7475 uint64_t flit = 0; 7511 7512 DspinDhccpParam::dspin_set(7513 flit,7514 1ULL,7515 DspinDhccpParam::FROM_MC_EOP);7516 7476 7517 7477 DspinDhccpParam::dspin_set( … … 7521 7481 7522 7482 7483 p_dspin_out.eop = true; 7523 7484 p_dspin_out.write = true; 7524 7485 p_dspin_out.data = flit; … … 7527 7488 } 7528 7489 7490 ///////////////////////////////////// 7529 7491 case CC_SEND_XRAM_RSP_BRDCAST_HEADER: 7530 7492 case CC_SEND_WRITE_BRDCAST_HEADER: … … 7553 7515 break; 7554 7516 } 7555 7517 //////////////////////////////////// 7556 7518 case CC_SEND_XRAM_RSP_BRDCAST_NLINE: 7557 7519 { 7558 7520 uint64_t flit = 0; 7559 7560 DspinDhccpParam::dspin_set(7561 flit,7562 1ULL,7563 DspinDhccpParam::FROM_MC_EOP);7564 7521 7565 7522 DspinDhccpParam::dspin_set( … … 7569 7526 7570 7527 p_dspin_out.write = true; 7528 p_dspin_out.eop = true; 7571 7529 p_dspin_out.data = flit; 7572 7530 7573 7531 break; 7574 7532 } 7575 7533 ///////////////////////////////// 7576 7534 case CC_SEND_WRITE_BRDCAST_NLINE: 7577 7535 { 7578 7536 uint64_t flit = 0; 7579 7580 DspinDhccpParam::dspin_set(7581 flit,7582 1ULL,7583 DspinDhccpParam::FROM_MC_EOP);7584 7537 7585 7538 DspinDhccpParam::dspin_set( … … 7589 7542 7590 7543 p_dspin_out.write = true; 7544 p_dspin_out.eop = true; 7591 7545 p_dspin_out.data = flit; 7592 7546 7593 7547 break; 7594 7548 } 7595 7549 /////////////////////////////// 7596 7550 case CC_SEND_CAS_BRDCAST_NLINE: 7597 7551 { 7598 7552 uint64_t flit = 0; 7599 7600 DspinDhccpParam::dspin_set(7601 flit,7602 1ULL,7603 DspinDhccpParam::FROM_MC_EOP);7604 7553 7605 7554 DspinDhccpParam::dspin_set( … … 7609 7558 7610 7559 p_dspin_out.write = true; 7560 p_dspin_out.eop = true; 7611 7561 p_dspin_out.data = flit; 7612 7562 7613 7563 break; 7614 7564 } 7615 7565 /////////////////////////////// 7616 7566 case CC_SEND_WRITE_UPDT_HEADER: 7617 7567 { … … 7658 7608 break; 7659 7609 } 7660 7610 ////////////////////////////// 7661 7611 case CC_SEND_WRITE_UPDT_NLINE: 7662 7612 { … … 7678 7628 break; 7679 7629 } 7680 7630 ///////////////////////////// 7681 7631 case CC_SEND_WRITE_UPDT_DATA: 7682 7632 { 7683 uint8_t multi_updt_eop;7684 if( r_cc_send_cpt.read() ==7685 (r_write_to_cc_send_count.read()-1))7686 {7687 multi_updt_eop = 1;7688 }7689 else7690 {7691 multi_updt_eop = 0;7692 }7693 7633 7694 7634 uint8_t multi_updt_cpt = … … 7699 7639 7700 7640 uint64_t flit = 0; 7701 7702 DspinDhccpParam::dspin_set(7703 flit,7704 (uint64_t)multi_updt_eop,7705 DspinDhccpParam::FROM_MC_EOP);7706 7641 7707 7642 DspinDhccpParam::dspin_set( … … 7716 7651 7717 7652 p_dspin_out.write = true; 7653 p_dspin_out.eop = (r_cc_send_cpt.read() == (r_write_to_cc_send_count.read()-1)); 7718 7654 p_dspin_out.data = flit; 7719 7655 7720 7656 break; 7721 7657 } 7722 7658 //////////////////////////// 7723 7659 case CC_SEND_CAS_UPDT_HEADER: 7724 7660 { … … 7765 7701 break; 7766 7702 } 7767 7703 //////////////////////////// 7768 7704 case CC_SEND_CAS_UPDT_NLINE: 7769 7705 { … … 7785 7721 break; 7786 7722 } 7787 7723 /////////////////////////// 7788 7724 case CC_SEND_CAS_UPDT_DATA: 7789 7725 { 7790 uint8_t multi_updt_eop;7791 if(not r_cas_to_cc_send_is_long.read())7792 {7793 multi_updt_eop = 1;7794 }7795 else7796 {7797 multi_updt_eop = 0;7798 }7799 7800 7726 uint64_t flit = 0; 7801 7802 DspinDhccpParam::dspin_set(7803 flit,7804 (uint64_t)multi_updt_eop,7805 DspinDhccpParam::FROM_MC_EOP);7806 7727 7807 7728 DspinDhccpParam::dspin_set( … … 7816 7737 7817 7738 p_dspin_out.write = true; 7739 p_dspin_out.eop = not r_cas_to_cc_send_is_long.read(); 7818 7740 p_dspin_out.data = flit; 7819 7741 7820 7742 break; 7821 7743 } 7822 7744 //////////////////////////////// 7823 7745 case CC_SEND_CAS_UPDT_DATA_HIGH: 7824 7746 { 7825 7747 uint64_t flit = 0; 7826 7827 DspinDhccpParam::dspin_set(7828 flit,7829 1ULL,7830 DspinDhccpParam::FROM_MC_EOP);7831 7748 7832 7749 DspinDhccpParam::dspin_set( … … 7841 7758 7842 7759 p_dspin_out.write = true; 7760 p_dspin_out.eop = true; 7843 7761 p_dspin_out.data = flit; 7844 7762 … … 7848 7766 7849 7767 /////////////////////////////////////////////////////////////////// 7850 // Target command signals from thep_dspin_in port (CC_RECEIVE FSM)7768 // p_dspin_in port (CC_RECEIVE FSM) 7851 7769 /////////////////////////////////////////////////////////////////// 7852 7770 p_dspin_in.read = false; … … 7858 7776 } 7859 7777 case CC_RECEIVE_CLEANUP: 7778 case CC_RECEIVE_CLEANUP_EOP: 7860 7779 { 7861 7780 p_dspin_in.read = m_cc_receive_to_cleanup_fifo.wok();
Note: See TracChangeset
for help on using the changeset viewer.