Changeset 783 for branches/RWT/modules/vci_mem_cache/caba/source/src
- Timestamp:
- Aug 29, 2014, 11:41:01 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r780 r783 616 616 ///////////////////////////////////////////////////// 617 617 tmpl(void) ::cache_monitor(addr_t addr) 618 618 ///////////////////////////////////////////////////// 619 619 { 620 620 size_t way = 0; … … 678 678 ///////////////////////////////////////////////////// 679 679 tmpl(uint32_t)::min_value(uint32_t old_value, uint32_t new_value) 680 680 ///////////////////////////////////////////////////// 681 681 { 682 682 if (old_value < new_value) … … 688 688 ///////////////////////////////////////////////////// 689 689 tmpl(uint32_t)::req_distance(uint32_t req_srcid) 690 690 ///////////////////////////////////////////////////// 691 691 { 692 692 const uint32_t srcid_width = vci_param_int::S; … … 701 701 ///////////////////////////////////////////////////// 702 702 tmpl(bool)::is_local_req(uint32_t req_srcid) 703 703 ///////////////////////////////////////////////////// 704 704 { 705 705 return req_distance(req_srcid) == 0; … … 845 845 ///////////////////////////////////////// 846 846 { 847 m_cpt_reset_count = m_cpt_cycles; 848 m_cpt_read_local = 0; 849 m_cpt_read_remote = 0; 850 m_cpt_read_cost = 0; 851 m_cpt_write_local = 0; 852 m_cpt_write_remote = 0; 853 m_cpt_write_flits_local = 0; 854 m_cpt_write_flits_remote = 0; 855 m_cpt_write_cost = 0; 856 m_cpt_ll_local = 0; 857 m_cpt_ll_remote = 0; 858 m_cpt_ll_cost = 0; 859 m_cpt_sc_local = 0; 860 m_cpt_sc_remote = 0; 861 m_cpt_sc_cost = 0; 862 m_cpt_cas_local = 0; 863 m_cpt_cas_remote = 0; 864 m_cpt_cas_cost = 0; 865 m_cpt_update = 0; 866 m_cpt_update_local = 0; 867 m_cpt_update_remote = 0; 868 m_cpt_update_cost = 0; 869 m_cpt_minval = 0; 870 m_cpt_minval_local = 0; 871 m_cpt_minval_remote = 0; 872 m_cpt_minval_cost = 0; 873 m_cpt_binval = 0; 874 m_cpt_cleanup_local = 0; 875 m_cpt_cleanup_remote = 0; 876 m_cpt_cleanup_cost = 0; 877 m_cpt_read_miss = 0; 878 m_cpt_write_miss = 0; 879 m_cpt_write_dirty = 0; 880 m_cpt_trt_rb = 0; 881 m_cpt_trt_full = 0; 882 m_cpt_get = 0; 883 m_cpt_put = 0; 884 m_cpt_ncc_to_cc_read = 0; 885 m_cpt_ncc_to_cc_write = 0; 886 m_cpt_write_ncc_miss = 0; 847 m_cpt_reset_count = m_cpt_cycles; 848 m_cpt_read_local = 0; 849 m_cpt_read_remote = 0; 850 m_cpt_read_cost = 0; 851 m_cpt_write_local = 0; 852 m_cpt_write_remote = 0; 853 m_cpt_write_flits_local = 0; 854 m_cpt_write_flits_remote = 0; 855 m_cpt_write_cost = 0; 856 m_cpt_write_ncc_miss = 0; 857 m_cpt_ll_local = 0; 858 m_cpt_ll_remote = 0; 859 m_cpt_ll_cost = 0; 860 m_cpt_sc_local = 0; 861 m_cpt_sc_remote = 0; 862 m_cpt_sc_cost = 0; 863 m_cpt_cas_local = 0; 864 m_cpt_cas_remote = 0; 865 m_cpt_cas_cost = 0; 866 m_cpt_update = 0; 867 m_cpt_update_local = 0; 868 m_cpt_update_remote = 0; 869 m_cpt_update_cost = 0; 870 m_cpt_minval = 0; 871 m_cpt_minval_local = 0; 872 m_cpt_minval_remote = 0; 873 m_cpt_minval_cost = 0; 874 m_cpt_binval = 0; 875 m_cpt_write_broadcast = 0; 876 m_cpt_cleanup_local = 0; 877 m_cpt_cleanup_remote = 0; 878 m_cpt_cleanup_cost = 0; 879 m_cpt_read_miss = 0; 880 m_cpt_write_miss = 0; 881 m_cpt_write_dirty = 0; 882 m_cpt_trt_rb = 0; 883 m_cpt_trt_full = 0; 884 m_cpt_get = 0; 885 m_cpt_put = 0; 886 m_cpt_ncc_to_cc_read = 0; 887 m_cpt_ncc_to_cc_write = 0; 888 m_cpt_cleanup_data_local = 0; 889 m_cpt_cleanup_data_remote = 0; 890 m_cpt_cleanup_data_cost = 0; 887 891 } 888 892 … … 941 945 << "[091] REMOTE CLEANUP = " << m_cpt_cleanup_remote << std::endl 942 946 << "[092] CLNUP COST (FLITS * DIST) = " << m_cpt_cleanup_cost << std::endl 943 << "[093] CLEANUP DATA = " << m_cpt_cleanup_data << std::endl 947 << "[093] LOCAL CLEANUP DATA = " << m_cpt_cleanup_data_local << std::endl 948 << "[094] REMOTE CLEANUP DATA = " << m_cpt_cleanup_data_remote << std::endl 949 << "[095] CLEANUP DATA COST = " << m_cpt_cleanup_data_cost << std::endl 944 950 << std::endl 945 951 << "[100] READ MISS = " << m_cpt_read_miss << std::endl … … 1012 1018 ///////////////////////////////// 1013 1019 tmpl(/**/) ::~VciMemCache() 1014 1020 ///////////////////////////////// 1015 1021 { 1016 1022 delete [] m_seg; … … 1042 1048 ////////////////////////////////// 1043 1049 tmpl(void) ::transition() 1044 1050 ////////////////////////////////// 1045 1051 { 1046 1052 using soclib::common::uint32_log2; … … 1187 1193 1188 1194 // Activity counters 1189 m_cpt_reset_count = 0; 1190 m_cpt_cycles = 0; 1191 m_cpt_read_local = 0; 1192 m_cpt_read_remote = 0; 1193 m_cpt_read_cost = 0; 1194 m_cpt_write_local = 0; 1195 m_cpt_write_remote = 0; 1196 m_cpt_write_flits_local = 0; 1197 m_cpt_write_flits_remote = 0; 1198 m_cpt_write_ncc_miss = 0; 1199 m_cpt_write_cost = 0; 1200 m_cpt_ll_local = 0; 1201 m_cpt_ll_remote = 0; 1202 m_cpt_ll_cost = 0; 1203 m_cpt_sc_local = 0; 1204 m_cpt_sc_remote = 0; 1205 m_cpt_sc_cost = 0; 1206 m_cpt_cas_local = 0; 1207 m_cpt_cas_remote = 0; 1208 m_cpt_cas_cost = 0; 1209 m_cpt_update = 0; 1210 m_cpt_update_local = 0; 1211 m_cpt_update_remote = 0; 1212 m_cpt_update_cost = 0; 1213 m_cpt_minval = 0; 1214 m_cpt_minval_local = 0; 1215 m_cpt_minval_remote = 0; 1216 m_cpt_minval_cost = 0; 1217 m_cpt_binval = 0; 1218 m_cpt_cleanup_local = 0; 1219 m_cpt_cleanup_remote = 0; 1220 m_cpt_cleanup_cost = 0; 1195 m_cpt_reset_count = 0; 1196 m_cpt_cycles = 0; 1197 m_cpt_read_local = 0; 1198 m_cpt_read_remote = 0; 1199 m_cpt_read_cost = 0; 1200 m_cpt_write_local = 0; 1201 m_cpt_write_remote = 0; 1202 m_cpt_write_flits_local = 0; 1203 m_cpt_write_flits_remote = 0; 1204 m_cpt_write_ncc_miss = 0; 1205 m_cpt_write_cost = 0; 1206 m_cpt_ll_local = 0; 1207 m_cpt_ll_remote = 0; 1208 m_cpt_ll_cost = 0; 1209 m_cpt_sc_local = 0; 1210 m_cpt_sc_remote = 0; 1211 m_cpt_sc_cost = 0; 1212 m_cpt_cas_local = 0; 1213 m_cpt_cas_remote = 0; 1214 m_cpt_cas_cost = 0; 1215 m_cpt_update = 0; 1216 m_cpt_update_local = 0; 1217 m_cpt_update_remote = 0; 1218 m_cpt_update_cost = 0; 1219 m_cpt_minval = 0; 1220 m_cpt_minval_local = 0; 1221 m_cpt_minval_remote = 0; 1222 m_cpt_minval_cost = 0; 1223 m_cpt_binval = 0; 1224 m_cpt_cleanup_local = 0; 1225 m_cpt_cleanup_remote = 0; 1226 m_cpt_cleanup_cost = 0; 1227 m_cpt_cleanup_data_local = 0; 1228 m_cpt_cleanup_data_remote = 0; 1229 m_cpt_cleanup_data_cost = 0; 1230 1221 1231 1222 1232 m_cpt_read_miss = 0; … … 1270 1280 m_cpt_read_data_miss_NCC = 0; 1271 1281 m_cpt_read_ll_NCC = 0; 1272 m_cpt_read_WTF = 0;1273 m_cpt_cleanup_data = 0;1274 1282 m_cpt_ncc_to_cc_read = 0; 1275 1283 m_cpt_ncc_to_cc_write = 0; … … 5688 5696 "MEMC ERROR in CLEANUP_IDLE state : illegal SRCID value"); 5689 5697 5690 // <Activity Counters>5691 if (is_local_req(srcid)) {5692 m_cpt_cleanup_local++;5693 }5694 else {5695 m_cpt_cleanup_remote++;5696 m_cpt_cleanup_cost += req_distance(srcid);5697 }5698 // </Activity Counters>5699 5698 cc_receive_to_cleanup_fifo_get = true; 5700 5699 r_cleanup_fsm = CLEANUP_GET_NLINE; … … 5720 5719 case CLEANUP_GET_NLINE: // GET second DSPIN flit of the cleanup command 5721 5720 { 5722 if (not m_cc_receive_to_cleanup_fifo.rok()) break;5721 if (not m_cc_receive_to_cleanup_fifo.rok()) break; 5723 5722 5724 5723 uint64_t flit = m_cc_receive_to_cleanup_fifo.read(); 5724 uint32_t srcid = r_cleanup_srcid.read(); 5725 5725 5726 5726 addr_t nline = r_cleanup_nline.read() | 5727 5727 DspinRwtParam::dspin_get(flit, DspinRwtParam::CLEANUP_NLINE_LSB); 5728 5728 5729 bool eop = 5730 DspinRwtParam::dspin_get(flit, DspinRwtParam::P2M_EOP) == 0x1; 5729 bool eop = DspinRwtParam::dspin_get(flit, DspinRwtParam::P2M_EOP) == 0x1; 5731 5730 5732 5731 if (! eop) … … 5735 5734 r_cleanup_data_index = 0; 5736 5735 r_cleanup_contains_data = true; 5736 // <Activity Counters> 5737 if (is_local_req(srcid)) { 5738 m_cpt_cleanup_local++; 5739 m_cpt_cleanup_data_local++; 5740 } 5741 else { 5742 m_cpt_cleanup_remote++; 5743 m_cpt_cleanup_data_remote++; 5744 } 5745 m_cpt_cleanup_cost += m_words * req_distance(srcid); 5746 m_cpt_cleanup_data_cost += m_words * req_distance(srcid); 5747 // </Activity Counters> 5737 5748 } 5738 5749 else 5739 5750 { 5740 5751 r_cleanup_fsm = CLEANUP_DIR_REQ; 5752 // <Activity Counters> 5753 if (is_local_req(srcid)) { 5754 m_cpt_cleanup_local++; 5755 } 5756 else { 5757 m_cpt_cleanup_remote++; 5758 } 5759 m_cpt_cleanup_cost += req_distance(srcid); 5760 // </Activity Counters> 5741 5761 } 5742 5762 cc_receive_to_cleanup_fifo_get = true; … … 5774 5794 { 5775 5795 r_cleanup_contains_data = true; 5776 m_cpt_cleanup_data ++;5777 5796 r_cleanup_fsm = CLEANUP_DIR_REQ; 5778 5797 } … … 7782 7801 { 7783 7802 m_cpt_minval_remote++; 7784 m_cpt_minval_cost += req_distance(m_config_to_cc_send_srcid_fifo.read());7785 }7803 } 7804 m_cpt_minval_cost += req_distance(m_config_to_cc_send_srcid_fifo.read()); 7786 7805 // </Activity Counters> 7787 7806 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_NLINE; … … 7849 7868 { 7850 7869 m_cpt_minval_remote++; 7851 m_cpt_minval_cost += req_distance(m_xram_rsp_to_cc_send_srcid_fifo.read());7852 }7870 } 7871 m_cpt_minval_cost += req_distance(m_xram_rsp_to_cc_send_srcid_fifo.read()); 7853 7872 // </Activity Counters> 7854 7873 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_NLINE; … … 8002 8021 { 8003 8022 m_cpt_update_remote++; 8004 m_cpt_update_cost += req_distance(m_write_to_cc_send_srcid_fifo.read());8005 }8023 } 8024 m_cpt_update_cost += req_distance(m_write_to_cc_send_srcid_fifo.read()); 8006 8025 // </Activity Counters> 8007 8026 … … 8091 8110 { 8092 8111 m_cpt_update_remote++; 8093 m_cpt_update_cost += req_distance(m_cas_to_cc_send_srcid_fifo.read());8094 }8112 } 8113 m_cpt_update_cost += req_distance(m_cas_to_cc_send_srcid_fifo.read()); 8095 8114 // </Activity Counters> 8096 8115 r_cc_send_fsm = CC_SEND_CAS_UPDT_NLINE; … … 8566 8585 else 8567 8586 { 8568 m_cpt_read_WTF ++;8587 assert(false); 8569 8588 } 8570 8589 } … … 8658 8677 else if (!r_cleanup_to_tgt_rsp_type.read()) 8659 8678 { 8660 m_cpt_read_WTF ++;8679 assert(false); 8661 8680 } 8662 8681 … … 8754 8773 else 8755 8774 { 8756 m_cpt_read_WTF ++;8775 assert(false); 8757 8776 } 8758 8777
Note: See TracChangeset
for help on using the changeset viewer.