Changeset 686 for branches/MESI/modules/vci_cc_vcache_wrapper
- Timestamp:
- May 13, 2014, 12:06:31 PM (11 years ago)
- Location:
- branches/MESI/modules/vci_cc_vcache_wrapper/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MESI/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h
r675 r686 371 371 sc_signal<paddr_t> r_icache_vci_paddr; // physical address 372 372 sc_signal<uint32_t> r_icache_vaddr_save; // virtual address from processor 373 373 sc_signal<bool> r_icache_read_state; 374 374 // icache miss handling 375 375 sc_signal<size_t> r_icache_miss_way; // selected way for cache update … … 420 420 sc_signal<int> r_dcache_fsm_scan_save; // return state for tlb scan op 421 421 // registers written in P0 stage (used in P1 stage) 422 sc_signal<bool> r_dcache_wbuf_req; // WBUF must be written in P1 stage 423 sc_signal<bool> r_dcache_updt_req; // DCACHE must be updated in P1 stage 422 sc_signal<uint32_t> r_dcache_save_wdata; // write data (from proc) 424 423 sc_signal<uint32_t> r_dcache_save_vaddr; // virtual address (from proc) 425 sc_signal<uint32_t> r_dcache_save_wdata; // write data (from proc)426 424 sc_signal<uint32_t> r_dcache_save_be; // byte enable (from proc) 427 425 sc_signal<paddr_t> r_dcache_save_paddr; // physical address … … 549 547 sc_signal<bool> r_dcache_updt_data_req; 550 548 sc_signal<bool> r_dcache_updt_dir_req; 551 sc_signal<bool> r_dcache_rsp_state;552 549 sc_signal<bool> r_dcache_cas_islocal; // cas is done locally 553 550 … … 561 558 562 559 //MESI 563 sc_signal<bool> r_icache_read_state;564 560 sc_signal<bool> r_dcache_read_state; 565 561 sc_signal<bool> r_dcache_read_for_modify; // a command intent to write 566 sc_signal<bool> r_dcache_r ead_hit; // a command intent to write hit in L1562 sc_signal<bool> r_dcache_rsp_state; 567 563 568 564 /////////////////////////////////// -
branches/MESI/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r682 r686 270 270 r_icache_vci_paddr("r_icache_vci_paddr"), 271 271 r_icache_vaddr_save("r_icache_vaddr_save"), 272 r_icache_read_state("r_icache_read_state"), 272 273 273 274 r_icache_miss_way("r_icache_miss_way"), … … 304 305 r_dcache_fsm_scan_save("r_dcache_fsm_scan_save"), 305 306 306 r_dcache_wbuf_req("r_dcache_wbuf_req"), 307 r_dcache_updt_data_req("r_dcache_updt_data_req"), 308 r_dcache_updt_dir_req("r_dcache_updt_dir_req"), 307 r_dcache_save_wdata("r_dcache_save_wdata"), 308 309 309 r_dcache_save_vaddr("r_dcache_save_vaddr"), 310 r_dcache_save_wdata("r_dcache_save_wdata"),311 310 r_dcache_save_be("r_dcache_save_be"), 312 311 r_dcache_save_paddr("r_dcache_save_paddr"), … … 332 331 r_dcache_vci_sc_data("r_dcache_vci_sc_data"), 333 332 333 334 334 335 r_dcache_xtn_way("r_dcache_xtn_way"), 335 336 r_dcache_xtn_set("r_dcache_xtn_set"), … … 354 355 r_dcache_tlb_pte_flags("r_dcache_tlb_pte_flags"), 355 356 r_dcache_tlb_pte_ppn("r_dcache_tlb_pte_ppn"), 356 // r_dcache_tlb_cache_way("r_dcache_tlb_cache_way"),357 // r_dcache_tlb_cache_set("r_dcache_tlb_cache_set"),358 // r_dcache_tlb_cache_word("r_dcache_tlb_cache_word"),359 357 r_dcache_tlb_way("r_dcache_tlb_way"), 360 358 r_dcache_tlb_set("r_dcache_tlb_set"), … … 374 372 r_dcache_cc_send_way("r_dcache_cc_send_way"), 375 373 r_dcache_cc_send_updt_tab_idx("r_dcache_cc_send_updt_tab_idx"), 374 r_dcache_updt_data_req("r_dcache_updt_data_req"), 375 r_dcache_updt_dir_req("r_dcache_updt_dir_req"), 376 r_dcache_read_for_modify("r_dcache_read_for_modify"), 377 r_dcache_rsp_state("r_dcache_rsp_state"), 376 378 377 379 r_vci_cmd_fsm("r_vci_cmd_fsm"), … … 387 389 r_vci_rsp_fifo_icache("r_vci_rsp_fifo_icache", 2), // 2 words depth 388 390 r_vci_rsp_fifo_dcache("r_vci_rsp_fifo_dcache", 16), // 2 words depth 389 // r_vci_rsp_fifo_rpktid("r_vci_rsp_fifo_rpktid", 2), // 2 words depth390 391 r_cc_send_data_fifo("r_cc_send_data_fifo", 2), 391 392 … … 409 410 r_cc_receive_dcache_updt_tab_idx("r_cc_receive_dcache_updt_tab_idx"), 410 411 r_cc_receive_dcache_nline("r_cc_receive_dcache_nline"), 412 413 411 414 r_cc_receive_dcache_srcid("r_cc_receive_dcache_srcid"), 412 413 r_icache_read_state("r_icache_read_state"),414 r_dcache_rsp_state("r_dcache_rsp_state"),415 415 416 416 r_iss(this->name(), proc_id), … … 519 519 << " | MMU = " << r_mmu_mode.read(); 520 520 if (r_dcache_updt_data_req.read() ) std::cout << " | P1_UPDT"; 521 if (r_dcache_wbuf_req.read() ) std::cout << " | P1_WBUF";522 521 std::cout << std::endl; 523 522 … … 814 813 r_icache_clack_req = false; 815 814 816 // No pending write in pipeline817 r_dcache_wbuf_req = false;818 819 815 // No request from DCACHE_FSM to CMD_FSM 820 816 r_dcache_vci_miss_req = false; … … 1010 1006 bool vci_rsp_fifo_dcache_put = false; 1011 1007 uint32_t vci_rsp_fifo_dcache_data = 0; 1012 bool vci_rsp_fifo_rpktid_get = false;1013 bool vci_rsp_fifo_rpktid_put = false;1014 bool vci_rsp_fifo_rpktid = false;1015 1008 1016 1009 // FIFO for cleanup data updt … … 1018 1011 bool cleanup_data_updt_fifo_dcache_put = false; 1019 1012 uint32_t cleanup_data_updt_fifo_dcache_data = 0; 1020 1021 // updt fifo1022 bool cc_receive_updt_fifo_get = false;1023 bool cc_receive_updt_fifo_put = false;1024 uint32_t cc_receive_updt_fifo_be = 0;1025 uint32_t cc_receive_updt_fifo_data = 0;1026 bool cc_receive_updt_fifo_eop = false;1027 1013 1028 1014 #ifdef INSTRUMENTATION … … 2283 2269 2284 2270 bool tlb_inval_required = false; // request TLB inval after cache update 2285 bool wbuf_write_miss = false; // miss a WBUF write request2286 2271 bool updt_data_request = false; // request DCACHE update in P1 stage 2287 2272 bool updt_dir_request = false; // request DCACHE update in P1 stage 2288 bool wbuf_request = false; // request WBUF write in P1 stage2289 2290 2273 2291 2274 // physical address computation : systematic DTLB access (if activated) … … 2293 2276 { 2294 2277 2295 //#if 1 2296 //// @@@ DO NOT COMMIT: ALMOS KILLING SIMU PURPOSE2297 //if (m_dreq.addr == 0x0 && m_dreq.wdata == 0xDEADDEAD) {2298 //std::cout << "*** Ecriture à l'adresse 0 pour fin de simulation ***" << std::endl;2299 //raise(SIGINT);2300 //}2301 //#endif2278 #if 0 2279 // @@@ DO NOT COMMIT: ALMOS KILLING SIMU PURPOSE 2280 if (m_dreq.addr == 0x0 && m_dreq.wdata == 0xDEADDEAD) { 2281 std::cout << "*** Ecriture à l'adresse 0 pour fin de simulation ***" << std::endl; 2282 raise(SIGINT); 2283 } 2284 #endif 2302 2285 2303 2286 if ( r_mmu_mode.read() & DATA_TLB_MASK ) // DTLB activated … … 2938 2921 r_dcache_vci_miss_req = true; 2939 2922 r_dcache_read_for_modify = true; 2940 r_dcache_read_hit = true;2941 2923 r_dcache_miss_type = PROC_MISS; 2942 2924 r_dcache_fsm = DCACHE_MISS_WAIT; … … 2965 2947 r_dcache_fsm = DCACHE_MISS_SELECT; 2966 2948 r_dcache_read_for_modify = true; 2967 r_dcache_read_hit = false;2968 2949 } 2969 2950 else … … 3727 3708 } 3728 3709 #endif 3710 // checking llsc reservation buffer 3711 if ( r_dcache_llsc_paddr.read() == r_dcache_tlb_paddr.read() ) 3712 r_dcache_llsc_valid = false; 3729 3713 3730 3714 if (r_cas_cache_state.read() == CACHE_SLOT_STATE_EXCLUSIVE or … … 3776 3760 // r_dcache_vci_cas_old & r_dcache_vci_cas_new registers are already set 3777 3761 r_dcache_vci_paddr = r_dcache_tlb_paddr.read(); 3778 3779 // checking llsc reservation buffer3780 if ( r_dcache_llsc_paddr.read() == r_dcache_tlb_paddr.read() )3781 r_dcache_llsc_valid = false;3782 3783 3762 // request a CAS CMD and go to DCACHE_TLB_LR_WAIT state 3784 3763 r_dcache_vci_cas_req = true; … … 4706 4685 vci_rsp_fifo_dcache_get = true; 4707 4686 4708 // r_dcache_rsp_state = !r_vci_rsp_fifo_rpktid.read();//deduce the state (CC or NCC) from msb of pktid4709 vci_rsp_fifo_rpktid_get = true;4710 4711 4712 4687 r_dcache_miss_word = r_dcache_miss_word.read() + 1; 4713 4688 … … 4789 4764 #endif 4790 4765 4791 r_dcache_fsm = DCACHE_MISS_BACKOFF;4766 //r_dcache_fsm = DCACHE_MISS_BACKOFF; 4792 4767 r_dcache_count_backoff = r_dcache_count_backoff.read() + 1; 4793 4768 r_dcache_count_begin = 0; … … 4805 4780 #endif 4806 4781 r_dcache_count_backoff = 0; 4807 size_t way = r_dcache_miss_way.read(); 4808 size_t set = r_dcache_miss_set.read(); 4782 4809 4783 if ( r_dcache_rsp_state.read()) 4810 4784 { … … 4831 4805 << " / SET = " << r_dcache_miss_set.read() << std::endl; 4832 4806 #endif 4833 // reset directory extension4834 if (r_dcache_miss_type.read()==PTE1_MISS) r_dcache_fsm = DCACHE_TLB_PTE1_GET;4835 else if (r_dcache_miss_type.read()==PTE2_MISS) r_dcache_fsm = DCACHE_TLB_PTE2_GET;4836 else r_dcache_fsm = DCACHE_IDLE;4837 }4807 } 4808 // reset directory extension 4809 if (r_dcache_miss_type.read()==PTE1_MISS) r_dcache_fsm = DCACHE_TLB_PTE1_GET; 4810 else if (r_dcache_miss_type.read()==PTE2_MISS) r_dcache_fsm = DCACHE_TLB_PTE2_GET; 4811 else r_dcache_fsm = DCACHE_IDLE; 4838 4812 } 4839 4813 break; … … 5290 5264 else if(r_cc_receive_dcache_type.read() == CC_TYPE_UPDT) 5291 5265 { 5292 assert(( state == CACHE_SLOT_STATE_INVALID) or (state == CACHE_SLOT_STATE_ZOMBI) && " CC_UPDT WITH A NO INVALID STATE");5266 assert(((state == CACHE_SLOT_STATE_INVALID) or (state == CACHE_SLOT_STATE_ZOMBI)) && " CC_UPDT WITH A NO INVALID STATE"); 5293 5267 5294 5268 r_dcache_cc_send_multi_ack_miss = true; … … 5304 5278 // signaling matching 5305 5279 5306 // if(r_cc_receive_dcache_type.read() == CC_TYPE_UPDT)5307 // {5308 // if(r_dcache_read_for_modify.read() and (r_dcache_miss_type == PROC_MISS))5309 // {5310 // r_dcache_miss_inval = false;5311 // r_dcache_miss_updt = true;5312 // r_dcache_fsm = r_dcache_fsm_cc_save.read();5313 // }5314 // else5315 // {5316 // // r_dcache_cc_send_multi_ack_miss = true;5317 // r_dcache_cc_send_multi_ack_miss = false;5318 // r_dcache_miss_inval = false;5319 // r_dcache_cc_state = CACHE_SLOT_STATE_INVALID;5320 // r_dcache_fsm = DCACHE_CC_UPDT;5321 // }5322 // }5323 // else5324 // {5325 // if(r_cc_receive_dcache_srcid.read() == m_srcid and r_cc_receive_brdcast.read() and (r_dcache_miss_type == PROC_MISS))5326 // {5327 // assert(r_dcache_read_for_modify.read() && "miss inval for a miss getm in type of brdcast, this is impossible!!");5328 // r_dcache_miss_inval = false;5329 // r_cc_receive_dcache_req = false;5330 // }5331 // else if(not r_cc_receive_brdcast.read() and r_dcache_read_for_modify.read() and (r_dcache_miss_type == PROC_MISS))5332 // {5333 // r_dcache_miss_inval = false;5334 // r_dcache_miss_updt = true;5335 // }5336 // else5337 // {5338 // r_cc_receive_dcache_req = false;5339 // r_dcache_miss_inval = true;5340 // }5341 // r_dcache_fsm = r_dcache_fsm_cc_save.read();5342 // }5343 5344 5280 #if DEBUG_DCACHE 5345 5281 if ( m_debug_activated ) … … 5360 5296 5361 5297 // CC request handler 5362 5363 5364 5365 5298 #ifdef INSTRUMENTATION 5366 5299 m_cpt_dcache_dir_read++; … … 5542 5475 // after possible invalidation of copies in TLBs 5543 5476 { 5544 size_t word = r_dcache_cc_word.read();5545 5477 size_t way = r_dcache_cc_way.read(); 5546 5478 size_t set = r_dcache_cc_set.read(); … … 6523 6455 vci_rsp_fifo_dcache_put, 6524 6456 vci_rsp_fifo_dcache_data); 6525 //BUG pktid 6526 // r_vci_rsp_fifo_rpktid.update(vci_rsp_fifo_rpktid_get, 6527 // vci_rsp_fifo_rpktid_put, 6528 // vci_rsp_fifo_rpktid); 6529 // 6457 6530 6458 r_cc_send_data_fifo.update(cleanup_data_updt_fifo_dcache_get, 6531 6459 cleanup_data_updt_fifo_dcache_put, … … 6614 6542 p_vci.be = 0xF; 6615 6543 p_vci.trdid = 0; 6616 if(r_dcache_read_for_modify.read() and r_dcache_read_hit.read()) 6617 p_vci.pktid = TYPE_WRITE + 0x8; 6618 else if(r_dcache_read_for_modify.read() and not r_dcache_read_hit.read()) 6544 if(r_dcache_read_for_modify.read()) 6619 6545 p_vci.pktid = TYPE_WRITE; 6620 6546 else
Note: See TracChangeset
for help on using the changeset viewer.