Changeset 346
- Timestamp:
- Mar 29, 2013, 6:56:36 PM (12 years ago)
- Location:
- branches/v5/modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/include/vci_cc_vcache_wrapper_dspin_coherence.h
r331 r346 1 1 /* -*- c++ -*- 2 * 2 3 * File : vci_cc_vcache_wrapper.h 3 4 * Copyright (c) UPMC, Lip6, SoC … … 285 286 sc_in<bool> p_resetn; 286 287 sc_in<bool> p_irq[iss_t::n_irq]; 287 soclib::caba::VciInitiator<vci_param> p_vci _ini_d;288 soclib::caba::DspinInput <40> p_dspin_in;289 soclib::caba::DspinOutput<33> p_dspin_out;288 soclib::caba::VciInitiator<vci_param> p_vci; 289 soclib::caba::DspinInput <40> p_dspin_in; 290 soclib::caba::DspinOutput<33> p_dspin_out; 290 291 291 292 private: 292 293 293 294 // STRUCTURAL PARAMETERS 294 soclib::common::AddressDecodingTable<uint32_t, bool> 295 const soclib::common::Segment m_segment; 296 const vci_srcid_t m_srcid_d;297 const vci_srcid_t m_srcid_c;298 295 soclib::common::AddressDecodingTable<uint32_t, bool> m_cacheability_table; 296 297 const vci_srcid_t m_srcid; 298 const size_t m_cc_global_id; 299 const size_t m_nline_width; 299 300 const size_t m_itlb_ways; 300 301 const size_t m_itlb_sets; 301 302 302 const size_t m_dtlb_ways; 303 303 const size_t m_dtlb_sets; 304 305 304 const size_t m_icache_ways; 306 305 const size_t m_icache_sets; 307 306 const paddr_t m_icache_yzmask; 308 307 const size_t m_icache_words; 309 310 308 const size_t m_dcache_ways; 311 309 const size_t m_dcache_sets; 312 310 const paddr_t m_dcache_yzmask; 313 311 const size_t m_dcache_words; 314 315 312 const size_t m_x_width; 316 313 const size_t m_y_width; 317 318 const size_t m_memory_cache_local_id;319 314 const size_t m_proc_id; 320 315 const uint32_t m_max_frozen_cycles; 321 316 const size_t m_paddr_nbits; 317 uint32_t m_debug_start_cycle; 318 bool m_debug_ok; 322 319 323 320 //////////////////////////////////////// … … 332 329 // debug variables (for each FSM) 333 330 ///////////////////////////////////////////// 334 uint32_t m_debug_start_cycle;335 bool m_debug_ok;336 331 bool m_debug_previous_hit; 337 332 bool m_idebug_previous_hit; … … 686 681 public: 687 682 VciCcVCacheWrapper( 688 sc_module_name insname, 689 int proc_id, 690 const soclib::common::MappingTable &mtp, 691 const soclib::common::MappingTable &mtc, 692 const soclib::common::IntTab &initiator_index_d, 693 const soclib::common::IntTab &initiator_index_c, 694 const soclib::common::IntTab &target_index_d, 695 size_t itlb_ways, 696 size_t itlb_sets, 697 size_t dtlb_ways, 698 size_t dtlb_sets, 699 size_t icache_ways, 700 size_t icache_sets, 701 size_t icache_words, 702 size_t dcache_ways, 703 size_t dcache_sets, 704 size_t dcache_words, 705 size_t wbuf_nlines, 706 size_t wbuf_nwords, 707 size_t x_width, 708 size_t y_width, 709 uint32_t memory_cache_local_id, 710 uint32_t max_frozen_cycles, 711 uint32_t debug_start_cycle, 712 bool debug_ok); 683 sc_module_name name, 684 const int proc_id, 685 const soclib::common::MappingTable &mtd, 686 const soclib::common::IntTab &srcid, 687 const size_t cc_global_id, 688 const size_t itlb_ways, 689 const size_t itlb_sets, 690 const size_t dtlb_ways, 691 const size_t dtlb_sets, 692 const size_t icache_ways, 693 const size_t icache_sets, 694 const size_t icache_words, 695 const size_t dcache_ways, 696 const size_t dcache_sets, 697 const size_t dcache_words, 698 const size_t wbuf_nlines, 699 const size_t wbuf_nwords, 700 const size_t x_width, 701 const size_t y_width, 702 const uint32_t max_frozen_cycles, 703 const uint32_t debug_start_cycle, 704 const bool debug_ok ); 713 705 714 706 ~VciCcVCacheWrapper(); -
branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/src/vci_cc_vcache_wrapper_dspin_coherence.cpp
r341 r346 162 162 #define tmpl(...) template<typename vci_param, typename iss_t> __VA_ARGS__ VciCcVCacheWrapper<vci_param, iss_t> 163 163 164 using soclib::common::uint32_log2;164 using namespace soclib::common; 165 165 166 166 ///////////////////////////////// 167 167 tmpl(/**/)::VciCcVCacheWrapper( 168 168 sc_module_name name, 169 int proc_id, 170 const soclib::common::MappingTable &mtd, 171 const soclib::common::MappingTable &mtc, 172 const soclib::common::IntTab &initiator_index_d, 173 const soclib::common::IntTab &initiator_index_c, 174 const soclib::common::IntTab &target_index_c, 175 size_t itlb_ways, 176 size_t itlb_sets, 177 size_t dtlb_ways, 178 size_t dtlb_sets, 179 size_t icache_ways, 180 size_t icache_sets, 181 size_t icache_words, 182 size_t dcache_ways, 183 size_t dcache_sets, 184 size_t dcache_words, 185 size_t wbuf_nlines, 186 size_t wbuf_nwords, 187 size_t x_width, 188 size_t y_width, 189 uint32_t memory_cache_local_id, 190 uint32_t max_frozen_cycles, 191 uint32_t debug_start_cycle, 192 bool debug_ok) 169 const int proc_id, 170 const MappingTable &mtd, 171 const IntTab &srcid, 172 const size_t cc_global_id, 173 const size_t itlb_ways, 174 const size_t itlb_sets, 175 const size_t dtlb_ways, 176 const size_t dtlb_sets, 177 const size_t icache_ways, 178 const size_t icache_sets, 179 const size_t icache_words, 180 const size_t dcache_ways, 181 const size_t dcache_sets, 182 const size_t dcache_words, 183 const size_t wbuf_nlines, 184 const size_t wbuf_nwords, 185 const size_t x_width, 186 const size_t y_width, 187 const uint32_t max_frozen_cycles, 188 const uint32_t debug_start_cycle, 189 const bool debug_ok ) 193 190 : soclib::caba::BaseModule(name), 194 191 195 p_clk("clk"), 196 p_resetn("resetn"), 197 p_vci_ini_d("vci_ini_d"), 198 p_dspin_in("dspin_in"), 199 p_dspin_out("dspin_out"), 200 201 m_cacheability_table(mtd.getCacheabilityTable()), 202 m_segment(mtc.getSegment(target_index_c)), 203 m_srcid_d(mtd.indexForId(initiator_index_d)), 204 m_srcid_c(mtc.indexForId(initiator_index_c)), 205 206 m_itlb_ways(itlb_ways), 207 m_itlb_sets(itlb_sets), 208 209 m_dtlb_ways(dtlb_ways), 210 m_dtlb_sets(dtlb_sets), 211 212 m_icache_ways(icache_ways), 213 m_icache_sets(icache_sets), 214 m_icache_yzmask((~0)<<(uint32_log2(icache_words) + 2)), 215 m_icache_words(icache_words), 216 217 m_dcache_ways(dcache_ways), 218 m_dcache_sets(dcache_sets), 219 m_dcache_yzmask((~0)<<(uint32_log2(dcache_words) + 2)), 220 m_dcache_words(dcache_words), 221 222 m_x_width(x_width), 223 m_y_width(y_width), 224 225 m_memory_cache_local_id(memory_cache_local_id), 226 m_proc_id(proc_id), 227 m_max_frozen_cycles(max_frozen_cycles), 228 m_paddr_nbits(vci_param::N), 229 230 m_debug_start_cycle(debug_start_cycle), 231 m_debug_ok(debug_ok), 192 p_clk("p_clk"), 193 p_resetn("p_resetn"), 194 p_vci("p_vci"), 195 p_dspin_in("p_dspin_in"), 196 p_dspin_out("p_dspin_out"), 197 198 m_cacheability_table( mtd.getCacheabilityTable() ), 199 m_srcid( mtd.indexForId(srcid) ), 200 m_cc_global_id( cc_global_id ), 201 m_nline_width( vci_param::N - (uint32_log2(dcache_words)) - 2 ), 202 m_itlb_ways( itlb_ways ), 203 m_itlb_sets( itlb_sets ), 204 m_dtlb_ways( dtlb_ways ), 205 m_dtlb_sets( dtlb_sets ), 206 m_icache_ways( icache_ways ), 207 m_icache_sets( icache_sets ), 208 m_icache_yzmask( (~0)<<(uint32_log2(icache_words) + 2) ), 209 m_icache_words( icache_words ), 210 m_dcache_ways( dcache_ways ), 211 m_dcache_sets( dcache_sets ), 212 m_dcache_yzmask( (~0)<<(uint32_log2(dcache_words) + 2) ), 213 m_dcache_words( dcache_words ), 214 m_x_width( x_width ), 215 m_y_width( y_width ), 216 m_proc_id( proc_id ), 217 m_max_frozen_cycles( max_frozen_cycles ), 218 m_paddr_nbits( vci_param::N ), 219 m_debug_start_cycle( debug_start_cycle ), 220 m_debug_ok( debug_ok ), 232 221 233 222 r_mmu_ptpr("r_mmu_ptpr"), … … 3050 3039 // We should compute the access locality: 3051 3040 // The PPN MSB bits define the destination cluster index. 3052 // The m_srcid _dMSB bits define the source cluster index.3041 // The m_srcid MSB bits define the source cluster index. 3053 3042 // The number of bits to compare depends on the number of clusters, 3054 3043 // and can be obtained in the mapping table. … … 3305 3294 // We should compute the access locality: 3306 3295 // The PPN MSB bits define the destination cluster index. 3307 // The m_srcid _dMSB bits define the source cluster index.3296 // The m_srcid MSB bits define the source cluster index. 3308 3297 // The number of bits to compare depends on the number of clusters, 3309 3298 // and can be obtained in the mapping table. … … 5004 4993 case CMD_DATA_WRITE: 5005 4994 { 5006 if ( p_vci _ini_d.cmdack.read() )4995 if ( p_vci.cmdack.read() ) 5007 4996 { 5008 4997 r_vci_cmd_cpt = r_vci_cmd_cpt + 1; … … 5020 5009 { 5021 5010 // The CAS and SC VCI commands contain two flits 5022 if ( p_vci _ini_d.cmdack.read() )5011 if ( p_vci.cmdack.read() ) 5023 5012 { 5024 5013 r_vci_cmd_cpt = r_vci_cmd_cpt + 1; … … 5035 5024 { 5036 5025 // all read VCI commands contain one single flit 5037 if ( p_vci _ini_d.cmdack.read() ) r_vci_cmd_fsm = CMD_IDLE;5026 if ( p_vci.cmdack.read() ) r_vci_cmd_fsm = CMD_IDLE; 5038 5027 break; 5039 5028 } … … 5073 5062 case RSP_IDLE: 5074 5063 { 5075 if ( p_vci _ini_d.rspval.read() )5064 if ( p_vci.rspval.read() ) 5076 5065 { 5077 5066 r_vci_rsp_cpt = 0; 5078 5067 5079 if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_READ_DATA_UNC )5068 if ( (p_vci.rpktid.read() & 0x7) == TYPE_READ_DATA_UNC ) 5080 5069 { 5081 5070 r_vci_rsp_fsm = RSP_DATA_UNC; 5082 5071 } 5083 else if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_READ_DATA_MISS )5072 else if ( (p_vci.rpktid.read() & 0x7) == TYPE_READ_DATA_MISS ) 5084 5073 { 5085 5074 r_vci_rsp_fsm = RSP_DATA_MISS; 5086 5075 } 5087 else if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_READ_INS_UNC )5076 else if ( (p_vci.rpktid.read() & 0x7) == TYPE_READ_INS_UNC ) 5088 5077 { 5089 5078 r_vci_rsp_fsm = RSP_INS_UNC; 5090 5079 } 5091 else if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_READ_INS_MISS )5080 else if ( (p_vci.rpktid.read() & 0x7) == TYPE_READ_INS_MISS ) 5092 5081 { 5093 5082 r_vci_rsp_fsm = RSP_INS_MISS; 5094 5083 } 5095 else if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_WRITE )5084 else if ( (p_vci.rpktid.read() & 0x7) == TYPE_WRITE ) 5096 5085 { 5097 5086 r_vci_rsp_fsm = RSP_DATA_WRITE; 5098 5087 } 5099 else if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_CAS )5088 else if ( (p_vci.rpktid.read() & 0x7) == TYPE_CAS ) 5100 5089 { 5101 5090 r_vci_rsp_fsm = RSP_DATA_UNC; 5102 5091 } 5103 else if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_LL )5092 else if ( (p_vci.rpktid.read() & 0x7) == TYPE_LL ) 5104 5093 { 5105 5094 r_vci_rsp_fsm = RSP_DATA_LL; 5106 5095 } 5107 else if ( (p_vci _ini_d.rpktid.read() & 0x7) == TYPE_SC )5096 else if ( (p_vci.rpktid.read() & 0x7) == TYPE_SC ) 5108 5097 { 5109 5098 r_vci_rsp_fsm = RSP_DATA_UNC; … … 5119 5108 case RSP_INS_MISS: 5120 5109 { 5121 if ( p_vci _ini_d.rspval.read() )5122 { 5123 if ( (p_vci _ini_d.rerror.read()&0x1) != 0 ) // error reported5110 if ( p_vci.rspval.read() ) 5111 { 5112 if ( (p_vci.rerror.read()&0x1) != 0 ) // error reported 5124 5113 { 5125 5114 r_vci_rsp_ins_error = true; 5126 if ( p_vci _ini_d.reop.read() ) r_vci_rsp_fsm = RSP_IDLE;5115 if ( p_vci.reop.read() ) r_vci_rsp_fsm = RSP_IDLE; 5127 5116 } 5128 5117 else // no error reported … … 5135 5124 r_vci_rsp_cpt = r_vci_rsp_cpt.read() + 1; 5136 5125 vci_rsp_fifo_icache_put = true, 5137 vci_rsp_fifo_icache_data = p_vci _ini_d.rdata.read();5138 if ( p_vci _ini_d.reop.read() )5126 vci_rsp_fifo_icache_data = p_vci.rdata.read(); 5127 if ( p_vci.reop.read() ) 5139 5128 { 5140 5129 assert( (r_vci_rsp_cpt.read() == m_icache_words - 1) and … … 5151 5140 case RSP_INS_UNC: 5152 5141 { 5153 if (p_vci _ini_d.rspval.read() )5154 { 5155 assert( p_vci _ini_d.reop.read() and5142 if (p_vci.rspval.read() ) 5143 { 5144 assert( p_vci.reop.read() and 5156 5145 "illegal VCI response packet for uncachable instruction"); 5157 5146 5158 if ( (p_vci _ini_d.rerror.read()&0x1) != 0 ) // error reported5147 if ( (p_vci.rerror.read()&0x1) != 0 ) // error reported 5159 5148 { 5160 5149 r_vci_rsp_ins_error = true; … … 5166 5155 { 5167 5156 vci_rsp_fifo_icache_put = true; 5168 vci_rsp_fifo_icache_data = p_vci _ini_d.rdata.read();5157 vci_rsp_fifo_icache_data = p_vci.rdata.read(); 5169 5158 r_vci_rsp_fsm = RSP_IDLE; 5170 5159 } … … 5176 5165 case RSP_DATA_MISS: 5177 5166 { 5178 if ( p_vci _ini_d.rspval.read() )5179 { 5180 if ( (p_vci _ini_d.rerror.read()&0x1) != 0 ) // error reported5167 if ( p_vci.rspval.read() ) 5168 { 5169 if ( (p_vci.rerror.read()&0x1) != 0 ) // error reported 5181 5170 { 5182 5171 r_vci_rsp_data_error = true; 5183 if ( p_vci _ini_d.reop.read() ) r_vci_rsp_fsm = RSP_IDLE;5172 if ( p_vci.reop.read() ) r_vci_rsp_fsm = RSP_IDLE; 5184 5173 } 5185 5174 else // no error reported … … 5192 5181 r_vci_rsp_cpt = r_vci_rsp_cpt.read() + 1; 5193 5182 vci_rsp_fifo_dcache_put = true, 5194 vci_rsp_fifo_dcache_data = p_vci _ini_d.rdata.read();5195 if ( p_vci _ini_d.reop.read() )5183 vci_rsp_fifo_dcache_data = p_vci.rdata.read(); 5184 if ( p_vci.reop.read() ) 5196 5185 { 5197 5186 assert( (r_vci_rsp_cpt.read() == m_dcache_words - 1) and … … 5208 5197 case RSP_DATA_UNC: 5209 5198 { 5210 if (p_vci _ini_d.rspval.read() )5211 { 5212 assert( p_vci _ini_d.reop.read() and5199 if (p_vci.rspval.read() ) 5200 { 5201 assert( p_vci.reop.read() and 5213 5202 "illegal VCI response packet for uncachable read data"); 5214 5203 5215 if ( (p_vci _ini_d.rerror.read()&0x1) != 0 ) // error reported5204 if ( (p_vci.rerror.read()&0x1) != 0 ) // error reported 5216 5205 { 5217 5206 r_vci_rsp_data_error = true; … … 5223 5212 { 5224 5213 vci_rsp_fifo_dcache_put = true; 5225 vci_rsp_fifo_dcache_data = p_vci _ini_d.rdata.read();5214 vci_rsp_fifo_dcache_data = p_vci.rdata.read(); 5226 5215 r_vci_rsp_fsm = RSP_IDLE; 5227 5216 } … … 5233 5222 case RSP_DATA_LL: 5234 5223 { 5235 if ( p_vci _ini_d.rspval.read() )5236 { 5237 if ( (p_vci _ini_d.rerror.read()&0x1) != 0 ) // error reported5224 if ( p_vci.rspval.read() ) 5225 { 5226 if ( (p_vci.rerror.read()&0x1) != 0 ) // error reported 5238 5227 { 5239 5228 r_vci_rsp_data_error = true; … … 5244 5233 if(r_vci_rsp_fifo_dcache.wok()) 5245 5234 { 5246 assert(!p_vci _ini_d.reop.read() &&5235 assert(!p_vci.reop.read() && 5247 5236 "illegal VCI response packet for LL"); 5248 5237 vci_rsp_fifo_dcache_put = true; 5249 vci_rsp_fifo_dcache_data = p_vci _ini_d.rdata.read();5238 vci_rsp_fifo_dcache_data = p_vci.rdata.read(); 5250 5239 r_vci_rsp_cpt = r_vci_rsp_cpt.read() + 1; 5251 5240 } … … 5256 5245 if(r_vci_rsp_fifo_dcache.wok()) 5257 5246 { 5258 assert(p_vci _ini_d.reop.read() &&5247 assert(p_vci.reop.read() && 5259 5248 "illegal VCI response packet for LL"); 5260 5249 vci_rsp_fifo_dcache_put = true; 5261 vci_rsp_fifo_dcache_data = p_vci _ini_d.rdata.read();5250 vci_rsp_fifo_dcache_data = p_vci.rdata.read(); 5262 5251 r_vci_rsp_fsm = RSP_IDLE; 5263 5252 } … … 5270 5259 case RSP_DATA_WRITE: 5271 5260 { 5272 if (p_vci _ini_d.rspval.read())5273 { 5274 assert( p_vci _ini_d.reop.read() and5261 if (p_vci.rspval.read()) 5262 { 5263 assert( p_vci.reop.read() and 5275 5264 "a VCI response packet must contain one flit for a write transaction"); 5276 5265 5277 5266 r_vci_rsp_fsm = RSP_IDLE; 5278 uint32_t wbuf_index = p_vci _ini_d.rtrdid.read();5267 uint32_t wbuf_index = p_vci.rtrdid.read(); 5279 5268 bool cacheable = r_wbuf.completed(wbuf_index); 5280 5269 if ( not cacheable ) r_dcache_pending_unc_write = false; 5281 if ( (p_vci _ini_d.rerror.read()&0x1) != 0 ) r_iss.setWriteBerr();5270 if ( (p_vci.rerror.read()&0x1) != 0 ) r_iss.setWriteBerr(); 5282 5271 } 5283 5272 break; … … 5545 5534 case CC_RECEIVE_INVAL_HEADER: 5546 5535 { 5547 // sample updt tab index in the HEADER, th an skip to second flit5536 // sample updt tab index in the HEADER, then skip to second flit 5548 5537 uint64_t receive_data = p_dspin_in.data.read(); 5549 5538 // for data INVAL, wait for dcache to take the request … … 5683 5672 vci_rsp_fifo_dcache_put, 5684 5673 vci_rsp_fifo_dcache_data); 5674 5685 5675 ///////////////// updt FIFO update ////////////////////// 5686 5676 //TODO check this … … 5708 5698 (r_vci_cmd_fsm.read() == CMD_DATA_SC ); 5709 5699 5710 p_vci _ini_d.pktid = 0;5711 p_vci _ini_d.srcid = m_srcid_d;5712 p_vci _ini_d.cons = is_sc_or_cas;5713 p_vci _ini_d.contig = not is_sc_or_cas;5714 p_vci _ini_d.wrap = false;5715 p_vci _ini_d.clen = 0;5716 p_vci _ini_d.cfixed = false;5700 p_vci.pktid = 0; 5701 p_vci.srcid = m_srcid; 5702 p_vci.cons = is_sc_or_cas; 5703 p_vci.contig = not is_sc_or_cas; 5704 p_vci.wrap = false; 5705 p_vci.clen = 0; 5706 p_vci.cfixed = false; 5717 5707 5718 5708 switch ( r_vci_cmd_fsm.read() ) { 5719 5709 5720 5710 case CMD_IDLE: 5721 p_vci _ini_d.cmdval = false;5722 p_vci _ini_d.address = 0;5723 p_vci _ini_d.wdata = 0;5724 p_vci _ini_d.be = 0;5725 p_vci _ini_d.trdid = 0;5726 p_vci _ini_d.pktid = 0;5727 p_vci _ini_d.plen = 0;5728 p_vci _ini_d.cmd = vci_param::CMD_NOP;5729 p_vci _ini_d.eop = false;5711 p_vci.cmdval = false; 5712 p_vci.address = 0; 5713 p_vci.wdata = 0; 5714 p_vci.be = 0; 5715 p_vci.trdid = 0; 5716 p_vci.pktid = 0; 5717 p_vci.plen = 0; 5718 p_vci.cmd = vci_param::CMD_NOP; 5719 p_vci.eop = false; 5730 5720 break; 5731 5721 5732 5722 case CMD_INS_MISS: 5733 p_vci _ini_d.cmdval = true;5734 p_vci _ini_d.address = r_icache_vci_paddr.read() & m_icache_yzmask;5735 p_vci _ini_d.wdata = 0;5736 p_vci _ini_d.be = 0xF;5737 p_vci _ini_d.trdid = 0;5738 p_vci _ini_d.pktid = TYPE_READ_INS_MISS;5739 p_vci _ini_d.plen = m_icache_words<<2;5740 p_vci _ini_d.cmd = vci_param::CMD_READ;5741 p_vci _ini_d.eop = true;5723 p_vci.cmdval = true; 5724 p_vci.address = r_icache_vci_paddr.read() & m_icache_yzmask; 5725 p_vci.wdata = 0; 5726 p_vci.be = 0xF; 5727 p_vci.trdid = 0; 5728 p_vci.pktid = TYPE_READ_INS_MISS; 5729 p_vci.plen = m_icache_words<<2; 5730 p_vci.cmd = vci_param::CMD_READ; 5731 p_vci.eop = true; 5742 5732 break; 5743 5733 5744 5734 case CMD_INS_UNC: 5745 p_vci _ini_d.cmdval = true;5746 p_vci _ini_d.address = r_icache_vci_paddr.read() & ~0x3;5747 p_vci _ini_d.wdata = 0;5748 p_vci _ini_d.be = 0xF;5749 p_vci _ini_d.trdid = 0;5750 p_vci _ini_d.pktid = TYPE_READ_INS_UNC;5751 p_vci _ini_d.plen = 4;5752 p_vci _ini_d.cmd = vci_param::CMD_READ;5753 p_vci _ini_d.eop = true;5735 p_vci.cmdval = true; 5736 p_vci.address = r_icache_vci_paddr.read() & ~0x3; 5737 p_vci.wdata = 0; 5738 p_vci.be = 0xF; 5739 p_vci.trdid = 0; 5740 p_vci.pktid = TYPE_READ_INS_UNC; 5741 p_vci.plen = 4; 5742 p_vci.cmd = vci_param::CMD_READ; 5743 p_vci.eop = true; 5754 5744 break; 5755 5745 5756 5746 case CMD_DATA_MISS: 5757 p_vci _ini_d.cmdval = true;5758 p_vci _ini_d.address = r_dcache_vci_paddr.read() & m_dcache_yzmask;5759 p_vci _ini_d.wdata = 0;5760 p_vci _ini_d.be = 0xF;5761 p_vci _ini_d.trdid = 0;5762 p_vci _ini_d.pktid = TYPE_READ_DATA_MISS;5763 p_vci _ini_d.plen = m_dcache_words << 2;5764 p_vci _ini_d.cmd = vci_param::CMD_READ;5765 p_vci _ini_d.eop = true;5747 p_vci.cmdval = true; 5748 p_vci.address = r_dcache_vci_paddr.read() & m_dcache_yzmask; 5749 p_vci.wdata = 0; 5750 p_vci.be = 0xF; 5751 p_vci.trdid = 0; 5752 p_vci.pktid = TYPE_READ_DATA_MISS; 5753 p_vci.plen = m_dcache_words << 2; 5754 p_vci.cmd = vci_param::CMD_READ; 5755 p_vci.eop = true; 5766 5756 break; 5767 5757 5768 5758 case CMD_DATA_UNC: 5769 p_vci _ini_d.cmdval = true;5770 p_vci _ini_d.address = r_dcache_vci_paddr.read() & ~0x3;5771 p_vci _ini_d.wdata = 0;5772 p_vci _ini_d.be = r_dcache_vci_unc_be.read();5773 p_vci _ini_d.trdid = 0;5774 p_vci _ini_d.pktid = TYPE_READ_DATA_UNC;5775 p_vci _ini_d.plen = 4;5776 p_vci _ini_d.cmd = vci_param::CMD_READ;5777 p_vci _ini_d.eop = true;5759 p_vci.cmdval = true; 5760 p_vci.address = r_dcache_vci_paddr.read() & ~0x3; 5761 p_vci.wdata = 0; 5762 p_vci.be = r_dcache_vci_unc_be.read(); 5763 p_vci.trdid = 0; 5764 p_vci.pktid = TYPE_READ_DATA_UNC; 5765 p_vci.plen = 4; 5766 p_vci.cmd = vci_param::CMD_READ; 5767 p_vci.eop = true; 5778 5768 break; 5779 5769 5780 5770 case CMD_DATA_WRITE: 5781 p_vci _ini_d.cmdval = true;5782 p_vci _ini_d.address = r_wbuf.getAddress(r_vci_cmd_cpt.read()) & ~0x3;5783 p_vci _ini_d.wdata = r_wbuf.getData(r_vci_cmd_cpt.read());5784 p_vci _ini_d.be = r_wbuf.getBe(r_vci_cmd_cpt.read());5785 p_vci _ini_d.trdid = r_wbuf.getIndex();5786 p_vci _ini_d.pktid = TYPE_WRITE;5787 p_vci _ini_d.plen = (r_vci_cmd_max.read() - r_vci_cmd_min.read() + 1) << 2;5788 p_vci _ini_d.cmd = vci_param::CMD_WRITE;5789 p_vci _ini_d.eop = (r_vci_cmd_cpt.read() == r_vci_cmd_max.read());5771 p_vci.cmdval = true; 5772 p_vci.address = r_wbuf.getAddress(r_vci_cmd_cpt.read()) & ~0x3; 5773 p_vci.wdata = r_wbuf.getData(r_vci_cmd_cpt.read()); 5774 p_vci.be = r_wbuf.getBe(r_vci_cmd_cpt.read()); 5775 p_vci.trdid = r_wbuf.getIndex(); 5776 p_vci.pktid = TYPE_WRITE; 5777 p_vci.plen = (r_vci_cmd_max.read() - r_vci_cmd_min.read() + 1) << 2; 5778 p_vci.cmd = vci_param::CMD_WRITE; 5779 p_vci.eop = (r_vci_cmd_cpt.read() == r_vci_cmd_max.read()); 5790 5780 break; 5791 5781 5792 5782 case CMD_DATA_LL: 5793 p_vci _ini_d.cmdval = true;5794 p_vci _ini_d.address = r_dcache_vci_paddr.read() & ~0x3;5795 p_vci _ini_d.wdata = 0;5796 p_vci _ini_d.be = 0xF;5797 p_vci _ini_d.trdid = 0;5798 p_vci _ini_d.pktid = TYPE_LL;5799 p_vci _ini_d.plen = 8;5800 p_vci _ini_d.cmd = vci_param::CMD_LOCKED_READ;5801 p_vci _ini_d.eop = true;5783 p_vci.cmdval = true; 5784 p_vci.address = r_dcache_vci_paddr.read() & ~0x3; 5785 p_vci.wdata = 0; 5786 p_vci.be = 0xF; 5787 p_vci.trdid = 0; 5788 p_vci.pktid = TYPE_LL; 5789 p_vci.plen = 8; 5790 p_vci.cmd = vci_param::CMD_LOCKED_READ; 5791 p_vci.eop = true; 5802 5792 break; 5803 5793 5804 5794 case CMD_DATA_SC: 5805 p_vci _ini_d.cmdval = true;5806 p_vci _ini_d.address = r_dcache_vci_paddr.read() & ~0x3;5807 if ( r_vci_cmd_cpt.read() == 0 ) p_vci _ini_d.wdata = r_dcache_llsc_key.read();5808 else p_vci _ini_d.wdata = r_dcache_vci_sc_data.read();5809 p_vci _ini_d.be = 0xF;5810 p_vci _ini_d.trdid = 0;5811 p_vci _ini_d.pktid = TYPE_SC;5812 p_vci _ini_d.plen = 8;5813 p_vci _ini_d.cmd = vci_param::CMD_NOP;5814 p_vci _ini_d.eop = (r_vci_cmd_cpt.read() == 1);5795 p_vci.cmdval = true; 5796 p_vci.address = r_dcache_vci_paddr.read() & ~0x3; 5797 if ( r_vci_cmd_cpt.read() == 0 ) p_vci.wdata = r_dcache_llsc_key.read(); 5798 else p_vci.wdata = r_dcache_vci_sc_data.read(); 5799 p_vci.be = 0xF; 5800 p_vci.trdid = 0; 5801 p_vci.pktid = TYPE_SC; 5802 p_vci.plen = 8; 5803 p_vci.cmd = vci_param::CMD_NOP; 5804 p_vci.eop = (r_vci_cmd_cpt.read() == 1); 5815 5805 break; 5816 5806 5817 5807 case CMD_DATA_CAS: 5818 p_vci _ini_d.cmdval = true;5819 p_vci _ini_d.address = r_dcache_vci_paddr.read() & ~0x3;5820 if ( r_vci_cmd_cpt.read() == 0 ) p_vci _ini_d.wdata = r_dcache_vci_cas_old.read();5821 else p_vci _ini_d.wdata = r_dcache_vci_cas_new.read();5822 p_vci _ini_d.be = 0xF;5823 p_vci _ini_d.trdid = 0;5824 p_vci _ini_d.pktid = TYPE_CAS;5825 p_vci _ini_d.plen = 8;5826 p_vci _ini_d.cmd = vci_param::CMD_NOP;5827 p_vci _ini_d.eop = (r_vci_cmd_cpt.read() == 1);5808 p_vci.cmdval = true; 5809 p_vci.address = r_dcache_vci_paddr.read() & ~0x3; 5810 if ( r_vci_cmd_cpt.read() == 0 ) p_vci.wdata = r_dcache_vci_cas_old.read(); 5811 else p_vci.wdata = r_dcache_vci_cas_new.read(); 5812 p_vci.be = 0xF; 5813 p_vci.trdid = 0; 5814 p_vci.pktid = TYPE_CAS; 5815 p_vci.plen = 8; 5816 p_vci.cmd = vci_param::CMD_NOP; 5817 p_vci.eop = (r_vci_cmd_cpt.read() == 1); 5828 5818 break; 5829 5819 } // end switch r_vci_cmd_fsm 5830 5820 5831 5821 // VCI initiator response on the direct network 5832 // it depends on the VCI RSP state5822 // it depends on the VCI_RSP FSM 5833 5823 5834 5824 switch (r_vci_rsp_fsm.read() ) 5835 5825 { 5836 case RSP_DATA_WRITE : p_vci _ini_d.rspack = true; break;5837 case RSP_INS_MISS : p_vci _ini_d.rspack = r_vci_rsp_fifo_icache.wok(); break;5838 case RSP_INS_UNC : p_vci _ini_d.rspack = r_vci_rsp_fifo_icache.wok(); break;5839 case RSP_DATA_MISS : p_vci _ini_d.rspack = r_vci_rsp_fifo_dcache.wok(); break;5840 case RSP_DATA_UNC : p_vci _ini_d.rspack = r_vci_rsp_fifo_dcache.wok(); break;5841 case RSP_DATA_LL : p_vci _ini_d.rspack = r_vci_rsp_fifo_dcache.wok(); break;5842 case RSP_IDLE : p_vci _ini_d.rspack = false; break;5826 case RSP_DATA_WRITE : p_vci.rspack = true; break; 5827 case RSP_INS_MISS : p_vci.rspack = r_vci_rsp_fifo_icache.wok(); break; 5828 case RSP_INS_UNC : p_vci.rspack = r_vci_rsp_fifo_icache.wok(); break; 5829 case RSP_DATA_MISS : p_vci.rspack = r_vci_rsp_fifo_dcache.wok(); break; 5830 case RSP_DATA_UNC : p_vci.rspack = r_vci_rsp_fifo_dcache.wok(); break; 5831 case RSP_DATA_LL : p_vci.rspack = r_vci_rsp_fifo_dcache.wok(); break; 5832 case RSP_IDLE : p_vci.rspack = false; break; 5843 5833 } // end switch r_vci_rsp_fsm 5844 5834 5845 ///////////////// 5846 // CC_SEND FSM // 5847 ///////////////// 5835 5836 // Send coherence packets on DSPIN L2M 5837 // it depends on the CC_SEND FSM 5838 5848 5839 uint64_t dspin_send_data = 0; 5849 5840 switch ( r_cc_send_fsm.read() ) 5850 5841 { 5851 ////////////////// /////////5842 ////////////////// 5852 5843 case CC_SEND_IDLE: 5853 5844 { … … 5855 5846 break; 5856 5847 } 5857 /////////////////////// ////5848 /////////////////////// 5858 5849 case CC_SEND_CLEANUP_1: 5859 5850 { 5860 5851 // initialize dspin send data 5861 DspinDhccpParam::dspin_set(dspin_send_data,0,DspinDhccpParam::FROM_L1_EOP); 5862 DspinDhccpParam::dspin_set(dspin_send_data,m_srcid_c,DspinDhccpParam::CLEANUP_SRCID); 5863 DspinDhccpParam::dspin_set(dspin_send_data,0,DspinDhccpParam::FROM_L1_BC); 5864 // dcache active request 5865 if(r_cc_send_last_client.read() == 0) 5866 { 5867 // compute global id 5868 uint32_t nline_size = vci_param::N - (uint32_log2(m_dcache_words)) - (uint32_log2(vci_param::B)); 5869 uint64_t global_id = (uint64_t) r_dcache_cc_send_nline.read(); 5870 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5871 5852 DspinDhccpParam::dspin_set(dspin_send_data, 5853 0, 5854 DspinDhccpParam::FROM_L1_EOP); 5855 DspinDhccpParam::dspin_set(dspin_send_data, 5856 m_cc_global_id, 5857 DspinDhccpParam::CLEANUP_SRCID); 5858 DspinDhccpParam::dspin_set(dspin_send_data, 5859 0, 5860 DspinDhccpParam::FROM_L1_BC); 5861 5862 if(r_cc_send_last_client.read() == 0) // dcache active request 5863 { 5864 uint64_t dest = (uint64_t)r_dcache_cc_send_nline.read() 5865 >> (m_nline_width - m_x_width - m_y_width) 5866 << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5867 5872 5868 DspinDhccpParam::dspin_set(dspin_send_data, 5873 global_id,5874 DspinDhccpParam::CLEANUP_DEST);5869 dest, 5870 DspinDhccpParam::CLEANUP_DEST); 5875 5871 5876 5872 DspinDhccpParam::dspin_set(dspin_send_data, 5877 r_dcache_cc_send_nline.read() & 0x300000000ULL,5878 DspinDhccpParam::CLEANUP_NLINE_MSB);5873 r_dcache_cc_send_nline.read() & 0x300000000ULL, 5874 DspinDhccpParam::CLEANUP_NLINE_MSB); 5879 5875 5880 5876 DspinDhccpParam::dspin_set(dspin_send_data, 5881 r_dcache_cc_send_way.read(),5882 DspinDhccpParam::CLEANUP_WAY_INDEX);5877 r_dcache_cc_send_way.read(), 5878 DspinDhccpParam::CLEANUP_WAY_INDEX); 5883 5879 5884 5880 DspinDhccpParam::dspin_set(dspin_send_data, 5885 DspinDhccpParam::TYPE_CLEANUP_DATA, 5886 DspinDhccpParam::FROM_L1_TYPE); 5887 } 5888 // icache active request 5889 else 5890 { 5891 // compute global id 5892 uint32_t nline_size = vci_param::N - (uint32_log2(m_icache_words)) - (uint32_log2(vci_param::B)); 5893 uint64_t global_id = (uint64_t) r_icache_cc_send_nline.read(); 5894 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5881 DspinDhccpParam::TYPE_CLEANUP_DATA, 5882 DspinDhccpParam::FROM_L1_TYPE); 5883 } 5884 else // icache active request 5885 { 5886 uint64_t dest = (uint64_t)r_icache_cc_send_nline.read() 5887 >> (m_nline_width - m_x_width - m_y_width) 5888 << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5895 5889 5896 5890 DspinDhccpParam::dspin_set(dspin_send_data, 5897 global_id,5898 DspinDhccpParam::CLEANUP_DEST);5891 dest, 5892 DspinDhccpParam::CLEANUP_DEST); 5899 5893 5900 5894 DspinDhccpParam::dspin_set(dspin_send_data, 5901 r_icache_cc_send_nline.read() & 0x300000000ULL,5902 DspinDhccpParam::CLEANUP_NLINE_MSB);5895 r_icache_cc_send_nline.read() & 0x300000000ULL, 5896 DspinDhccpParam::CLEANUP_NLINE_MSB); 5903 5897 5904 5898 DspinDhccpParam::dspin_set(dspin_send_data, 5905 r_icache_cc_send_way.read(),5906 DspinDhccpParam::CLEANUP_WAY_INDEX);5899 r_icache_cc_send_way.read(), 5900 DspinDhccpParam::CLEANUP_WAY_INDEX); 5907 5901 5908 5902 DspinDhccpParam::dspin_set(dspin_send_data, 5909 DspinDhccpParam::TYPE_CLEANUP_INST,5910 DspinDhccpParam::FROM_L1_TYPE);5903 DspinDhccpParam::TYPE_CLEANUP_INST, 5904 DspinDhccpParam::FROM_L1_TYPE); 5911 5905 } 5912 5906 // send flit … … 5915 5909 break; 5916 5910 } 5917 /////////////////////// ////5911 /////////////////////// 5918 5912 case CC_SEND_CLEANUP_2: 5919 5913 { 5920 5914 // initialize dspin send data 5921 DspinDhccpParam::dspin_set(dspin_send_data,1,DspinDhccpParam::FROM_L1_EOP); 5922 // dcache active request 5923 if(r_cc_send_last_client.read() == 0) 5915 DspinDhccpParam::dspin_set(dspin_send_data, 5916 1, 5917 DspinDhccpParam::FROM_L1_EOP); 5918 5919 if(r_cc_send_last_client.read() == 0) // dcache active request 5924 5920 { 5925 5921 DspinDhccpParam::dspin_set(dspin_send_data, 5926 r_dcache_cc_send_nline.read() & 0xFFFFFFFFULL, 5927 DspinDhccpParam::CLEANUP_NLINE_LSB); 5928 } 5929 // icache active request 5930 else 5922 r_dcache_cc_send_nline.read() & 0xFFFFFFFFULL, 5923 DspinDhccpParam::CLEANUP_NLINE_LSB); 5924 } 5925 else // icache active request 5931 5926 { 5932 5927 DspinDhccpParam::dspin_set(dspin_send_data, 5933 r_icache_cc_send_nline.read() & 0xFFFFFFFFULL,5934 DspinDhccpParam::CLEANUP_NLINE_LSB);5928 r_icache_cc_send_nline.read() & 0xFFFFFFFFULL, 5929 DspinDhccpParam::CLEANUP_NLINE_LSB); 5935 5930 } 5936 5931 // send flit … … 5939 5934 break; 5940 5935 } 5941 /////////////////////// ////5936 /////////////////////// 5942 5937 case CC_SEND_MULTI_ACK: 5943 5938 { 5944 5939 // initialize dspin send data 5945 DspinDhccpParam::dspin_set(dspin_send_data,1,DspinDhccpParam::FROM_L1_EOP);5946 DspinDhccpParam::dspin_set(dspin_send_data,0,DspinDhccpParam::FROM_L1_BC);5947 5940 DspinDhccpParam::dspin_set(dspin_send_data, 5948 DspinDhccpParam::TYPE_MULTI_ACK, 5949 DspinDhccpParam::FROM_L1_TYPE); 5950 // dcache active request 5951 if(r_cc_send_last_client.read() == 0) 5952 { 5953 // compute global id 5954 uint32_t nline_size = vci_param::N - (uint32_log2(m_dcache_words)) - (uint32_log2(vci_param::B)); 5955 uint64_t global_id = (uint64_t) r_dcache_cc_send_nline.read(); 5956 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5957 5941 1, 5942 DspinDhccpParam::FROM_L1_EOP); 5943 DspinDhccpParam::dspin_set(dspin_send_data, 5944 0, 5945 DspinDhccpParam::FROM_L1_BC); 5946 DspinDhccpParam::dspin_set(dspin_send_data, 5947 DspinDhccpParam::TYPE_MULTI_ACK, 5948 DspinDhccpParam::FROM_L1_TYPE); 5949 5950 if(r_cc_send_last_client.read() == 0) // dcache active request 5951 { 5952 uint64_t dest = (uint64_t)r_dcache_cc_send_nline.read() 5953 >> (m_nline_width - m_x_width - m_y_width) 5954 << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5955 5958 5956 DspinDhccpParam::dspin_set(dspin_send_data, 5959 global_id,5960 DspinDhccpParam::MULTI_ACK_DEST);5957 dest, 5958 DspinDhccpParam::MULTI_ACK_DEST); 5961 5959 5962 5960 DspinDhccpParam::dspin_set(dspin_send_data, 5963 r_dcache_cc_send_updt_tab_idx.read(), 5964 DspinDhccpParam::MULTI_ACK_UPDT_INDEX); 5965 } 5966 // icache active request 5967 else 5968 { 5969 // compute global id 5970 uint32_t nline_size = vci_param::N - (uint32_log2(m_icache_words)) - (uint32_log2(vci_param::B)); 5971 uint64_t global_id = (uint64_t) r_icache_cc_send_nline.read(); 5972 global_id >>= (nline_size - m_x_width - m_y_width) << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5961 r_dcache_cc_send_updt_tab_idx.read(), 5962 DspinDhccpParam::MULTI_ACK_UPDT_INDEX); 5963 } 5964 else // icache active request 5965 { 5966 uint64_t dest = (uint64_t)r_icache_cc_send_nline.read() 5967 >> (m_nline_width - m_x_width - m_y_width) 5968 << (DspinDhccpParam::GLOBALID_WIDTH - m_x_width - m_y_width); 5969 5973 5970 5974 5971 DspinDhccpParam::dspin_set(dspin_send_data, 5975 global_id,5976 DspinDhccpParam::MULTI_ACK_DEST);5972 dest, 5973 DspinDhccpParam::MULTI_ACK_DEST); 5977 5974 5978 5975 DspinDhccpParam::dspin_set(dspin_send_data, 5979 r_icache_cc_send_updt_tab_idx.read(),5980 DspinDhccpParam::MULTI_ACK_UPDT_INDEX);5976 r_icache_cc_send_updt_tab_idx.read(), 5977 DspinDhccpParam::MULTI_ACK_UPDT_INDEX); 5981 5978 } 5982 5979 // send flit … … 5987 5984 } // end switch CC_SEND FSM 5988 5985 5989 // //////////////////5990 // CC_RECEIVE FSM //5991 //////////////////// 5986 // Receive coherence packets 5987 // It depends on the CC_RECEIVE FSM 5988 5992 5989 switch( r_cc_receive_fsm.read() ) 5993 5990 { -
branches/v5/modules/vci_mem_cache_dspin_coherence/caba/source/include/vci_mem_cache_dspin_coherence.h
r336 r346 326 326 327 327 // debug variables (for each FSM) 328 size_t m_debug_start_cycle;329 bool m_debug_ok;330 328 bool m_debug_global; 331 329 bool m_debug_tgt_cmd_fsm; … … 379 377 soclib::caba::VciTarget<vci_param> p_vci_tgt; 380 378 soclib::caba::VciInitiator<vci_param> p_vci_ixr; 381 382 379 soclib::caba::DspinInput<33> p_dspin_in; 383 380 soclib::caba::DspinOutput<40> p_dspin_out; … … 385 382 VciMemCache( 386 383 sc_module_name name, // Instance Name 387 const soclib::common::MappingTable &mtp, // Mapping table for primary requets 388 const soclib::common::MappingTable &mtc, // Mapping table for coherence requets 389 const soclib::common::MappingTable &mtx, // Mapping table for XRAM 390 const soclib::common::IntTab &vci_ixr_index, // VCI port to XRAM (initiator) 391 const soclib::common::IntTab &vci_ini_index, // VCI port to PROC (initiator) 392 const soclib::common::IntTab &vci_tgt_index, // VCI port to PROC (target) 393 const soclib::common::IntTab &vci_tgt_index_cleanup,// VCI port to PROC (target) for cleanup 394 size_t nways, // Number of ways per set 395 size_t nsets, // Number of sets 396 size_t nwords, // Number of words per line 397 size_t heap_size=1024, // Size of the heap 398 size_t transaction_tab_lines=TRANSACTION_TAB_LINES, // Size of the TRT 399 size_t update_tab_lines=UPDATE_TAB_LINES, // Size of the UPT 400 size_t debug_start_cycle=0, 401 bool debug_ok=false); 384 const soclib::common::MappingTable &mtp, // Mapping table for direct network 385 const soclib::common::MappingTable &mtx, // Mapping table for external network 386 const soclib::common::IntTab &srcid_x, // global index on external network 387 const soclib::common::IntTab &tgtid_d, // global index on direct network 388 const size_t cc_global_id, // global index on cc network 389 const size_t nways, // Number of ways per set 390 const size_t nsets, // Number of sets 391 const size_t nwords, // Number of words per line 392 const size_t max_copies, // max number of copies in heap 393 const size_t heap_size=1024, // number of heap entries 394 const size_t trt_lines=TRANSACTION_TAB_LINES, 395 const size_t upt_lines=UPDATE_TAB_LINES, 396 const size_t debug_start_cycle=0, 397 const bool debug_ok=false ); 402 398 403 399 ~VciMemCache(); … … 417 413 418 414 // Component attributes 419 std::list<soclib::common::Segment> m_seglist; // memory cached into the cache 420 std::list<soclib::common::Segment> m_cseglist; // coherence segment for the cache 421 422 const size_t m_initiators; // Number of initiators 423 const size_t m_heap_size; // Size of the heap 424 const size_t m_ways; // Number of ways in a set 425 const size_t m_sets; // Number of cache sets 426 const size_t m_words; // Number of words in a line 427 const size_t m_srcid_ixr; // Srcid for requests to XRAM 428 const size_t m_srcid_ini; // Srcid for requests to processors 429 430 uint32_t m_transaction_tab_lines; 431 TransactionTab m_transaction_tab; // xram transaction table 432 uint32_t m_update_tab_lines; 433 UpdateTab m_update_tab; // pending update & invalidate 434 CacheDirectory m_cache_directory; // data cache directory 435 CacheData m_cache_data; // data array[set][way][word] 436 HeapDirectory m_heap; // heap for copies 415 std::list<soclib::common::Segment> m_seglist; // segments allocated to memcache 416 size_t m_nseg; // number of segments 417 soclib::common::Segment **m_seg; // array of segments pointers 418 const size_t m_srcid_x; // global index on external network 419 const size_t m_initiators; // Number of initiators 420 const size_t m_heap_size; // Size of the heap 421 const size_t m_ways; // Number of ways in a set 422 const size_t m_sets; // Number of cache sets 423 const size_t m_words; // Number of words in a line 424 const size_t m_cc_global_id; // global_index on cc network 425 size_t m_debug_start_cycle; 426 bool m_debug_ok; 427 uint32_t m_trt_lines; 428 TransactionTab m_trt; // xram transaction table 429 uint32_t m_upt_lines; 430 UpdateTab m_upt; // pending update & invalidate 431 CacheDirectory m_cache_directory; // data cache directory 432 CacheData m_cache_data; // data array[set][way][word] 433 HeapDirectory m_heap; // heap for copies 434 size_t m_max_copies; // max number of copies in heap 437 435 GenericLLSCGlobalTable 438 < 439 32 , // desired number of slots 440 4096, // number of processors in the system 441 8000, // registratioçn life span (in # of LL operations) 442 typename vci_param::fast_addr_t // address type 443 > 444 m_llsc_table; // ll/sc global registration table 436 < 32 , // number of slots 437 4096, // number of processors in the system 438 8000, // registratioçn life span (in # of LL operations) 439 typename vci_param::fast_addr_t > // address type 440 m_llsc_table; // ll/sc global registration table 445 441 446 442 // adress masks 447 const soclib::common::AddressMaskingTable<vci_addr_t> m_x;448 const soclib::common::AddressMaskingTable<vci_addr_t> m_y;449 const soclib::common::AddressMaskingTable<vci_addr_t> m_z;450 const soclib::common::AddressMaskingTable<vci_addr_t> m_nline;443 const soclib::common::AddressMaskingTable<vci_addr_t> m_x; 444 const soclib::common::AddressMaskingTable<vci_addr_t> m_y; 445 const soclib::common::AddressMaskingTable<vci_addr_t> m_z; 446 const soclib::common::AddressMaskingTable<vci_addr_t> m_nline; 451 447 452 448 // broadcast address 453 uint32_t m_broadcast_address; 454 455 ////////////////////////////////////////////////// 456 // Others registers 457 ////////////////////////////////////////////////// 458 sc_signal<size_t> r_copies_limit; // Limit of the number of copies for one line 459 sc_signal<size_t> xxx_count; 449 uint32_t m_broadcast_address; 460 450 461 451 ////////////////////////////////////////////////// … … 495 485 sc_signal<int> r_tgt_cmd_fsm; 496 486 497 size_t m_nseg;498 size_t m_ncseg;499 soclib::common::Segment **m_seg;500 soclib::common::Segment **m_cseg;501 487 /////////////////////////////////////////////////////// 502 488 // Registers controlled by the READ fsm -
branches/v5/modules/vci_mem_cache_dspin_coherence/caba/source/src/vci_mem_cache_dspin_coherence.cpp
r339 r346 1 1 /* -*- c++ -*- 2 * 2 3 * File : vci_mem_cache.cpp 3 4 * Date : 30/10/2008 … … 275 276 VciMemCache<vci_param> 276 277 277 using soclib::common::uint32_log2;278 using namespace soclib::common; 278 279 279 280 //////////////////////////////// … … 282 283 283 284 tmpl(/**/) ::VciMemCache( 284 sc_module_name name, 285 const soclib::common::MappingTable &mtp, 286 const soclib::common::MappingTable &mtc, 287 const soclib::common::MappingTable &mtx, 288 const soclib::common::IntTab &vci_ixr_index, 289 const soclib::common::IntTab &vci_ini_index, 290 const soclib::common::IntTab &vci_tgt_index, 291 const soclib::common::IntTab &vci_tgt_index_cleanup, 292 size_t nways, // number of ways per set 293 size_t nsets, // number of cache sets 294 size_t nwords, // number of words in cache line 295 size_t heap_size, // number of heap entries 296 size_t transaction_tab_lines, // number of TRT entries 297 size_t update_tab_lines, // number of UPT entries 298 size_t debug_start_cycle, 299 bool debug_ok) 285 sc_module_name name, 286 const MappingTable &mtp, // mapping table for direct network 287 const MappingTable &mtx, // mapping table for external network 288 const IntTab &srcid_x, // global index on external network 289 const IntTab &tgtid_d, // global index on direct network 290 const size_t cc_global_id, // global index on cc network 291 const size_t nways, // number of ways per set 292 const size_t nsets, // number of associative sets 293 const size_t nwords, // number of words in cache line 294 const size_t max_copies, // max number of copies in heap 295 const size_t heap_size, // number of heap entries 296 const size_t trt_lines, // number of TRT entries 297 const size_t upt_lines, // number of UPT entries 298 const size_t debug_start_cycle, 299 const bool debug_ok) 300 300 301 301 : soclib::caba::BaseModule(name), 302 302 303 m_debug_start_cycle(debug_start_cycle), 304 m_debug_ok(debug_ok), 305 306 p_clk("clk"), 307 p_resetn("resetn"), 308 p_vci_tgt("vci_tgt"), 309 p_vci_ixr("vci_ixr"), 310 p_dspin_in("dspin_tgt"), 311 p_dspin_out("cc_send"), 312 313 m_seglist(mtp.getSegmentList(vci_tgt_index)), 314 m_cseglist(mtc.getSegmentList(vci_tgt_index_cleanup)), 315 316 m_initiators(1 << vci_param::S), 317 m_heap_size(heap_size), 318 m_ways(nways), 319 m_sets(nsets), 320 m_words(nwords), 321 m_srcid_ixr(mtx.indexForId(vci_ixr_index)), 322 m_srcid_ini(mtc.indexForId(vci_ini_index)), 323 m_transaction_tab_lines(transaction_tab_lines), 324 m_transaction_tab(transaction_tab_lines, nwords), 325 m_update_tab_lines(update_tab_lines), 326 m_update_tab(update_tab_lines), 303 p_clk( "p_clk" ), 304 p_resetn( "p_resetn" ), 305 p_vci_tgt( "p_vci_tgt" ), 306 p_vci_ixr( "p_vci_ixr" ), 307 p_dspin_in( "p_dspin_in" ), 308 p_dspin_out( "p_dspin_out" ), 309 310 m_seglist( mtp.getSegmentList(tgtid_d) ), 311 m_nseg( 0 ), 312 m_srcid_x( mtx.indexForId(srcid_x) ), 313 m_initiators( 1 << vci_param::S ), 314 m_heap_size( heap_size ), 315 m_ways( nways ), 316 m_sets( nsets ), 317 m_words( nwords ), 318 m_cc_global_id( cc_global_id ), 319 m_debug_start_cycle( debug_start_cycle ), 320 m_debug_ok( debug_ok ), 321 m_trt_lines(trt_lines), 322 m_trt(trt_lines, nwords), 323 m_upt_lines(upt_lines), 324 m_upt(upt_lines), 327 325 m_cache_directory(nways, nsets, nwords, vci_param::N), 328 326 m_cache_data(nways, nsets, nwords), 329 327 m_heap(m_heap_size), 328 m_max_copies( max_copies ), 330 329 m_llsc_table(), 331 330 … … 368 367 r_tgt_cmd_fsm("r_tgt_cmd_fsm"), 369 368 370 m_nseg(0),371 m_ncseg(0),372 373 369 r_read_fsm("r_read_fsm"), 374 370 … … 416 412 r_alloc_heap_reset_cpt("r_alloc_heap_reset_cpt") 417 413 { 418 assert(IS_POW_OF_2(nsets));419 assert(IS_POW_OF_2(nwords));420 assert(IS_POW_OF_2(nways));421 assert(nsets);422 assert(nwords);423 assert(nways);424 425 // check Transaction table size426 assert((uint32_log2(transaction_tab_lines) <= vci_param::T) and414 assert(IS_POW_OF_2(nsets)); 415 assert(IS_POW_OF_2(nwords)); 416 assert(IS_POW_OF_2(nways)); 417 assert(nsets); 418 assert(nwords); 419 assert(nways); 420 421 // check Transaction table size 422 assert((uint32_log2(trt_lines) <= vci_param::T) and 427 423 "Need more bits for VCI TRDID field"); 428 424 429 // Get the segments associated to the MemCache 430 std::list<soclib::common::Segment>::iterator seg; 431 size_t i; 432 433 for(seg = m_seglist.begin(); seg != m_seglist.end() ; seg++) 434 { 435 m_nseg++; 436 } 437 for(seg = m_cseglist.begin(); seg != m_cseglist.end() ; seg++) 438 { 439 m_ncseg++; 440 } 441 442 m_seg = new soclib::common::Segment*[m_nseg]; 443 444 i = 0; 445 for(seg = m_seglist.begin() ; seg != m_seglist.end() ; seg++) 446 { 447 m_seg[i] = & (*seg); 448 i++; 449 } 450 451 m_cseg = new soclib::common::Segment*[m_ncseg]; 452 453 i = 0; 454 for(seg = m_cseglist.begin() ; seg != m_cseglist.end() ; seg++) 455 { 456 m_cseg[i] = & (*seg); 457 i++; 458 } 459 460 // Allocation for IXR_RSP FSM 461 r_ixr_rsp_to_xram_rsp_rok = new sc_signal<bool>[m_transaction_tab_lines]; 462 463 // Allocation for XRAM_RSP FSM 464 r_xram_rsp_victim_data = new sc_signal<data_t>[nwords]; 465 r_xram_rsp_to_tgt_rsp_data = new sc_signal<data_t>[nwords]; 466 r_xram_rsp_to_ixr_cmd_data = new sc_signal<data_t>[nwords]; 467 468 // Allocation for READ FSM 469 r_read_data = new sc_signal<data_t>[nwords]; 470 r_read_to_tgt_rsp_data = new sc_signal<data_t>[nwords]; 471 472 // Allocation for WRITE FSM 473 r_write_data = new sc_signal<data_t>[nwords]; 474 r_write_be = new sc_signal<be_t>[nwords]; 475 r_write_to_cc_send_data = new sc_signal<data_t>[nwords]; 476 r_write_to_cc_send_be = new sc_signal<be_t>[nwords]; 477 r_write_to_ixr_cmd_data = new sc_signal<data_t>[nwords]; 478 479 // Allocation for CAS FSM 480 r_cas_to_ixr_cmd_data = new sc_signal<data_t>[nwords]; 481 r_cas_data = new sc_signal<data_t>[nwords]; 482 r_cas_rdata = new sc_signal<data_t>[2]; 483 484 485 // Simulation 486 487 SC_METHOD(transition); 488 dont_initialize(); 489 sensitive << p_clk.pos(); 490 491 SC_METHOD(genMoore); 492 dont_initialize(); 493 sensitive << p_clk.neg(); 425 // Get the segments associated to the MemCache 426 std::list<soclib::common::Segment>::iterator seg; 427 size_t i = 0; 428 429 for(seg = m_seglist.begin(); seg != m_seglist.end() ; seg++) 430 { 431 m_nseg++; 432 } 433 434 m_seg = new soclib::common::Segment*[m_nseg]; 435 436 for(seg = m_seglist.begin() ; seg != m_seglist.end() ; seg++) 437 { 438 m_seg[i] = & (*seg); 439 i++; 440 } 441 442 // Allocation for IXR_RSP FSM 443 r_ixr_rsp_to_xram_rsp_rok = new sc_signal<bool>[m_trt_lines]; 444 445 // Allocation for XRAM_RSP FSM 446 r_xram_rsp_victim_data = new sc_signal<data_t>[nwords]; 447 r_xram_rsp_to_tgt_rsp_data = new sc_signal<data_t>[nwords]; 448 r_xram_rsp_to_ixr_cmd_data = new sc_signal<data_t>[nwords]; 449 450 // Allocation for READ FSM 451 r_read_data = new sc_signal<data_t>[nwords]; 452 r_read_to_tgt_rsp_data = new sc_signal<data_t>[nwords]; 453 454 // Allocation for WRITE FSM 455 r_write_data = new sc_signal<data_t>[nwords]; 456 r_write_be = new sc_signal<be_t>[nwords]; 457 r_write_to_cc_send_data = new sc_signal<data_t>[nwords]; 458 r_write_to_cc_send_be = new sc_signal<be_t>[nwords]; 459 r_write_to_ixr_cmd_data = new sc_signal<data_t>[nwords]; 460 461 // Allocation for CAS FSM 462 r_cas_to_ixr_cmd_data = new sc_signal<data_t>[nwords]; 463 r_cas_data = new sc_signal<data_t>[nwords]; 464 r_cas_rdata = new sc_signal<data_t>[2]; 465 466 467 SC_METHOD(transition); 468 dont_initialize(); 469 sensitive << p_clk.pos(); 470 471 SC_METHOD(genMoore); 472 dont_initialize(); 473 sensitive << p_clk.neg(); 494 474 } // end constructor 495 475 … … 580 560 std::cout << "----------------------------------" << std::dec << std::endl; 581 561 std::cout 582 << "MEM_CACHE " << m_srcid_ini<< " / Time = " << m_cpt_cycles << std::endl562 << "MEM_CACHE " << name() << " / Time = " << m_cpt_cycles << std::endl 583 563 << "- READ RATE = " << (double) m_cpt_read/m_cpt_cycles << std::endl 584 564 << "- READ TOTAL = " << m_cpt_read << std::endl … … 666 646 667 647 // Initializing Tables 668 m_tr ansaction_tab.init();669 m_up date_tab.init();648 m_trt.init(); 649 m_upt.init(); 670 650 m_llsc_table.init(); 671 651 … … 728 708 #endif 729 709 730 for(size_t i=0; i<m_tr ansaction_tab_lines ; i++)710 for(size_t i=0; i<m_trt_lines ; i++) 731 711 { 732 712 r_ixr_rsp_to_xram_rsp_rok[i] = false; … … 748 728 r_alloc_dir_reset_cpt = 0; 749 729 r_alloc_heap_reset_cpt = 0; 750 751 r_copies_limit = 3;752 730 753 731 // Activity counters … … 835 813 std::cout 836 814 << "---------------------------------------------" << std::dec << std::endl 837 << "MEM_CACHE " << m_srcid_ini815 << "MEM_CACHE " << name() 838 816 << " ; Time = " << m_cpt_cycles << std::endl 839 817 << " - TGT_CMD FSM = " << tgt_cmd_fsm_str[r_tgt_cmd_fsm.read()] << std::endl … … 1139 1117 (DspinDhccpParam::dspin_get(flit, DspinDhccpParam::FROM_L1_EOP) == 0x1); 1140 1118 1141 if(updt_index >= m_up date_tab.size())1119 if(updt_index >= m_upt.size()) 1142 1120 { 1143 1121 std::cout … … 1147 1125 << std::dec 1148 1126 << " / UPT index = " << updt_index 1149 << " / UPT size = " << m_up date_tab.size()1127 << " / UPT size = " << m_upt.size() 1150 1128 << std::endl; 1151 1129 … … 1188 1166 // decrement the number of expected responses 1189 1167 size_t count = 0; 1190 bool valid = m_up date_tab.decrement(r_multi_ack_upt_index.read(), count);1168 bool valid = m_upt.decrement(r_multi_ack_upt_index.read(), count); 1191 1169 1192 1170 if(not valid) … … 1237 1215 } 1238 1216 1239 r_multi_ack_srcid = m_up date_tab.srcid(r_multi_ack_upt_index.read());1240 r_multi_ack_trdid = m_up date_tab.trdid(r_multi_ack_upt_index.read());1241 r_multi_ack_pktid = m_up date_tab.pktid(r_multi_ack_upt_index.read());1242 r_multi_ack_nline = m_up date_tab.nline(r_multi_ack_upt_index.read());1243 bool need_rsp = m_up date_tab.need_rsp(r_multi_ack_upt_index.read());1217 r_multi_ack_srcid = m_upt.srcid(r_multi_ack_upt_index.read()); 1218 r_multi_ack_trdid = m_upt.trdid(r_multi_ack_upt_index.read()); 1219 r_multi_ack_pktid = m_upt.pktid(r_multi_ack_upt_index.read()); 1220 r_multi_ack_nline = m_upt.nline(r_multi_ack_upt_index.read()); 1221 bool need_rsp = m_upt.need_rsp(r_multi_ack_upt_index.read()); 1244 1222 1245 1223 // clear the UPT entry 1246 m_up date_tab.clear(r_multi_ack_upt_index.read());1224 m_upt.clear(r_multi_ack_upt_index.read()); 1247 1225 1248 1226 if(need_rsp) … … 1570 1548 { 1571 1549 // enter counter mode when we reach the limit of copies or the heap is full 1572 bool go_cnt = (r_read_count.read() >= r_copies_limit.read()) || m_heap.is_full();1550 bool go_cnt = (r_read_count.read() >= m_max_copies) || m_heap.is_full(); 1573 1551 1574 1552 // read data in the cache … … 1813 1791 size_t index = 0; 1814 1792 vci_addr_t addr = (vci_addr_t) m_cmd_read_addr_fifo.read(); 1815 bool hit_read = m_tr ansaction_tab.hit_read(m_nline[addr], index);1816 bool hit_write = m_tr ansaction_tab.hit_write(m_nline[addr]);1817 bool wok = !m_tr ansaction_tab.full(index);1793 bool hit_read = m_trt.hit_read(m_nline[addr], index); 1794 bool hit_write = m_trt.hit_write(m_nline[addr]); 1795 bool wok = !m_trt.full(index); 1818 1796 1819 1797 if(hit_read || !wok || hit_write) // missing line already requested or no space … … 1848 1826 if(r_alloc_trt_fsm.read() == ALLOC_TRT_READ) 1849 1827 { 1850 m_tr ansaction_tab.set(r_read_trt_index.read(),1828 m_trt.set(r_read_trt_index.read(), 1851 1829 true, 1852 1830 m_nline[(vci_addr_t)(m_cmd_read_addr_fifo.read())], … … 2301 2279 size_t way = r_write_way.read(); 2302 2280 2303 wok = m_up date_tab.set(true, // it's an update transaction2281 wok = m_upt.set(true, // it's an update transaction 2304 2282 false, // it's not a broadcast 2305 2283 true, // it needs a response … … 2620 2598 size_t wok_index = 0; 2621 2599 vci_addr_t addr = (vci_addr_t) r_write_address.read(); 2622 bool hit_read = m_tr ansaction_tab.hit_read(m_nline[addr], hit_index);2623 bool hit_write = m_tr ansaction_tab.hit_write(m_nline[addr]);2624 bool wok = !m_tr ansaction_tab.full(wok_index);2600 bool hit_read = m_trt.hit_read(m_nline[addr], hit_index); 2601 bool hit_write = m_trt.hit_write(m_nline[addr]); 2602 bool wok = !m_trt.full(wok_index); 2625 2603 2626 2604 if(hit_read) // register the modified data in TRT … … 2672 2650 data_vector.push_back(r_write_data[i]); 2673 2651 } 2674 m_tr ansaction_tab.set(r_write_trt_index.read(),2652 m_trt.set(r_write_trt_index.read(), 2675 2653 true, // read request to XRAM 2676 2654 m_nline[(vci_addr_t)(r_write_address.read())], … … 2709 2687 data_vector.push_back(r_write_data[i]); 2710 2688 } 2711 m_tr ansaction_tab.write_data_mask(r_write_trt_index.read(),2689 m_trt.write_data_mask(r_write_trt_index.read(), 2712 2690 be_vector, 2713 2691 data_vector); … … 2718 2696 { 2719 2697 std::cout << " <MEMC " << name() << ".WRITE_MISS_TRT_DATA> Modify an existing entry in TRT" << std::endl; 2720 m_tr ansaction_tab.print(r_write_trt_index.read());2698 m_trt.print(r_write_trt_index.read()); 2721 2699 } 2722 2700 #endif … … 2752 2730 { 2753 2731 size_t wok_index = 0; 2754 bool wok = !m_tr ansaction_tab.full(wok_index);2732 bool wok = !m_trt.full(wok_index); 2755 2733 if(wok) // set a new entry in TRT 2756 2734 { … … 2787 2765 size_t nb_copies = r_write_count.read(); 2788 2766 2789 wok =m_up date_tab.set(false, // it's an inval transaction2767 wok =m_upt.set(false, // it's an inval transaction 2790 2768 true, // it's a broadcast 2791 2769 true, // it needs a response … … 2830 2808 2831 2809 // register a write request to XRAM in TRT 2832 m_tr ansaction_tab.set(r_write_trt_index.read(),2810 m_trt.set(r_write_trt_index.read(), 2833 2811 false, // write request to XRAM 2834 2812 m_nline[(vci_addr_t)(r_write_address.read())], … … 3160 3138 if(r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP) 3161 3139 { 3162 m_tr ansaction_tab.erase(r_ixr_rsp_trt_index.read());3140 m_trt.erase(r_ixr_rsp_trt_index.read()); 3163 3141 r_ixr_rsp_fsm = IXR_RSP_IDLE; 3164 3142 … … 3184 3162 assert(((eop == (r_ixr_rsp_cpt.read() == (m_words-1))) || p_vci_ixr.rerror.read()) 3185 3163 and "Error in VCI_MEM_CACHE : invalid length for a response from XRAM"); 3186 m_tr ansaction_tab.write_rsp(index,3164 m_trt.write_rsp(index, 3187 3165 r_ixr_rsp_cpt.read(), 3188 3166 data, … … 3238 3216 { 3239 3217 size_t ptr = r_xram_rsp_trt_index.read(); 3240 size_t lines = m_tr ansaction_tab_lines;3218 size_t lines = m_trt_lines; 3241 3219 for(size_t i=0 ; i<lines ; i++) 3242 3220 { … … 3272 3250 size_t index = r_xram_rsp_trt_index.read(); 3273 3251 3274 TransactionTabEntry trt_entry(m_tr ansaction_tab.read(index));3252 TransactionTabEntry trt_entry(m_trt.read(index)); 3275 3253 r_xram_rsp_trt_buf.copy(trt_entry); // TRT entry local buffer 3276 3254 … … 3352 3330 { 3353 3331 size_t index; 3354 if(m_up date_tab.search_inval(r_xram_rsp_trt_buf.nline, index))3332 if(m_upt.search_inval(r_xram_rsp_trt_buf.nline, index)) 3355 3333 { 3356 3334 r_xram_rsp_fsm = XRAM_RSP_INVAL_WAIT; … … 3361 3339 std::cout << " <MEMC " << name() << ".XRAM_RSP_INVAL_LOCK> Get acces to UPT," 3362 3340 << " but an invalidation is already registered at this address" << std::endl; 3363 m_up date_tab.print();3341 m_upt.print(); 3364 3342 } 3365 3343 #endif 3366 3344 3367 3345 } 3368 else if(m_up date_tab.is_full() && r_xram_rsp_victim_inval.read())3346 else if(m_upt.is_full() && r_xram_rsp_victim_inval.read()) 3369 3347 { 3370 3348 r_xram_rsp_fsm = XRAM_RSP_INVAL_WAIT; … … 3375 3353 std::cout << " <MEMC " << name() << ".XRAM_RSP_INVAL_LOCK> Get acces to UPT," 3376 3354 << " but the table is full" << std::endl; 3377 m_up date_tab.print();3355 m_upt.print(); 3378 3356 } 3379 3357 #endif … … 3463 3441 size_t count_copies = r_xram_rsp_victim_count.read(); 3464 3442 3465 bool wok = m_up date_tab.set(false, // it's an inval transaction3443 bool wok = m_upt.set(false, // it's an inval transaction 3466 3444 brdcast, // set brdcast bit 3467 3445 false, // it does not need a response … … 3501 3479 // If the victim is not dirty, we don't need another XRAM put transaction, 3502 3480 // and we canwe erase the TRT entry 3503 if(!r_xram_rsp_victim_dirty.read()) m_tr ansaction_tab.erase(r_xram_rsp_trt_index.read());3481 if(!r_xram_rsp_victim_dirty.read()) m_trt.erase(r_xram_rsp_trt_index.read()); 3504 3482 3505 3483 // Next state … … 3515 3493 if(r_alloc_trt_fsm.read() == ALLOC_TRT_XRAM_RSP) 3516 3494 { 3517 m_tr ansaction_tab.set(r_xram_rsp_trt_index.read(),3495 m_trt.set(r_xram_rsp_trt_index.read(), 3518 3496 false, // write to XRAM 3519 3497 r_xram_rsp_victim_nline.read(), // line index … … 3740 3718 case XRAM_RSP_ERROR_ERASE: // erase TRT entry in case of error 3741 3719 { 3742 m_tr ansaction_tab.erase(r_xram_rsp_trt_index.read());3720 m_trt.erase(r_xram_rsp_trt_index.read()); 3743 3721 3744 3722 // Next state … … 4435 4413 bool match_inval; 4436 4414 4437 match_inval = m_up date_tab.search_inval(r_cleanup_nline.read(), index);4415 match_inval = m_upt.search_inval(r_cleanup_nline.read(), index); 4438 4416 4439 4417 // no pending inval … … 4458 4436 4459 4437 // pending inval 4460 r_cleanup_write_srcid = m_up date_tab.srcid(index);4461 r_cleanup_write_trdid = m_up date_tab.trdid(index);4462 r_cleanup_write_pktid = m_up date_tab.pktid(index);4463 r_cleanup_write_need_rsp = m_up date_tab.need_rsp(index);4438 r_cleanup_write_srcid = m_upt.srcid(index); 4439 r_cleanup_write_trdid = m_upt.trdid(index); 4440 r_cleanup_write_pktid = m_upt.pktid(index); 4441 r_cleanup_write_need_rsp = m_upt.need_rsp(index); 4464 4442 r_cleanup_index = index; 4465 4443 … … 4497 4475 4498 4476 size_t count = 0; 4499 m_up date_tab.decrement(r_cleanup_index.read(), count);4477 m_upt.decrement(r_cleanup_index.read(), count); 4500 4478 4501 4479 // invalidation transaction finished … … 4539 4517 } 4540 4518 4541 m_up date_tab.clear(r_cleanup_index.read());4519 m_upt.clear(r_cleanup_index.read()); 4542 4520 4543 4521 if(r_cleanup_write_need_rsp.read()) … … 4919 4897 size_t nb_copies = r_cas_count.read(); 4920 4898 4921 wok = m_up date_tab.set(true, // it's an update transaction4899 wok = m_upt.set(true, // it's an update transaction 4922 4900 false, // it's not a broadcast 4923 4901 true, // it needs a response … … 5125 5103 } 5126 5104 size_t wok_index = 0; 5127 bool wok = !m_tr ansaction_tab.full(wok_index);5105 bool wok = !m_trt.full(wok_index); 5128 5106 if(wok) 5129 5107 { … … 5158 5136 5159 5137 // register a broadcast inval transaction in UPT 5160 wok = m_up date_tab.set(false, // it's an inval transaction5138 wok = m_upt.set(false, // it's an inval transaction 5161 5139 true, // it's a broadcast 5162 5140 true, // it needs a response … … 5216 5194 { 5217 5195 // set TRT 5218 m_tr ansaction_tab.set(r_cas_trt_index.read(),5196 m_trt.set(r_cas_trt_index.read(), 5219 5197 false, // PUT request to XRAM 5220 5198 m_nline[(vci_addr_t)(m_cmd_cas_addr_fifo.read())], … … 5361 5339 { 5362 5340 size_t index = 0; 5363 bool hit_read = m_tr ansaction_tab.hit_read(5341 bool hit_read = m_trt.hit_read( 5364 5342 m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()],index); 5365 bool hit_write = m_tr ansaction_tab.hit_write(5343 bool hit_write = m_trt.hit_write( 5366 5344 m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()]); 5367 bool wok = !m_tr ansaction_tab.full(index);5345 bool wok = !m_trt.full(index); 5368 5346 5369 5347 #if DEBUG_MEMC_CAS … … 5405 5383 } 5406 5384 5407 m_tr ansaction_tab.set(r_cas_trt_index.read(),5385 m_trt.set(r_cas_trt_index.read(), 5408 5386 true, // read request 5409 5387 m_nline[(vci_addr_t) m_cmd_cas_addr_fifo.read()], … … 7162 7140 p_vci_ixr.be = 0xF; 7163 7141 p_vci_ixr.pktid = 0; 7164 p_vci_ixr.srcid = m_srcid_ ixr;7142 p_vci_ixr.srcid = m_srcid_x; 7165 7143 p_vci_ixr.cons = false; 7166 7144 p_vci_ixr.wrap = false; … … 7288 7266 // Response signals on the p_vci_tgt port 7289 7267 //////////////////////////////////////////////////// 7268 7290 7269 switch(r_tgt_rsp_fsm.read()) 7291 7270 { … … 7384 7363 // Initiator command signals on the p_dspin_out port (CC_SEND FSM) 7385 7364 //////////////////////////////////////////////////////////////////// 7365 7386 7366 p_dspin_out.write = false; 7387 7367 p_dspin_out.data = 0; … … 7389 7369 switch(r_cc_send_fsm.read()) 7390 7370 { 7371 7391 7372 case CC_SEND_XRAM_RSP_IDLE: 7392 7373 case CC_SEND_WRITE_IDLE: … … 7463 7444 DspinDhccpParam::dspin_set( 7464 7445 flit, 7465 m_ srcid_ini,7446 m_cc_global_id, 7466 7447 DspinDhccpParam::MULTI_INVAL_SRCID); 7467 7448 … … 7516 7497 DspinDhccpParam::dspin_set( 7517 7498 flit, 7518 m_ srcid_ini,7499 m_cc_global_id, 7519 7500 DspinDhccpParam::BROADCAST_SRCID); 7520 7501 … … 7613 7594 DspinDhccpParam::dspin_set( 7614 7595 flit, 7615 m_ srcid_ini,7596 m_cc_global_id, 7616 7597 DspinDhccpParam::MULTI_UPDT_SRCID); 7617 7598 … … 7717 7698 DspinDhccpParam::dspin_set( 7718 7699 flit, 7719 m_ srcid_ini,7700 m_cc_global_id, 7720 7701 DspinDhccpParam::MULTI_UPDT_SRCID); 7721 7702
Note: See TracChangeset
for help on using the changeset viewer.