- Timestamp:
- Aug 25, 2014, 5:58:16 PM (10 years ago)
- Location:
- branches/RWT
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/lib/generic_cache_tsar/include/generic_cache.h
r477 r767 586 586 data_t data) 587 587 { 588 /**/ //std::cout << "write cache : way = "<<way<<" | set = "<<set<<" | word = "<<word<<" | data = "<<(uint32_t)data << std::endl;589 588 cache_data(way, set, word) = data; 590 589 cache_set_lru(way, set); -
branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h
r646 r767 280 280 }; 281 281 282 // enum transaction_type_d_e 283 // { 284 // // b0 : 1 if cached 285 // // b1 : 1 if instruction 286 // TYPE_DATA_UNC = 0x0, 287 // TYPE_DATA_MISS = 0x1, 288 // TYPE_INS_UNC = 0x2, 289 // TYPE_INS_MISS = 0x3, 290 // }; 291 292 //////////////////MODIFIED//////////////// 282 283 // cache line status 293 284 enum content_line_cache_status_e 294 285 { … … 522 513 sc_signal<size_t> r_dcache_cc_send_updt_tab_idx; // DCACHE cc_send update table index 523 514 524 // special registers for ODCCP/RWT525 sc_signal<bool> r_dcache_cc_cleanup_updt_data; 526 sc_signal<bool> r_dcache_cc_cleanup_line_ncc; 527 sc_signal<bool> r_dcache_miss_victim_no_coherence; 528 sc_signal<bool> r_dcache_line_no_coherence; 515 // special registers for RWT 516 sc_signal<bool> r_dcache_cc_cleanup_updt_data; // Register for cleanup with data (wb updt) 517 sc_signal<bool> r_dcache_cc_cleanup_line_ncc; // Register for cleanup with data (wb updt) 518 sc_signal<bool> r_dcache_miss_victim_no_coherence; // Register for victim in no coherence mode 519 sc_signal<bool> r_dcache_line_no_coherence; // Register for line current in no coherence mode 529 520 sc_signal<bool> r_dcache_dirty_save; 530 521 sc_signal<uint32_t> r_cc_send_cpt_word; … … 536 527 sc_signal<paddr_t> r_dcache_xtn_data_addr; 537 528 sc_signal<uint32_t> r_dcache_xtn_data_cpt; 529 sc_signal<bool> r_dcache_read_state; 530 538 531 // dcache directory extension 539 ///////////////////////////MODIFIED///////////////////////////////////////////////////540 //bool *r_dcache_in_tlb; // copy exist in dtlb or itlb541 //bool *r_dcache_contains_ptd; // cache line contains a PTD542 532 int *r_dcache_content_state; // content state of one cache line 543 int *r_dcache_dirty_word; 544 bool *r_dcache_zombi_ncc; 533 // Stats 534 int *r_dcache_dirty_word; // use for compute number of words dirty per cleanup_data 535 bool *r_dcache_zombi_ncc; // use for compute number of blocked write on ncc zombi line 545 536 ////////////////////////////////////////////////////////////////////////////////////// 546 537 547 //RWT 548 sc_signal<bool> r_dcache_read_state; 549 550 /////////////////////////////////// 538 /////////////////////////////////// 551 539 // Physical address extension for data access 552 540 sc_signal<uint32_t> r_dcache_paddr_ext; // CP2 register (if vci_address > 32) … … 574 562 //RWT 575 563 GenericFifo<bool> r_vci_rsp_fifo_rpktid; 576 577 564 GenericFifo<uint32_t> r_cc_send_data_fifo; 578 565 -
branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r646 r767 346 346 r_dcache_tlb_pte_flags("r_dcache_tlb_pte_flags"), 347 347 r_dcache_tlb_pte_ppn("r_dcache_tlb_pte_ppn"), 348 // r_dcache_tlb_cache_way("r_dcache_tlb_cache_way"),349 // r_dcache_tlb_cache_set("r_dcache_tlb_cache_set"),350 // r_dcache_tlb_cache_word("r_dcache_tlb_cache_word"),351 348 r_dcache_tlb_way("r_dcache_tlb_way"), 352 349 r_dcache_tlb_set("r_dcache_tlb_set"), … … 425 422 426 423 assert( (itlb_sets == dtlb_sets) and 427 "itlb_sets and dtlb_sets parameters must be e tqual");424 "itlb_sets and dtlb_sets parameters must be equal"); 428 425 429 426 assert( (itlb_ways == dtlb_ways) and 430 "itlb_ways and dtlb_ways parameters must be e tqual");427 "itlb_ways and dtlb_ways parameters must be equal"); 431 428 432 429 r_mmu_params = (uint32_log2(m_dtlb_ways) << 29) | (uint32_log2(m_dtlb_sets) << 25) | … … 470 467 ///////////////////////////////////// 471 468 { 472 ////////////MODIFIED/////////////473 //delete [] r_dcache_in_tlb;474 //delete [] r_dcache_contains_ptd;475 469 delete [] r_dcache_content_state; 476 470 delete [] r_dcache_dirty_word; 477 471 delete [] r_dcache_zombi_ncc; 478 472 ///////////////////////////////// 479 print_stats();473 //print_stats(); 480 474 } 481 475 … … 783 777 for (size_t i=0 ; i< m_dcache_ways*m_dcache_sets ; i++) 784 778 { 785 // MODIFIED786 //r_dcache_in_tlb[i] = false;787 //r_dcache_contains_ptd[i] = false;788 779 r_dcache_content_state[i] = LINE_CACHE_DATA_NOT_DIRTY; 789 780 r_dcache_dirty_word[i] = 0; … … 2246 2237 m_drsp.error = false; 2247 2238 m_drsp.rdata = 0; 2248 //if(m_cpt_total_cycles % 1000000 == 0 ) r_dcache.printTrace();2249 2239 2250 2240 switch ( r_dcache_fsm.read() ) … … 2381 2371 size_t way = r_dcache_save_cache_way.read(); 2382 2372 size_t set = r_dcache_save_cache_set.read(); 2383 // MODIFIED 2384 //if ( r_dcache_in_tlb[way*m_dcache_sets+set] ) 2385 //{ 2373 2386 2374 if ( r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_IN_TLB ) 2387 2375 { … … 2390 2378 r_dcache_tlb_inval_line = r_dcache_save_paddr.read()>> 2391 2379 (uint32_log2(m_dcache_words<<2)); 2392 // MODIFIED RWT: DIRTY 2393 //r_dcache_in_tlb[way*m_dcache_sets+set] = false; 2380 2394 2381 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_DIRTY; 2395 2382 } 2396 // MODIFIED2397 //else if ( r_dcache_contains_ptd[way*m_dcache_sets+set] )2398 //{2399 2383 else if ( r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_CONTAINS_PTD ) 2400 2384 { 2401 2385 r_itlb.reset(); 2402 2386 r_dtlb.reset(); 2403 // MODIFIED 2404 //r_dcache_contains_ptd[way*m_dcache_sets+set] = false; 2387 2405 2388 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_DIRTY; 2406 2389 } … … 2802 2785 m_cpt_data_miss++; 2803 2786 #endif 2804 /*ODCCP*/2805 //std::cout << "\t\t\t\t\tCACHE MISS NEED READ for : " << name() << std::endl;2806 2787 // request a VCI DMISS transaction 2807 2788 r_dcache_vci_paddr = paddr; … … 2832 2813 m_cpt_data_read++; 2833 2814 #endif 2834 /*if ((tlb_flags.s == 0) and (r_mmu_mode.read() & DATA_TLB_MASK) and (cache_state == CACHE_SLOT_STATE_VALID_CC))2835 {2836 //ODCCP2837 std::cout << "READ NO COHERENCE on " << name() << " | paddr = " << std::hex << paddr << std::dec << " | way = " << cache_way << " | set = " << cache_set << " | at cycle : "<< m_cpt_total_cycles << std::endl;2838 r_dcache.write_dir(cache_way,2839 cache_set,2840 CACHE_SLOT_STATE_VALID_NCC);2841 }*/2842 2815 // returns data to processor 2843 2816 m_drsp.valid = true; … … 2883 2856 r_dcache_ll_rsp_count = 0; 2884 2857 r_dcache_fsm = DCACHE_LL_WAIT; 2885 /*ODCCP*/2886 //std::cout << "LL on " << name() << " | paddr = " << std::hex << paddr << std::dec << " | at cycle : " << m_cpt_total_cycles << std::endl;2887 2858 2888 2859 }// end LL … … 2973 2944 m_cpt_data_write_on_zombi++; 2974 2945 } 2975 else 2946 else // Miss in DCACHE 2976 2947 { 2977 m_cpt_data_write_miss++; 2978 2979 m_drsp.valid = true; 2980 wbuf_request = true; 2981 updt_request = false; 2948 m_drsp.valid = true; 2949 wbuf_request = true; 2950 updt_request = false; 2951 m_cpt_data_write_miss++; 2982 2952 } 2983 2953 } … … 3155 3125 &word, 3156 3126 &cache_state ); 3127 3157 3128 #ifdef INSTRUMENTATION 3158 3129 m_cpt_dcache_data_read++; 3159 3130 m_cpt_dcache_dir_read++; 3160 3131 #endif 3161 /*ODCCP*/ 3162 // assert((cache_state != CACHE_SLOT_STATE_VALID_NCC) and "DCACHE_TLB_PTE1_GET : IMPOSSIBLE NCC HERE"); 3163 // if ( cache_state == CACHE_SLOT_STATE_VALID_CC ) // hit in dcache 3132 3164 3133 if (( cache_state == CACHE_SLOT_STATE_VALID_NCC ) or ( cache_state == CACHE_SLOT_STATE_VALID_CC )) 3165 3134 { … … 3199 3168 { 3200 3169 // mark the cache line ac containing a PTD 3201 //MODIFIED3202 //r_dcache_contains_ptd[m_dcache_sets*way+set] = true;3203 3170 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_CONTAINS_PTD; 3204 3171 … … 3236 3203 else // PTE1 : we must update the TLB 3237 3204 { 3238 // MODIFIED3239 //r_dcache_in_tlb[m_icache_sets*way+set] = true;3240 3205 r_dcache_content_state[m_icache_sets*way+set] = LINE_CACHE_IN_TLB; 3241 3206 r_dcache_tlb_pte_flags = entry; 3242 //r_dcache_tlb_cache_way = way;3243 //r_dcache_tlb_cache_set = set;3244 //r_dcache_tlb_cache_word = word;3245 3207 r_dcache_fsm = DCACHE_TLB_PTE1_SELECT; 3246 3208 … … 3479 3441 m_cpt_dcache_dir_read++; 3480 3442 #endif 3481 /*ODCCP*/3482 // assert((cache_state != CACHE_SLOT_STATE_VALID_NCC) and "DCACHE_TLB_PTE2_GET : IMPOSSIBLE NCC HERE");3483 // if (cache_state == CACHE_SLOT_STATE_VALID_CC) // hit in dcache3484 3443 if ((cache_state == CACHE_SLOT_STATE_VALID_CC) or (cache_state == CACHE_SLOT_STATE_VALID_NCC)) 3485 3444 { … … 3514 3473 else // mapped : we must update the TLB 3515 3474 { 3516 // MODIFIED3517 //r_dcache_in_tlb[m_dcache_sets*way+set] = true;3518 3475 r_dcache_content_state[m_dcache_sets*way+set] = LINE_CACHE_IN_TLB; 3519 3476 r_dcache_tlb_pte_flags = pte_flags; 3520 3477 r_dcache_tlb_pte_ppn = pte_ppn; 3521 //r_dcache_tlb_cache_way = way;3522 //r_dcache_tlb_cache_set = set;3523 //r_dcache_tlb_cache_word = word;3524 3478 r_dcache_fsm = DCACHE_TLB_PTE2_SELECT; 3525 3479 … … 4002 3956 &tag, 4003 3957 &state ); 4004 /*ODCCP*/4005 3958 4006 3959 if ( state == CACHE_SLOT_STATE_VALID_CC ) // inval required … … 4031 3984 r_dcache_miss_set = set; 4032 3985 r_dcache_cc_cleanup_line_ncc = true; 3986 4033 3987 if (r_dcache_content_state[m_dcache_sets*way+set] != LINE_CACHE_DATA_NOT_DIRTY)//Must send data in the cleanup 4034 //if (true)//Must send data in the cleanup4035 3988 { 4036 3989 r_dcache_xtn_flush_addr_data = (tag * m_dcache_sets + set) * m_dcache_words * 4; … … 4092 4045 } 4093 4046 } 4094 // else if ( r_dcache_clack_req.read() )4095 // {4096 // r_dcache_fsm = DCACHE_CC_CHECK;4097 // r_dcache_fsm_cc_save = r_dcache_fsm.read();4098 // break;4099 // }4100 4047 break; 4101 4048 } … … 4109 4056 size_t set = r_dcache_miss_set.read(); 4110 4057 4111 // MODIFIED4112 //r_dcache_in_tlb[m_dcache_sets*way+set] = false;4113 //r_dcache_contains_ptd[m_dcache_sets*way+set] = false;4114 4058 r_dcache_content_state[m_dcache_sets*way+set] = LINE_CACHE_DATA_DIRTY; 4115 4059 … … 4215 4159 &set, 4216 4160 &word ); 4217 /*ODCCP*/ 4218 //assert((state != CACHE_SLOT_STATE_VALID_NCC) and "NOT YET DONE"); 4161 4219 4162 if ((state == CACHE_SLOT_STATE_VALID_CC) or (state == CACHE_SLOT_STATE_VALID_NCC)) // inval to be done 4220 4163 { … … 4266 4209 m_cpt_dcache_dir_write++; 4267 4210 #endif 4268 // MODIFIER POUR DIRTY BIT // 4211 4269 4212 if ((state == CACHE_SLOT_STATE_VALID_CC) or (state == CACHE_SLOT_STATE_VALID_NCC))// request cleanup 4270 4213 { … … 4284 4227 r_dcache_cc_cleanup_line_ncc = true; 4285 4228 if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY)) //must send data 4286 //if (true) //must send data4287 4229 { 4288 4230 r_dcache_cc_cleanup_updt_data = true; … … 4305 4247 } 4306 4248 } 4307 /*ODCCP*/4308 4249 4309 4250 // possible itlb & dtlb invalidate 4310 // MODIFIED4311 //if ( r_dcache_in_tlb[way*m_dcache_sets+set] )4312 //{4313 4251 if ( r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_IN_TLB ) 4314 4252 { … … 4317 4255 r_dcache_fsm_scan_save = DCACHE_XTN_DC_INVAL_END; 4318 4256 r_dcache_fsm = DCACHE_INVAL_TLB_SCAN; 4319 // MODIFIED4320 //r_dcache_in_tlb[way*m_dcache_sets+set] = false;4321 4257 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_DIRTY; 4322 4258 } 4323 // MODIFIED4324 //else if ( r_dcache_contains_ptd[way*m_dcache_sets+set] )4325 //{4326 4259 else if ( r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_CONTAINS_PTD) 4327 4260 { 4328 4261 r_itlb.reset(); 4329 4262 r_dtlb.reset(); 4330 // MODIFIED4331 //r_dcache_contains_ptd[way*m_dcache_sets+set] = false;4332 4263 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_DIRTY; 4333 4264 r_dcache_fsm = DCACHE_IDLE; … … 4354 4285 /*ODCCP*/ 4355 4286 ////////////////////////////// 4356 case DCACHE_XTN_DC_INVAL_DATA: //A verifier4287 case DCACHE_XTN_DC_INVAL_DATA: 4357 4288 { 4358 4289 … … 4420 4351 } 4421 4352 4422 bool 4423 bool 4424 size_t 4425 size_t 4426 paddr_t 4427 int state;4428 bool 4429 bool 4353 bool found = false; 4354 bool cleanup = false; 4355 size_t way = 0; 4356 size_t set = 0; 4357 paddr_t victim = 0; 4358 int state; 4359 bool s_cleanup_updt_data = false; 4360 bool s_cleanup_line_ncc = false; 4430 4361 4431 4362 #ifdef INSTRUMENTATION … … 4449 4380 r_dcache_miss_clack = true; 4450 4381 r_dcache_fsm = DCACHE_MISS_CLEAN; 4451 if( (state == CACHE_SLOT_STATE_VALID_NCC) ) //and (r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_DATA_DIRTY) )4382 if( (state == CACHE_SLOT_STATE_VALID_NCC) ) 4452 4383 { 4453 //MODIFIER POUR DIRTY BIT //4454 4384 s_cleanup_line_ncc = true; 4455 4385 r_dcache_miss_data_addr = (victim*m_dcache_words)*4; 4456 4386 if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY))//must send data 4457 //if (true)//must send data4458 4387 { 4459 4388 s_cleanup_updt_data = true; … … 4472 4401 m_cpt_cleanup_data_not_dirty ++; 4473 4402 } 4474 4475 4403 else 4476 4404 { … … 4555 4483 } 4556 4484 } 4557 // else if ( r_dcache_clack_req.read() )4558 // {4559 // r_dcache_fsm = DCACHE_CC_CHECK;4560 // r_dcache_fsm_cc_save = r_dcache_fsm.read();4561 // break;4562 // }4563 4485 4564 4486 break; … … 4590 4512 // if selective itlb & dtlb invalidate are required 4591 4513 // the miss response is not handled before invalidate completed 4592 // MODIFIED4593 //if ( r_dcache_in_tlb[way*m_dcache_sets+set] )4594 //{4595 4514 if ( r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_IN_TLB ) 4596 4515 { 4597 //MODIFIED4598 //r_dcache_in_tlb[way*m_dcache_sets+set] = false;4599 4516 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_DIRTY; 4600 4517 if( not r_dcache_cleanup_victim_req.read() ) … … 4610 4527 r_dcache_fsm = DCACHE_INVAL_TLB_SCAN; 4611 4528 } 4612 // MODIFIED4613 //else if ( r_dcache_contains_ptd[way*m_dcache_sets+set] )4614 //{4615 4529 else if ( r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_CONTAINS_PTD ) 4616 4530 { 4617 4531 r_itlb.reset(); 4618 4532 r_dtlb.reset(); 4619 // MODIFIED4620 //r_dcache_contains_ptd[way*m_dcache_sets+set] = false;4621 4533 r_dcache_content_state[way*m_dcache_sets+set] = LINE_CACHE_DATA_DIRTY; 4622 4534 r_dcache_fsm = DCACHE_MISS_WAIT; … … 4846 4758 if (r_dcache_read_state.read()) 4847 4759 { 4848 r_dcache.write_dir( r_dcache_save_paddr.read(),4760 r_dcache.write_dir( r_dcache_save_paddr.read(), 4849 4761 r_dcache_miss_way.read(), 4850 4762 r_dcache_miss_set.read(), … … 4856 4768 else 4857 4769 { 4858 r_dcache.write_dir( r_dcache_save_paddr.read(),4770 r_dcache.write_dir( r_dcache_save_paddr.read(), 4859 4771 r_dcache_miss_way.read(), 4860 4772 r_dcache_miss_set.read(), … … 4878 4790 << " / SET = " << r_dcache_miss_set.read() << std::endl; 4879 4791 #endif 4880 // reset directory extension4881 4882 // MODIFIED4883 //r_dcache_in_tlb[way*m_dcache_sets+set] = false;4884 //r_dcache_contains_ptd[way*m_dcache_sets+set] = false;4885 4792 } 4886 4793 if (r_dcache_miss_type.read()==PTE1_MISS) r_dcache_fsm = DCACHE_TLB_PTE1_GET; … … 5157 5064 word, 5158 5065 r_dcache_vci_cas_new.read()); 5159 //std::cout << "CAS local" << std::endl; 5066 5160 5067 if ( r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_IN_TLB ) 5161 5068 { … … 5317 5224 r_dcache_cc_way = way; 5318 5225 r_dcache_cc_set = set; 5319 /*RWT / ODCCP*/ 5320 if ((state == CACHE_SLOT_STATE_VALID_CC) or (state == CACHE_SLOT_STATE_VALID_NCC)) 5321 { 5322 // need to update the cache state5226 5227 if ((state == CACHE_SLOT_STATE_VALID_CC) or (state == CACHE_SLOT_STATE_VALID_NCC)) // hit 5228 { 5229 // need to update the cache state 5323 5230 r_dcache_cc_need_write = true; 5324 5231 r_dcache_cc_cleanup_line_ncc = false; … … 5424 5331 } 5425 5332 } 5426 5333 assert (not r_dcache_cc_send_req.read() && 5427 5334 "ERROR in DCACHE_CC_INVAL: the r_dcache_cc_send_req " 5428 5335 "must not be set"); 5429 // coherence request completed 5430 r_cc_receive_dcache_req = false; 5431 // request multicast acknowledgement 5432 r_dcache_cc_send_req = true; 5433 r_dcache_cc_send_way = way; 5434 r_dcache_cc_send_nline = r_cc_receive_dcache_nline.read(); 5435 r_dcache_cc_send_type = CC_TYPE_CLEANUP; 5436 // MODIFIER POUR DIRTY BIT // 5437 if (cache_state == CACHE_SLOT_STATE_VALID_NCC and not r_cc_receive_dcache_inval_is_config.read()) 5336 // coherence request completed 5337 r_cc_receive_dcache_req = false; 5338 // request multicast acknowledgement 5339 r_dcache_cc_send_req = true; 5340 r_dcache_cc_send_way = way; 5341 r_dcache_cc_send_nline = r_cc_receive_dcache_nline.read(); 5342 r_dcache_cc_send_type = CC_TYPE_CLEANUP; 5343 5344 if (cache_state == CACHE_SLOT_STATE_VALID_NCC and not r_cc_receive_dcache_inval_is_config.read()) 5345 { 5346 r_dcache_cc_cleanup_line_ncc = true; 5347 if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY) or r_dcache_dirty_save.read() or dirty_save) //must send data 5348 { 5349 r_dcache_cc_cleanup_updt_data = true; 5350 for (size_t w = 0; w< m_dcache_words; w++) 5438 5351 { 5439 r_dcache_cc_cleanup_line_ncc = true; 5440 if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY) or r_dcache_dirty_save.read() or dirty_save) //must send data 5441 { 5442 r_dcache_cc_cleanup_updt_data = true; 5443 for (size_t w = 0; w< m_dcache_words; w++) 5444 { 5445 m_cpt_cleanup_data_dirty_word += r_dcache_dirty_word[(m_dcache_sets*way+set)*m_dcache_words + w]; 5446 } 5447 5448 r_dcache_fsm = DCACHE_CC_INVAL_DATA; 5449 } 5450 else 5451 { 5452 r_dcache.write_dir( way, 5453 set, 5454 CACHE_SLOT_STATE_ZOMBI ); 5352 m_cpt_cleanup_data_dirty_word += r_dcache_dirty_word[(m_dcache_sets*way+set)*m_dcache_words + w]; 5353 } 5354 5355 r_dcache_fsm = DCACHE_CC_INVAL_DATA; 5356 } 5357 else 5358 { 5359 r_dcache.write_dir( way, 5360 set, 5361 CACHE_SLOT_STATE_ZOMBI ); 5455 5362 5456 5457 5458 5459 5460 5461 5462 5463 5464 5363 r_dcache_cc_cleanup_updt_data = false; 5364 r_dcache_fsm = r_dcache_fsm_cc_save.read(); 5365 } 5366 } 5367 else 5368 { 5369 r_dcache_cc_cleanup_updt_data = false; 5370 r_dcache_fsm = r_dcache_fsm_cc_save.read(); 5371 } 5465 5372 5466 5373 break; … … 6220 6127 if (p_dspin_p2m.read.read()) 6221 6128 { 6222 //std::cout << "CLEANUP send on line " << r_dcache_cc_send_nline.read() << std::endl; 6129 6223 6130 if(r_dcache_cc_cleanup_updt_data.read() and (r_cc_send_last_client.read() == 0))//dcache request with data 6224 {6131 { 6225 6132 r_cc_send_fsm = CC_SEND_CLEANUP_DATA_UPDT; 6226 6133 } … … 6248 6155 if(r_cc_send_data_fifo.rok()) 6249 6156 { 6250 /*ODCCP*///std::cout<<"CLEANUP_DATA_UPDT" << std::endl;6251 6157 m_cpt_data_cleanup++; 6252 6158 cleanup_data_updt_fifo_dcache_get = true; … … 6254 6160 if (r_cc_send_cpt_word.read() == m_dcache_words-1) 6255 6161 { 6256 //std::cout << "L1 paddr CLEANUP DATA | paddr = " << std::hex << (r_dcache_cc_send_nline.read()*m_dcache_words)*4 << std::dec << std::endl;6257 /*ODCCP*/6258 //std::cout << "CLEANUP with DATA finished by " << name() << std::endl;6259 6162 r_dcache_cc_send_req = false; 6260 6163 r_dcache_cc_cleanup_updt_data = false; … … 6583 6486 vci_rsp_fifo_dcache_put, 6584 6487 vci_rsp_fifo_dcache_data); 6585 //BUG pktid 6488 6586 6489 r_vci_rsp_fifo_rpktid.update(vci_rsp_fifo_rpktid_get, 6587 6490 vci_rsp_fifo_rpktid_put, … … 6798 6701 { 6799 6702 // initialize dspin send data 6800 // DspinDhccpParam::dspin_set(dspin_send_data,6801 // 0,6802 // DspinDhccpParam::P2M_EOP);6803 6703 DspinDhccpParam::dspin_set(dspin_send_data, 6804 6704 m_cc_global_id, … … 6892 6792 case CC_SEND_CLEANUP_DATA_UPDT: 6893 6793 { 6894 /*if (r_cc_send_cpt_word.read() == m_dcache_words-1)6895 {6896 DspinDhccpParam::dspin_set(dspin_send_data,6897 1,6898 DspinDhccpParam::FROM_L1_EOP);6899 }6900 else6901 {6902 DspinDhccpParam::dspin_set(dspin_send_data,6903 0,6904 DspinDhccpParam::FROM_L1_EOP);6905 }*/6906 6794 6907 6795 DspinDhccpParam::dspin_set(dspin_send_data, … … 6910 6798 6911 6799 p_dspin_p2m.data = dspin_send_data; 6912 //std::cout << "genmoore CLEANUP DATA UPDT : dspin_send_data = " << std::hex << dspin_send_data << std::dec << std::endl;6913 6800 p_dspin_p2m.write = true; 6914 6801 p_dspin_p2m.eop = (r_cc_send_cpt_word.read() == m_dcache_words-1); … … 6919 6806 { 6920 6807 // initialize dspin send data 6921 // DspinDhccpParam::dspin_set(dspin_send_data,6922 // 1,6923 // DspinDhccpParam::P2M_EOP);6924 6808 DspinDhccpParam::dspin_set(dspin_send_data, 6925 6809 0, -
branches/RWT/modules/vci_mem_cache/caba/source/include/update_tab.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
- Property svn:mergeinfo changed
/trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h merged: 597,599,601,605
r644 r767 83 83 TGT_CMD_WRITE, 84 84 TGT_CMD_CAS, 85 TGT_CMD_ ERROR,86 TGT_CMD_ CONFIG85 TGT_CMD_CONFIG, 86 TGT_CMD_ERROR 87 87 }; 88 88 … … 96 96 TGT_RSP_MULTI_ACK_IDLE, 97 97 TGT_RSP_CLEANUP_IDLE, 98 TGT_RSP_TGT_CMD_IDLE, 98 99 TGT_RSP_CONFIG_IDLE, 99 TGT_RSP_TGT_CMD_IDLE,100 100 TGT_RSP_READ, 101 101 TGT_RSP_WRITE, … … 104 104 TGT_RSP_MULTI_ACK, 105 105 TGT_RSP_CLEANUP, 106 TGT_RSP_ CONFIG,107 TGT_RSP_ TGT_CMD106 TGT_RSP_TGT_CMD, 107 TGT_RSP_CONFIG 108 108 }; 109 109 … … 122 122 CC_SEND_XRAM_RSP_IDLE, 123 123 CC_SEND_WRITE_IDLE, 124 CC_SEND_READ_IDLE, 124 125 CC_SEND_CAS_IDLE, 125 126 CC_SEND_CONFIG_IDLE, … … 437 438 uint32_t m_cpt_write_flits_remote; // number of flits for remote WRITEs 438 439 uint32_t m_cpt_write_cost; // Number of (flits * distance) for WRITEs 440 uint32_t m_cpt_write_ncc_miss; // Number of write on ncc line 439 441 440 442 uint32_t m_cpt_ll_local; // Number of local LL transactions … … 552 554 uint32_t m_cpt_xram_rsp_fsm_heap_used; // NB cycles HEAP LOCK used 553 555 554 uint32_t m_cpt_heap_unused; // NB cycles HEAP LOCK unused 556 uint32_t m_cpt_heap_unused; // NB cycles HEAP LOCK unused 557 uint32_t m_cpt_heap_slot_available; // NB HEAP slot available refresh at each cycles 558 uint32_t m_cpt_heap_min_slot_available; // NB HEAP : Min of slot available 555 559 556 560 //RWT … … 584 588 sc_in<bool> p_clk; 585 589 sc_in<bool> p_resetn; 586 sc_ in<bool>p_irq;590 sc_out<bool> p_irq; 587 591 soclib::caba::VciTarget<vci_param_int> p_vci_tgt; 588 592 soclib::caba::VciInitiator<vci_param_ext> p_vci_ixr; … … 618 622 const soclib::common::IntTab &srcid_x, // global index RAM network 619 623 const soclib::common::IntTab &tgtid_d, // global index INT network 620 const size_t cc_global_id, // global index CC network621 624 const size_t x_width, // X width in platform 622 625 const size_t y_width, // Y width in platform … … 635 638 636 639 void reset_counters(); 637 void print_stats(bool activity_counters , bool stats);640 void print_stats(bool activity_counters = true, bool stats = false); 638 641 void print_trace( size_t detailled = 0 ); 639 642 void cache_monitor(addr_t addr); … … 647 650 void check_monitor(addr_t addr, data_t data, bool read); 648 651 uint32_t req_distance(uint32_t req_srcid); 652 uint32_t min_value(uint32_t old_value, uint32_t new_value); 649 653 bool is_local_req(uint32_t req_srcid); 650 654 int read_instrumentation(uint32_t regr, uint32_t & rdata); … … 661 665 const size_t m_sets; // Number of cache sets 662 666 const size_t m_words; // Number of words in a line 663 const size_t m_cc_global_id; // global_index on cc network 664 const size_t m_xwidth; // number of x bits in platform 665 const size_t m_ywidth; // number of y bits in platform 667 size_t m_x_self; // X self coordinate 668 size_t m_y_self; // Y self coordinate 669 const size_t m_x_width; // number of x bits in platform 670 const size_t m_y_width; // number of y bits in platform 666 671 size_t m_debug_start_cycle; 667 672 bool m_debug_ok; … … 834 839 sc_signal<addr_t> r_read_to_cleanup_nline; // cache line index 835 840 sc_signal<size_t> r_read_to_cleanup_srcid; 841 sc_signal<size_t> r_read_to_cleanup_inst; 836 842 sc_signal<size_t> r_read_to_cleanup_length; 837 843 sc_signal<size_t> r_read_to_cleanup_first_word; … … 1069 1075 sc_signal<size_t> r_xram_rsp_ivt_index; // IVT entry index 1070 1076 sc_signal<size_t> r_xram_rsp_next_ptr; // Next pointer to the heap 1077 sc_signal<bool> r_xram_rsp_rerror_irq; // WRITE MISS rerror irq 1078 sc_signal<bool> r_xram_rsp_rerror_irq_enable; // WRITE MISS rerror irq enable 1079 sc_signal<addr_t> r_xram_rsp_rerror_address; // WRITE MISS rerror address 1080 sc_signal<size_t> r_xram_rsp_rerror_rsrcid; // WRITE MISS rerror srcid 1071 1081 1072 1082 // Buffer between XRAM_RSP fsm and TGT_RSP fsm (response to L1 cache) - Property svn:mergeinfo changed
-
branches/RWT/modules/vci_mem_cache/caba/source/include/xram_transaction.h
r495 r767 426 426 void write_rsp(const size_t index, 427 427 const size_t word, 428 const wide_data_t data) 428 const wide_data_t data, 429 const bool rerror) 429 430 { 430 431 data_t value; … … 442 443 assert( (tab[index].xram_read ) and 443 444 "MEMC ERROR: TRT entry is not a GET in TRT write_rsp()"); 445 446 if ( rerror ) 447 { 448 tab[index].rerror = true; 449 return; 450 } 444 451 445 452 // first 32 bits word -
branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
- Property svn:mergeinfo changed
/trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp merged: 597,599,601,603,605,617
r646 r767 56 56 #define RANDOMIZE_CAS 1 57 57 58 // RWT configuration 59 #define REVERT_CC_MECANISM 0 60 61 // Configuration 62 #define REVERT_BC_MECANISM 0 63 58 64 namespace soclib { namespace caba { 59 65 … … 64 70 "TGT_CMD_WRITE", 65 71 "TGT_CMD_CAS", 66 "TGT_CMD_ ERROR",67 "TGT_CMD_ CONFIG"72 "TGT_CMD_CONFIG", 73 "TGT_CMD_ERROR" 68 74 }; 69 75 const char *tgt_rsp_fsm_str[] = … … 75 81 "TGT_RSP_MULTI_ACK_IDLE", 76 82 "TGT_RSP_CLEANUP_IDLE", 83 "TGT_RSP_TGT_CMD_IDLE", 77 84 "TGT_RSP_CONFIG_IDLE", 78 "TGT_RSP_TGT_CMD_IDLE",79 85 "TGT_RSP_READ", 80 86 "TGT_RSP_WRITE", … … 83 89 "TGT_RSP_MULTI_ACK", 84 90 "TGT_RSP_CLEANUP", 85 "TGT_RSP_ CONFIG",86 "TGT_RSP_ TGT_CMD"91 "TGT_RSP_TGT_CMD", 92 "TGT_RSP_CONFIG" 87 93 }; 88 94 const char *cc_receive_fsm_str[] = … … 97 103 "CC_SEND_XRAM_RSP_IDLE", 98 104 "CC_SEND_WRITE_IDLE", 105 "CC_SEND_READ_IDLE", 99 106 "CC_SEND_CAS_IDLE", 100 107 "CC_SEND_CONFIG_IDLE", … … 353 360 const IntTab &srcid_x, // global index on external network 354 361 const IntTab &tgtid_d, // global index on direct network 355 const size_t cc_global_id, // global index on cc network356 362 const size_t x_width, // number of x bits in platform 357 363 const size_t y_width, // number of x bits in platform … … 378 384 p_dspin_clack( "p_dspin_clack" ), 379 385 380 m_seglist( mtp.getSegmentList(tgtid_d) ), 381 m_nseg( 0 ), 382 m_srcid_x( mtx.indexForId(srcid_x) ), 383 m_initiators( 1 << vci_param_int::S ), 384 m_heap_size( heap_size ), 385 m_ways( nways ), 386 m_sets( nsets ), 387 m_words( nwords ), 388 m_cc_global_id( cc_global_id ), 389 m_xwidth(x_width), 390 m_ywidth(y_width), 386 m_seglist(mtp.getSegmentList(tgtid_d)), 387 m_nseg(0), 388 m_srcid_x( mtx.indexForId(srcid_x)), 389 m_initiators(1 << vci_param_int::S), 390 m_heap_size(heap_size), 391 m_ways(nways), 392 m_sets(nsets), 393 m_words(nwords), 394 m_x_width(x_width), 395 m_y_width(y_width), 391 396 m_debug_start_cycle( debug_start_cycle ), 392 397 m_debug_ok( debug_ok ), … … 547 552 } 548 553 554 assert( (m_nseg > 0) and 555 "MEMC ERROR : At least one segment must be mapped to this component"); 556 549 557 m_seg = new soclib::common::Segment*[m_nseg]; 550 558 … … 555 563 i++; 556 564 } 565 566 addr_t gid = m_seg[0]->baseAddress() >> (vci_param_int::N - x_width - y_width); 567 m_x_self = (gid >> m_y_width) & ((1 << m_x_width) - 1); 568 m_y_self = gid & ((1 << m_y_width) - 1); 557 569 558 570 // Allocation for IXR_RSP FSM … … 664 676 } 665 677 678 ///////////////////////////////////////////////////// 679 tmpl(uint32_t)::min_value(uint32_t old_value, uint32_t new_value) 680 ///////////////////////////////////////////////////// 681 { 682 if (old_value < new_value) 683 return old_value; 684 else 685 return new_value; 686 } 666 687 667 688 ///////////////////////////////////////////////////// … … 670 691 { 671 692 const uint32_t srcid_width = vci_param_int::S; 672 uint8_t self_x_srcid = m_cc_global_id >> (srcid_width - m_xwidth); 673 uint8_t self_y_srcid = (m_cc_global_id >> (srcid_width - m_ywidth)) & ((1 << m_xwidth) - 1); 674 675 uint8_t x_srcid = req_srcid >> (srcid_width - m_xwidth); 676 uint8_t y_srcid = (req_srcid >> (srcid_width - m_ywidth - m_xwidth)) & ((1 << m_xwidth) - 1); 677 return abs(self_x_srcid - x_srcid) + abs(self_y_srcid - y_srcid); 693 694 uint8_t req_x = (req_srcid >> (srcid_width - m_x_width)); 695 uint8_t req_y = (req_srcid >> (srcid_width - m_x_width - m_y_width)) & ((1 << m_y_width) - 1); 696 697 return abs(m_x_self - req_x) + abs(m_y_self - req_y); 678 698 } 679 699 … … 865 885 m_cpt_ncc_to_cc_write = 0; 866 886 m_cpt_ncc_to_cc = 0; 887 m_cpt_write_ncc_miss = 0; 867 888 } 868 889 869 890 870 891 ///////////////////////////////////////// 871 tmpl(void)::print_stats(bool activity_counters = true, bool stats = true)892 tmpl(void)::print_stats(bool activity_counters, bool stats) 872 893 { 873 894 std::cout << "**********************************" << std::dec << std::endl; … … 891 912 << "[008] WRITE FLITS REMOTE = " << m_cpt_write_flits_remote << std::endl 892 913 << "[009] WRITE COST (FLITS * DIST) = " << m_cpt_write_cost << std::endl 914 << "[XXX] WRITE L1 MISS NCC = " << m_cpt_write_ncc_miss << std::endl 893 915 << std::endl 894 916 << "[010] LOCAL LL = " << m_cpt_ll_local << std::endl … … 929 951 << "[037] GET (UNIMPLEMENTED) = " << m_cpt_get << std::endl 930 952 << "[038] WRITE BROADCAST = " << m_cpt_write_broadcast << std::endl 953 << "[039] MIN HEAP SLOT AVAILABLE = " << m_cpt_heap_min_slot_available << std::endl 931 954 << std::endl 932 << "[0 39] CLEANUP DATA (FLITS) = " << m_cpt_cleanup_data * 16 << std::endl933 << "[04 0] NCC TO CC (READ) = " << m_cpt_ncc_to_cc_read << std::endl934 << "[04 1] NCC TO CC (WRITE) = " << m_cpt_ncc_to_cc_write << std::endl935 << "[04 2] NCC TO CC (TOTAL) = " << m_cpt_ncc_to_cc << std::endl955 << "[040] CLEANUP DATA (FLITS) = " << m_cpt_cleanup_data * 16 << std::endl 956 << "[041] NCC TO CC (READ) = " << m_cpt_ncc_to_cc_read << std::endl 957 << "[042] NCC TO CC (WRITE) = " << m_cpt_ncc_to_cc_write << std::endl 958 << "[043] NCC TO CC (TOTAL) = " << m_cpt_ncc_to_cc << std::endl 936 959 << std::endl; 937 960 } … … 1017 1040 delete [] m_debug_previous_data; 1018 1041 delete [] m_debug_data; 1019 1020 print_stats();1021 1042 } 1022 1043 … … 1137 1158 r_xram_rsp_to_ixr_cmd_req = false; 1138 1159 r_xram_rsp_trt_index = 0; 1160 r_xram_rsp_rerror_irq = false; 1161 r_xram_rsp_rerror_irq_enable = false; 1139 1162 1140 1163 m_xram_rsp_to_cc_send_inst_fifo.init(); … … 1175 1198 m_cpt_write_flits_local = 0; 1176 1199 m_cpt_write_flits_remote = 0; 1200 m_cpt_write_ncc_miss = 0; 1177 1201 m_cpt_write_cost = 0; 1178 1202 m_cpt_ll_local = 0; … … 1253 1277 m_cpt_ncc_to_cc_write = 0; 1254 1278 m_cpt_ncc_to_cc = 0; 1279 1280 m_cpt_heap_min_slot_available = m_heap_size; 1281 m_cpt_heap_slot_available = m_heap_size; 1282 1255 1283 return; 1256 1284 } … … 1360 1388 #endif 1361 1389 // checking segmentation violation 1362 addr_t address = p_vci_tgt.address.read(); 1363 uint32_t plen = p_vci_tgt.plen.read(); 1364 bool found = false; 1365 bool config = false; 1366 1367 for (size_t seg_id = 0; (seg_id < m_nseg) && !found; seg_id++) 1390 addr_t address = p_vci_tgt.address.read(); 1391 uint32_t plen = p_vci_tgt.plen.read(); 1392 bool config = false; 1393 1394 for (size_t seg_id = 0; (seg_id < m_nseg) ; seg_id++) 1368 1395 { 1369 1396 if (m_seg[seg_id]->contains(address) && 1370 1397 m_seg[seg_id]->contains(address + plen - vci_param_int::B) ) 1371 1398 { 1372 found = true;1373 1399 if ( m_seg[seg_id]->special() ) config = true; 1374 1400 } 1375 1401 } 1376 1402 1377 if (!found) /////////// out of segment error 1378 { 1379 r_tgt_cmd_fsm = TGT_CMD_ERROR; 1380 } 1381 else if ( config ) /////////// configuration command 1403 if (config) /////////// configuration command 1382 1404 { 1383 1405 if (!p_vci_tgt.eop.read()) r_tgt_cmd_fsm = TGT_CMD_ERROR; 1384 else 1406 else r_tgt_cmd_fsm = TGT_CMD_CONFIG; 1385 1407 } 1386 1408 else //////////// memory access … … 1404 1426 // ==> TYPE_WRITE = X100 with the TSAR encoding 1405 1427 // ==> mask = 0b0111 = 0x7 1406 assert((( p_vci_tgt.pktid.read() & 0x7) == 0x4 or (p_vci_tgt.pktid.read() == 0x0)) and1428 assert((((p_vci_tgt.pktid.read() & 0x7) == 0x4) or ((p_vci_tgt.pktid.read() & 0x7) == 0x0)) and 1407 1429 "The type specified in the pktid field is incompatible with the WRITE CMD"); 1408 1430 r_tgt_cmd_fsm = TGT_CMD_WRITE; … … 1620 1642 } 1621 1643 1644 // xram GET bus error registers 1645 case MEMC_RERROR: 1646 { 1647 need_rsp = true; 1648 error = 0; 1649 1650 if (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) 1651 { 1652 switch (regr) 1653 { 1654 case MEMC_RERROR_IRQ_ENABLE: 1655 r_xram_rsp_rerror_irq_enable = 1656 (p_vci_tgt.wdata.read() != 0); 1657 1658 break; 1659 1660 default: 1661 error = 1; 1662 break; 1663 } 1664 } 1665 else if (p_vci_tgt.cmd.read() == vci_param_int::CMD_READ) 1666 { 1667 switch (regr) 1668 { 1669 case MEMC_RERROR_SRCID: 1670 rdata = (uint32_t) 1671 r_xram_rsp_rerror_rsrcid.read(); 1672 1673 break; 1674 1675 case MEMC_RERROR_ADDR_LO: 1676 rdata = (uint32_t) 1677 (r_xram_rsp_rerror_address.read()) & 1678 ((1ULL<<32)-1); 1679 1680 break; 1681 1682 case MEMC_RERROR_ADDR_HI: 1683 rdata = (uint32_t) 1684 (r_xram_rsp_rerror_address.read() >> 32) & 1685 ((1ULL<<32)-1); 1686 1687 break; 1688 1689 case MEMC_RERROR_IRQ_RESET: 1690 if (not r_xram_rsp_rerror_irq.read()) break; 1691 1692 r_xram_rsp_rerror_irq = false; 1693 1694 break; 1695 1696 case MEMC_RERROR_IRQ_ENABLE: 1697 rdata = (uint32_t) 1698 (r_xram_rsp_rerror_irq_enable.read()) ? 1 : 0; 1699 1700 break; 1701 1702 default: 1703 error = 1; 1704 break; 1705 } 1706 } 1707 else 1708 { 1709 error = 1; 1710 } 1711 1712 break; 1713 } 1714 1622 1715 //unknown function 1623 1716 default: … … 2100 2193 // is signaled by the CLEANUP FSM by decrementing the r_config_rsp_lines counter. 2101 2194 // The CONFIG INVAL response is sent only when the last line has been invalidated. 2195 // There is no PUT transaction to XRAM, even if the invalidated line is dirty... 2102 2196 // TODO : The target buffer address must be aligned on a cache line boundary. 2103 2197 // This constraint can be released, but it requires to make 2 PUT transactions … … 2559 2653 r_config_heap_next = entry.next; 2560 2654 if ( last_copy ) r_config_fsm = CONFIG_HEAP_LAST; 2655 2656 // <Activity counters> 2657 m_cpt_heap_slot_available++; 2658 // </Activity counters> 2561 2659 } 2562 2660 … … 2684 2782 { 2685 2783 r_read_ll_key = m_llsc_table.ll(m_cmd_read_addr_fifo.read()); 2686 /**//*std::cout << "MEMCACHE : from proc " << m_cmd_read_srcid_fifo.read()2687 << " | @ " << std::hex << m_cmd_read_addr_fifo.read()2688 << " | LL" << std::endl;*/2689 2784 r_read_ll_done = true; 2690 2785 } … … 2708 2803 { 2709 2804 r_read_coherent = entry.cache_coherent; 2710 if (entry.cache_coherent or (entry.count == 0))// or (entry.owner.srcid == m_cmd_read_srcid_fifo.read())) //hit on a WT line or the owner has no more copy (if LL, the owner must be invalidated even if he made the request) 2805 2806 // hit on a WT line or the owner has no more copy (if LL, the owner must be invalidated even if he made the request) 2807 if (entry.cache_coherent or (entry.count == 0))// or (entry.owner.srcid == m_cmd_read_srcid_fifo.read())) 2711 2808 { 2712 2809 // test if we need to register a new copy in the heap … … 2717 2814 else 2718 2815 { 2719 //std::cout << "is LL = " << ((m_cmd_read_pktid_fifo.read() & 0x7) == TYPE_LL) << std::endl;2720 //std::cout << "coherent = " << entry.cache_coherent << " | count = " << std::dec << entry.count << " | cached = " << cached_read << std::endl;2721 2816 r_read_fsm = READ_HEAP_REQ; 2722 2817 } … … 2755 2850 size_t index; 2756 2851 addr_t nline = m_nline[(addr_t)(m_cmd_read_addr_fifo.read())]; 2757 /*std::cout << "nline = " << std::dec << nline << std::endl2758 << "inval en cours sur la ligne = " << m_upt.search_inval(nline, index) << std::endl2759 << "UPT full = " << m_upt.is_full() << std::endl2760 << "CC_SEND req = " << r_read_to_cc_send_req.read() << std::endl2761 << "CLENAUP req = " <<r_read_to_cleanup_req.read() << std::endl;*/2762 2852 if(m_ivt.search_inval(nline, index) or m_ivt.is_full() or r_read_to_cc_send_req.read() or r_read_to_cleanup_req.read()) //Check pending inval 2763 2853 { … … 2782 2872 r_read_to_cleanup_nline = nline; 2783 2873 r_read_to_cleanup_srcid = m_cmd_read_srcid_fifo.read(); 2874 r_read_to_cleanup_inst = ((m_cmd_read_pktid_fifo.read() & 0x2) != 0); 2784 2875 r_read_to_cleanup_length = m_cmd_read_length_fifo.read(); 2785 2876 r_read_to_cleanup_first_word = m_x[(addr_t) m_cmd_read_addr_fifo.read()]; … … 2788 2879 r_read_to_cleanup_is_ll= ((m_cmd_read_pktid_fifo.read() & 0x7) == TYPE_LL); 2789 2880 r_read_to_cleanup_ll_key = r_read_ll_key.read(); 2790 //std::cout << "cleanup req (read) on line " << nline << " /on proc " << r_read_copy.read() << std::endl;2791 2881 2792 2882 m_ivt.set(false, // it's an inval transaction … … 2807 2897 { 2808 2898 std::cout 2809 << " <MEMC " << name() << " READ_IVT_LOCK>" 2899 << " <MEMC " << name() << " READ_IVT_LOCK>" 2900 << std::hex 2810 2901 << " Inval req on an NCC line" 2902 << " | owner = " << r_read_copy.read() 2903 << " | nline = " << nline 2904 << std::dec 2811 2905 << std::endl; 2812 2906 } … … 2861 2955 DirectoryEntry entry; 2862 2956 entry.valid = true; 2863 entry.cache_coherent = r_read_coherent.read() or inst_read or (!(cached_read)) or (r_read_copy.read() != m_cmd_read_srcid_fifo.read()); 2864 r_read_coherent = r_read_coherent.read() or inst_read or (!(cached_read)) or (r_read_copy.read() != m_cmd_read_srcid_fifo.read()); 2957 //entry.cache_coherent = r_read_coherent.read() or inst_read or (!(cached_read)) or (r_read_copy.read() != m_cmd_read_srcid_fifo.read()); 2958 //r_read_coherent = r_read_coherent.read() or inst_read or (!(cached_read)) or (r_read_copy.read() != m_cmd_read_srcid_fifo.read()); 2959 2960 entry.cache_coherent = r_read_coherent.read() or inst_read or (!(cached_read)); 2961 r_read_coherent = r_read_coherent.read() or inst_read or (!(cached_read)); 2962 2865 2963 entry.is_cnt = is_cnt; 2866 2964 entry.dirty = r_read_dirty.read(); … … 2984 3082 else // switching to counter mode 2985 3083 { 2986 if(r_read_count.read() > 1) // heap must be cleared3084 if(r_read_count.read() > 1) // heap must be cleared 2987 3085 { 2988 3086 HeapEntry next_entry = m_heap.read(r_read_ptr.read()); … … 3043 3141 m_heap.write_free_entry(heap_entry); 3044 3142 m_heap.write_free_ptr(r_read_next_ptr.read()); 3045 if(r_read_last_free.read()) m_heap.set_full(); 3143 3144 if(r_read_last_free.read()) { 3145 m_heap.set_full(); 3146 } 3147 3148 // <Activity counters> 3149 m_cpt_heap_slot_available--; 3150 // </Activity counters> 3046 3151 3047 3152 r_read_fsm = READ_RSP; … … 3107 3212 m_heap.write(r_read_ptr.read(),last_entry); 3108 3213 r_read_fsm = READ_RSP; 3214 3215 // <Activity counters> 3216 m_cpt_heap_slot_available = m_cpt_heap_slot_available + (r_read_count.read() - 1); 3217 // </Activity counters> 3109 3218 } 3110 3219 else … … 3125 3234 r_read_to_tgt_rsp_length = m_cmd_read_length_fifo.read(); 3126 3235 r_read_to_tgt_rsp_srcid = m_cmd_read_srcid_fifo.read(); 3127 /*RWT*/ 3128 //BUG pktid 3236 3129 3237 if (r_read_coherent.read()) 3130 3238 { 3131 3239 r_read_to_tgt_rsp_pktid = 0x0 + m_cmd_read_pktid_fifo.read(); 3132 //std::cout << "READ RSP COHERENT on word" << std::hex << m_x[(addr_t) m_cmd_read_addr_fifo.read()] << std::dec << std::endl;3133 3240 } 3134 3241 else … … 3442 3549 r_write_coherent = entry.cache_coherent; 3443 3550 3551 if((entry.cache_coherent == false) and (entry.count != 0)) 3552 { 3553 m_cpt_write_ncc_miss++; 3554 } 3555 3444 3556 if (entry.cache_coherent or (entry.owner.srcid == r_write_srcid.read()) or (entry.count == 0)) // hit WT 3445 3557 { … … 3462 3574 { 3463 3575 r_write_fsm = WRITE_IVT_LOCK_HIT_WB; 3464 // if(r_write_pktid.read() == TYPE_SC)3465 // {3466 // r_write_sc_fail = true;3467 // }3468 3576 } 3469 3577 } … … 3500 3608 addr_t nline = m_nline[(addr_t)(r_write_address.read())]; 3501 3609 3502 //std::cout << "WRITE on NCC on line" << std::hex << nline << std::dec << std::endl;3503 3610 //if there is a matched updt req, we should wait until it is over. Because 3504 3611 //we need the lastest updt data. … … 3508 3615 3509 3616 if( not match_inval and 3617 not m_ivt.is_full() and 3510 3618 not r_write_to_cc_send_req.read() and 3511 3619 not r_write_to_cc_send_multi_req.read() and … … 3533 3641 if(m_debug) 3534 3642 { 3535 std::cout << " <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> get access to the UPT: "3643 std::cout << " <MEMC " << name() << " WRITE_IVT_LOCK_HIT_WB> get access to the IVT: " 3536 3644 << " Inval requested = " << (not match_inval and not r_write_to_cc_send_req.read()) 3537 3645 << std::endl; … … 4808 4916 r_ixr_rsp_trt_index = p_vci_ixr.rtrdid.read(); 4809 4917 4810 assert( ((p_vci_ixr.rerror.read() & 0x1) == 0) and 4811 "MEMC ERROR in IXR_RSP state: XRAM response error !"); 4812 4813 if(p_vci_ixr.reop.read()) // PUT 4918 if (p_vci_ixr.reop.read() and not 4919 p_vci_ixr.rerror.read()) // PUT 4814 4920 { 4815 4921 r_ixr_rsp_fsm = IXR_RSP_TRT_ERASE; … … 4836 4942 } 4837 4943 4838 ////////////////////////4839 case IXR_RSP_TRT_ERASE: 4840 // decrease the line counter if config request4944 /////////////////////// 4945 case IXR_RSP_TRT_ERASE: // erase the entry in the TRT 4946 // decrease the line counter if config request 4841 4947 { 4842 4948 if(r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP) … … 4846 4952 { 4847 4953 config_rsp_lines_ixr_rsp_decr = true; 4848 m_trt.erase(index); 4849 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4850 } 4851 else // not a config transaction 4852 { 4853 m_trt.erase(index); 4854 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4855 } 4954 } 4955 m_trt.erase(index); 4956 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4856 4957 4857 4958 #if DEBUG_MEMC_IXR_RSP … … 4872 4973 bool eop = p_vci_ixr.reop.read(); 4873 4974 wide_data_t data = p_vci_ixr.rdata.read(); 4874 bool error= ((p_vci_ixr.rerror.read() & 0x1) == 1);4875 4876 assert(((eop == (word == (m_words-2))) or error) and4975 bool rerror = ((p_vci_ixr.rerror.read() & 0x1) == 1); 4976 4977 assert(((eop == (word == (m_words-2))) or rerror) and 4877 4978 "MEMC ERROR in IXR_RSP_TRT_READ state : invalid response from XRAM"); 4878 4979 4879 m_trt.write_rsp( index, 4880 word, 4881 data ); 4980 m_trt.write_rsp( index, word, data, rerror ); 4882 4981 4883 4982 r_ixr_rsp_cpt = word + 2; … … 5009 5108 r_xram_rsp_victim_is_cnt = victim.is_cnt; 5010 5109 r_xram_rsp_victim_inval = inval ; 5011 r_xram_rsp_victim_dirty = victim.dirty or (!victim.cache_coherent && (victim.count == 1)); //a NCC line is by default considered as dirty in the L1: we must take a reservation on a TRT entry 5012 5013 if( not r_xram_rsp_trt_buf.rerror ) r_xram_rsp_fsm = XRAM_RSP_IVT_LOCK; 5014 else r_xram_rsp_fsm = XRAM_RSP_ERROR_ERASE; 5110 // a NCC line is by default considered as dirty in the L1: we must take a reservation on a TRT entry 5111 r_xram_rsp_victim_dirty = victim.dirty or (!victim.cache_coherent && (victim.count == 1)); 5112 5113 5114 // A line that undergoes a change in its state (ncc to cc), should not be evicted from the memory cache. 5115 if((victim.tag * m_sets + set) == r_read_to_cleanup_nline.read() and r_read_to_cleanup_req.read()) 5116 { 5117 r_xram_rsp_fsm = XRAM_RSP_INVAL_WAIT; 5118 5119 #if DEBUG_MEMC_XRAM_RSP 5120 if(m_debug) 5121 std::cout << " <MEMC " << name() << " XRAM_RSP_TRT_COPY>" 5122 << " Victim line is in ncc to cc mecanism" 5123 << " / nline = " << std::hex << (victim.tag * m_sets + set) 5124 << std::endl; 5125 #endif 5126 } 5127 else if( not r_xram_rsp_trt_buf.rerror ) 5128 { 5129 r_xram_rsp_fsm = XRAM_RSP_IVT_LOCK; 5130 } 5131 else 5132 { 5133 r_xram_rsp_fsm = XRAM_RSP_ERROR_ERASE; 5134 } 5015 5135 5016 5136 #if DEBUG_MEMC_XRAM_RSP … … 5195 5315 #endif 5196 5316 5197 // If the victim is not dirty (RWT: if it is not coherent, we can not know wether it is dirty or not), we don't need another XRAM put transaction, 5198 // and we can erase the TRT entry 5317 // If the victim is not dirty (RWT: if it is not coherent, 5318 // we can not know wether it is dirty or not), we don't 5319 // need another XRAM put transaction, and we can erase the 5320 // TRT entry 5199 5321 if(!r_xram_rsp_victim_dirty.read() and (r_xram_rsp_victim_coherent.read() or (r_xram_rsp_victim_count.read() == 0))) m_trt.erase(r_xram_rsp_trt_index.read()); 5200 5322 5201 5323 // Next state 5202 if(r_xram_rsp_victim_dirty.read() or (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1))) 5324 if(r_xram_rsp_victim_dirty.read() or (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1))) r_xram_rsp_fsm = XRAM_RSP_TRT_DIRTY; 5203 5325 else if(r_xram_rsp_trt_buf.proc_read) r_xram_rsp_fsm = XRAM_RSP_DIR_RSP; 5204 5326 else if(r_xram_rsp_victim_inval.read()) r_xram_rsp_fsm = XRAM_RSP_INVAL; … … 5235 5357 #endif 5236 5358 5237 // if( not r_xram_rsp_victim_coherent )5238 // std::cout << "a victim coherent not sent trt index =" << r_xram_rsp_trt_index.read() << std::endl;5239 5359 if(r_xram_rsp_trt_buf.proc_read) r_xram_rsp_fsm = XRAM_RSP_DIR_RSP; 5240 5360 else if(r_xram_rsp_victim_inval.read()) r_xram_rsp_fsm = XRAM_RSP_INVAL; … … 5311 5431 else r_xram_rsp_fsm = XRAM_RSP_IDLE; 5312 5432 5313 // std::cout << "cleanup sent for trt index =" << r_xram_rsp_trt_index.read() << std::endl;5314 5433 #if DEBUG_MEMC_XRAM_RSP 5315 5434 if(m_debug) … … 5373 5492 HeapEntry entry = m_heap.read(r_xram_rsp_next_ptr.read()); 5374 5493 5375 xram_rsp_to_cc_send_fifo_srcid 5494 xram_rsp_to_cc_send_fifo_srcid = entry.owner.srcid; 5376 5495 xram_rsp_to_cc_send_fifo_inst = entry.owner.inst; 5377 5496 xram_rsp_to_cc_send_fifo_put = true; … … 5387 5506 { 5388 5507 r_xram_rsp_fsm = XRAM_RSP_HEAP_ERASE; 5508 5389 5509 } 5390 5510 } … … 5431 5551 m_heap.write(r_xram_rsp_next_ptr.read(),last_entry); 5432 5552 5553 // <Activity counters> 5554 m_cpt_heap_slot_available = m_cpt_heap_slot_available + (r_xram_rsp_victim_count.read() - 1); 5555 // </Activity counters> 5556 5433 5557 r_xram_rsp_fsm = XRAM_RSP_IDLE; 5434 5558 … … 5446 5570 5447 5571 // Next state 5448 if(r_xram_rsp_trt_buf.proc_read) r_xram_rsp_fsm = XRAM_RSP_ERROR_RSP; 5449 else r_xram_rsp_fsm = XRAM_RSP_IDLE; 5572 if (r_xram_rsp_trt_buf.proc_read) 5573 { 5574 r_xram_rsp_fsm = XRAM_RSP_ERROR_RSP; 5575 } 5576 else 5577 { 5578 // Trigger an interruption to signal a bus error from 5579 // the XRAM because a processor WRITE MISS (XRAM GET 5580 // transaction and not processor read). 5581 // 5582 // To avoid deadlocks we do not wait an error to be 5583 // acknowledged before signaling another one. 5584 // Therefore, when there is an active error, and other 5585 // errors arrive, these are not considered 5586 5587 if (!r_xram_rsp_rerror_irq.read() && r_xram_rsp_rerror_irq_enable.read() 5588 && r_xram_rsp_trt_buf.xram_read ) 5589 { 5590 r_xram_rsp_rerror_irq = true; 5591 r_xram_rsp_rerror_address = r_xram_rsp_trt_buf.nline * m_words * 4; 5592 r_xram_rsp_rerror_rsrcid = r_xram_rsp_trt_buf.srcid; 5450 5593 5451 5594 #if DEBUG_MEMC_XRAM_RSP 5452 if(m_debug) 5595 if (m_debug) 5596 std::cout 5597 << " <MEMC " << name() << " XRAM_RSP_ERROR_ERASE>" 5598 << " Triggering interrupt to signal WRITE MISS bus error" 5599 << " / irq_enable = " << r_xram_rsp_rerror_irq_enable.read() 5600 << " / nline = " << r_xram_rsp_trt_buf.nline 5601 << " / rsrcid = " << r_xram_rsp_trt_buf.srcid 5602 << std::endl; 5603 #endif 5604 } 5605 5606 r_xram_rsp_fsm = XRAM_RSP_IDLE; 5607 } 5608 5609 #if DEBUG_MEMC_XRAM_RSP 5610 if (m_debug) 5453 5611 std::cout << " <MEMC " << name() << " XRAM_RSP_ERROR_ERASE>" 5454 5612 << " Error reported by XRAM / erase the TRT entry" << std::endl; … … 5572 5730 DspinDhccpParam::dspin_get(flit, DspinDhccpParam::CLEANUP_NLINE_LSB); 5573 5731 5574 //A MODIFIER POUR DIRTY //5575 5732 bool eop = 5576 5733 DspinDhccpParam::dspin_get(flit, DspinDhccpParam::P2M_EOP) == 0x1; 5734 5577 5735 if (! eop) 5578 5736 { … … 5643 5801 5644 5802 r_cleanup_fsm = CLEANUP_DIR_LOCK; 5645 //std::cout << " MEM_CACHE : CLEANUP_DIR_REQ" << std::endl;5646 5803 5647 5804 #if DEBUG_MEMC_CLEANUP … … 5668 5825 exit(0); 5669 5826 } 5670 //std::cout << " MEM_CACHE : CLEANUP_DIR_LOCK" << std::endl;5671 5827 5672 5828 // Read the directory … … 5709 5865 } 5710 5866 } 5711 else // miss : check UPT for a pending invalidation transaction5867 else // miss : check IVT for a pending invalidation transaction 5712 5868 { 5713 5869 r_cleanup_fsm = CLEANUP_IVT_LOCK; … … 5769 5925 /*RWT*/ 5770 5926 bool inval_request = (r_read_to_cleanup_req.read() and (r_cleanup_nline.read() == r_read_to_cleanup_nline.read())) // NCC to CC initiated by a read transaction 5771 or (r_write_to_cleanup_req.read() and (r_cleanup_nline.read() == r_write_to_cleanup_nline.read())); //NCC to CC initiated by a wrtie transaction5927 or (r_write_to_cleanup_req.read() and (r_cleanup_nline.read() == r_write_to_cleanup_nline.read())); // NCC to CC initiated by a write transaction 5772 5928 5773 5929 … … 5794 5950 if (r_read_to_cleanup_cached_read.read()) 5795 5951 { 5796 entry.count 5797 entry.owner.srcid 5798 entry.owner.inst = 0;5952 entry.count = r_cleanup_count.read(); 5953 entry.owner.srcid = r_read_to_cleanup_srcid.read(); 5954 entry.owner.inst = r_read_to_cleanup_inst.read(); 5799 5955 } 5800 5956 else 5801 5957 { 5802 entry.count 5803 entry.owner.srcid 5804 entry.owner.inst 5958 entry.count = r_cleanup_count.read() - 1; 5959 entry.owner.srcid = r_cleanup_copy.read(); 5960 entry.owner.inst = r_cleanup_copy_inst.read(); 5805 5961 } 5806 5962 if (r_read_to_cleanup_is_ll.read()) … … 5811 5967 else 5812 5968 { 5813 entry.count = r_cleanup_count.read() - 1; 5814 entry.owner.srcid = 0; 5815 entry.owner.inst = 0; 5969 entry.count = r_cleanup_count.read() - 1; 5970 entry.owner.srcid = 0; 5971 entry.owner.inst = 0; 5972 5973 #if REVERT_CC_MECANISM 5974 // Revert CC to NCC if : 5975 // - no more copy in L1 caches 5976 // - this line is not in counter mode (broadcast) 5977 // - this line is not in NCC to CC mecanism 5978 if (((r_cleanup_count.read() - 1) == 0) and (r_cleanup_is_cnt == false) and (inval_request == false)) 5979 { 5980 entry.cache_coherent = false; 5981 } 5982 #endif 5983 5984 #if REVERT_BC_MECANISM 5985 if ((r_cleanup_count.read() - 1) == 0) 5986 { 5987 entry.is_cnt = false; 5988 } 5989 #endif 5990 5816 5991 } 5817 5992 … … 5852 6027 << " / is_cnt = " << entry.is_cnt 5853 6028 << " / match_inval = " << inval_request 6029 << " / is_coherent = " << entry.cache_coherent 6030 << std::dec 5854 6031 << std::endl; 5855 6032 } … … 5861 6038 case CLEANUP_IVT_LOCK_DATA://RWT 5862 6039 { 5863 //Search for a matching inval in the UPT (there must be one) and check if there is a pending read.6040 //Search for a matching inval in the IVT (there must be one) and check if there is a pending read. 5864 6041 if(r_alloc_ivt_fsm.read() == ALLOC_IVT_CLEANUP) 5865 6042 { … … 5877 6054 r_cleanup_fsm = CLEANUP_IVT_CLEAR_DATA; 5878 6055 } 5879 #if DEBUG_M C_CLEANUP6056 #if DEBUG_MEMC_CLEANUP 5880 6057 if (m_debug) 5881 6058 { … … 5902 6079 r_cleanup_fsm = CLEANUP_SEND_CLACK; 5903 6080 } 5904 #if DEBUG_M C_CLEANUP6081 #if DEBUG_MEMC_CLEANUP 5905 6082 if (m_debug) 5906 6083 { 5907 6084 std::cout 5908 6085 << " <MEMC " << name() 5909 << " CLEANUP_IVT_CLEAR_DATA> clear UPT entry"6086 << " CLEANUP_IVT_CLEAR_DATA> clear IVT entry" 5910 6087 << std::endl; 5911 6088 } … … 5922 6099 r_cleanup_to_tgt_rsp_srcid = r_cleanup_read_srcid.read(); 5923 6100 r_cleanup_to_tgt_rsp_trdid = r_cleanup_read_trdid.read(); 5924 r_cleanup_to_tgt_rsp_pktid = 0x0 + r_cleanup_read_pktid.read();// WT6101 r_cleanup_to_tgt_rsp_pktid = 0x0 + r_cleanup_read_pktid.read();//RWT 5925 6102 r_cleanup_to_tgt_rsp_type = 0; //Read instruction 5926 6103 r_cleanup_to_tgt_rsp_length = r_read_to_cleanup_length.read(); … … 5945 6122 r_cleanup_fsm = CLEANUP_SEND_CLACK; 5946 6123 5947 #if DEBUG_M C_CLEANUP6124 #if DEBUG_MEMC_CLEANUP 5948 6125 if (m_debug) 5949 6126 { … … 6197 6374 m_heap.write_free_ptr(r_cleanup_next_ptr.read()); 6198 6375 m_heap.unset_full(); 6376 6377 // <Activity counters> 6378 m_cpt_heap_slot_available++; 6379 // </Activity counters> 6199 6380 6200 6381 r_cleanup_fsm = CLEANUP_SEND_CLACK; … … 6322 6503 if(r_cleanup_to_tgt_rsp_req.read()) break; 6323 6504 6505 assert ( (r_cleanup_ncc.read() == false) and 6506 "CLEANUP_WRITE_RSP : Cleanup on NCC line invalid in " 6507 "MEM_CACHE with write_rsp needed. STRANGE BEHAVIOUR"); 6324 6508 // no pending request 6325 6509 r_cleanup_to_tgt_rsp_req = true; … … 6385 6569 data_vector); 6386 6570 } 6387 //std::cout << "cleanup with a non coherent ligne in trt index = " << index << std::endl;6388 6571 r_cleanup_to_ixr_cmd_srcid = r_cleanup_srcid.read(); 6389 6572 r_cleanup_to_ixr_cmd_index = index; … … 7242 7425 // 7243 7426 // It implements a round-robin priority between the four possible client FSMs 7244 // XRAM_RSP > CAS > WRITE > CONFIG7427 // XRAM_RSP > CAS > READ > WRITE > CONFIG 7245 7428 // 7246 7429 // Each FSM can request the next services: … … 7369 7552 break; 7370 7553 } 7371 // WRITE7554 // READ 7372 7555 if(r_read_to_cc_send_req.read()) 7373 7556 { … … 7375 7558 break; 7376 7559 } 7377 7560 // WRITE 7378 7561 if(r_write_to_cc_send_req.read()) 7379 7562 { … … 7395 7578 } 7396 7579 /////////////////////////// 7397 case CC_SEND_XRAM_RSP_IDLE: // CAS FSM has highest priority 7398 { 7580 case CC_SEND_READ_IDLE: 7581 { 7582 // WRITE 7583 if(r_write_to_cc_send_req.read()) 7584 { 7585 r_cc_send_fsm = CC_SEND_WRITE_NCC_INVAL_HEADER; 7586 break; 7587 } 7588 if(m_write_to_cc_send_inst_fifo.rok() or 7589 r_write_to_cc_send_multi_req.read()) 7590 { 7591 r_cc_send_fsm = CC_SEND_WRITE_UPDT_HEADER; 7592 break; 7593 } 7594 if(r_write_to_cc_send_brdcast_req.read()) 7595 { 7596 r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_HEADER; 7597 break; 7598 } 7599 // CONFIG 7600 if(r_config_to_cc_send_multi_req.read()) 7601 { 7602 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER; 7603 break; 7604 } 7605 if(r_config_to_cc_send_brdcast_req.read()) 7606 { 7607 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER; 7608 break; 7609 } 7610 // XRAM_RSP 7611 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or 7612 r_xram_rsp_to_cc_send_multi_req.read()) 7613 { 7614 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_HEADER; 7615 break; 7616 } 7617 if(r_xram_rsp_to_cc_send_brdcast_req.read()) 7618 { 7619 r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_HEADER; 7620 break; 7621 } 7399 7622 // CAS 7400 7623 if(m_cas_to_cc_send_inst_fifo.rok() or … … 7409 7632 break; 7410 7633 } 7411 7634 // READ 7412 7635 if(r_read_to_cc_send_req.read()) 7413 7636 { … … 7415 7638 break; 7416 7639 } 7417 7418 if(r_write_to_cc_send_req.read()) 7419 { 7420 r_cc_send_fsm = CC_SEND_WRITE_NCC_INVAL_HEADER; 7640 break; 7641 7642 } 7643 /////////////////////////// 7644 case CC_SEND_XRAM_RSP_IDLE: // CAS FSM has highest priority 7645 { 7646 // CAS 7647 if(m_cas_to_cc_send_inst_fifo.rok() or 7648 r_cas_to_cc_send_multi_req.read()) 7649 { 7650 r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER; 7421 7651 break; 7422 7652 } 7423 7424 7425 // WRITE 7653 if(r_cas_to_cc_send_brdcast_req.read()) 7654 { 7655 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER; 7656 break; 7657 } 7658 7659 // READ 7426 7660 if(r_read_to_cc_send_req.read()) 7427 7661 { … … 7430 7664 } 7431 7665 7666 // WRITE 7432 7667 if(r_write_to_cc_send_req.read()) 7433 7668 { … … 7473 7708 } 7474 7709 ////////////////////// 7475 case CC_SEND_CAS_IDLE: // CLEANUP FSM has highest priority 7476 { 7477 7710 case CC_SEND_CAS_IDLE: // READ FSM has highest priority 7711 { 7712 7713 // READ 7478 7714 if(r_read_to_cc_send_req.read()) 7479 7715 { … … 7481 7717 break; 7482 7718 } 7483 7719 // WRITE 7484 7720 if(r_write_to_cc_send_req.read()) 7485 7721 { … … 7488 7724 } 7489 7725 7490 7491 7726 if(m_write_to_cc_send_inst_fifo.rok() or 7492 7727 r_write_to_cc_send_multi_req.read()) … … 7511 7746 break; 7512 7747 } 7748 // XRAM RSP 7513 7749 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or 7514 7750 r_xram_rsp_to_cc_send_multi_req.read()) … … 7522 7758 break; 7523 7759 } 7760 // CAS 7524 7761 if(m_cas_to_cc_send_inst_fifo.rok() or 7525 7762 r_cas_to_cc_send_multi_req.read()) … … 7683 7920 7684 7921 r_read_to_cc_send_req = false; 7685 r_cc_send_fsm = CC_SEND_ WRITE_IDLE;7922 r_cc_send_fsm = CC_SEND_READ_IDLE; 7686 7923 7687 7924 #if DEBUG_MEMC_CC_SEND … … 7691 7928 << " <MEMC " << name() 7692 7929 << " CC_SEND_READ_NCC_INVAL_HEADER> Inval for line " 7693 << r_read_to_cc_send_nline.read()7930 << std::hex <<r_read_to_cc_send_nline.read() << std::dec 7694 7931 << std::endl; 7695 7932 } … … 7720 7957 << " <MEMC " << name() 7721 7958 << " CC_SEND_WRITE_NCC_INVAL_HEADER> Inval for line " 7722 << r_write_to_cc_send_nline.read()7959 << std::hex << r_write_to_cc_send_nline.read() << std::dec 7723 7960 << std::endl; 7724 7961 } … … 8369 8606 } 8370 8607 ///////////////////// 8371 case TGT_RSP_CLEANUP: // pas clair pour moi (AG)8608 case TGT_RSP_CLEANUP: 8372 8609 { 8373 8610 if(p_vci_tgt.rspack) … … 9616 9853 } 9617 9854 } 9618 //m_cc_receive_to_cleanup_fifo.update( cc_receive_to_cleanup_fifo_get,9619 // cc_receive_to_cleanup_fifo_put,9620 // p_dspin_p2m.data.read() );9621 9855 9622 9856 //////////////////////////////////////////////////////////////////////////////////// … … 9679 9913 r_config_rsp_lines = r_config_rsp_lines.read() - 1; 9680 9914 } 9915 9916 //////////////////////////////////////////////////////////////////////////////////// 9917 // Update min m_cpt_heap_min_slot_available. 9918 // The four sources of (increment / decrement) are READ / CLEANUP / XRAM_RSP / CONFIG FSMs 9919 //////////////////////////////////////////////////////////////////////////////////// 9920 assert((m_cpt_heap_slot_available <= m_heap_size) and "m_cpt_heap_slot_available > m_heap_size"); 9921 assert((m_cpt_heap_min_slot_available <= m_heap_size) and "m_cpt_heap_min_slot_available > m_heap_size"); 9922 m_cpt_heap_min_slot_available = min_value(m_cpt_heap_min_slot_available, m_cpt_heap_slot_available); 9681 9923 9682 9924 } // end transition() … … 9759 10001 p_vci_ixr.cmd = vci_param_ext::CMD_WRITE; 9760 10002 p_vci_ixr.cmdval = true; 9761 /*p_vci_ixr.address = (addr_t)((r_cleanup_to_ixr_cmd_nline.read() * m_words +9762 r_ixr_cmd_word.read()) * 4);*/9763 10003 p_vci_ixr.address = (addr_t)r_ixr_cmd_address.read() + (r_ixr_cmd_word.read()<<2); 9764 10004 p_vci_ixr.wdata = ((wide_data_t)(r_ixr_cmd_wdata[r_ixr_cmd_word.read()].read()) | … … 9988 10228 9989 10229 //////////////////////////////////////////////////////////////////// 10230 // p_irq port 10231 // 10232 // WRITE MISS response error signaling 10233 //////////////////////////////////////////////////////////////////// 10234 10235 p_irq = 10236 r_xram_rsp_rerror_irq.read() && 10237 r_xram_rsp_rerror_irq_enable.read(); 10238 10239 //////////////////////////////////////////////////////////////////// 9990 10240 // p_dspin_m2p port (CC_SEND FSM) 9991 10241 //////////////////////////////////////////////////////////////////// … … 10026 10276 DspinDhccpParam::MULTI_INVAL_DEST); 10027 10277 10028 DspinDhccpParam::dspin_set( flit,10029 m_cc_global_id,10030 DspinDhccpParam::MULTI_INVAL_SRCID);10031 10032 10278 // MODIFIED FOR CONFIG INVAL (solution 1 bit in flit multi_inval) 10033 10279 DspinDhccpParam::dspin_set( flit, … … 10082 10328 10083 10329 DspinDhccpParam::dspin_set( flit, 10084 m_cc_global_id,10085 DspinDhccpParam::MULTI_INVAL_SRCID);10086 10087 DspinDhccpParam::dspin_set( flit,10088 10330 r_xram_rsp_to_cc_send_trdid.read(), 10089 10331 DspinDhccpParam::MULTI_INVAL_UPDT_INDEX); … … 10119 10361 m_broadcast_boundaries, 10120 10362 DspinDhccpParam::BROADCAST_BOX); 10121 // MODIFIED FOR CONFIG INVAL (solution 1 bit in flit multi_inval)10363 10122 10364 DspinDhccpParam::dspin_set( flit, 10123 10365 1, 10124 10366 DspinDhccpParam::MULTI_INVAL_IS_CONFIG); 10125 10126 DspinDhccpParam::dspin_set( flit,10127 m_cc_global_id,10128 DspinDhccpParam::BROADCAST_SRCID);10129 10367 10130 10368 DspinDhccpParam::dspin_set( flit, … … 10145 10383 m_broadcast_boundaries, 10146 10384 DspinDhccpParam::BROADCAST_BOX); 10147 10148 DspinDhccpParam::dspin_set( flit,10149 m_cc_global_id,10150 DspinDhccpParam::BROADCAST_SRCID);10151 10385 10152 10386 DspinDhccpParam::dspin_set( flit, … … 10204 10438 DspinDhccpParam::dspin_set( 10205 10439 flit, 10206 m_cc_global_id,10207 DspinDhccpParam::MULTI_INVAL_SRCID);10208 10209 DspinDhccpParam::dspin_set(10210 flit,10211 10440 DspinDhccpParam::TYPE_MULTI_INVAL_DATA, 10212 10441 DspinDhccpParam::M2P_TYPE); … … 10246 10475 r_write_to_cc_send_dest.read(), 10247 10476 DspinDhccpParam::MULTI_INVAL_DEST); 10248 10249 DspinDhccpParam::dspin_set(10250 flit,10251 m_cc_global_id,10252 DspinDhccpParam::MULTI_INVAL_SRCID);10253 10477 10254 10478 DspinDhccpParam::dspin_set( … … 10333 10557 DspinDhccpParam::dspin_set( 10334 10558 flit, 10335 m_cc_global_id,10336 DspinDhccpParam::MULTI_UPDT_SRCID);10337 10338 DspinDhccpParam::dspin_set(10339 flit,10340 10559 r_write_to_cc_send_trdid.read(), 10341 10560 DspinDhccpParam::MULTI_UPDT_UPDT_INDEX); … … 10423 10642 dest, 10424 10643 DspinDhccpParam::MULTI_UPDT_DEST); 10425 10426 DspinDhccpParam::dspin_set(10427 flit,10428 m_cc_global_id,10429 DspinDhccpParam::MULTI_UPDT_SRCID);10430 10644 10431 10645 DspinDhccpParam::dspin_set( - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.