Changeset 323 for branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence
- Timestamp:
- Mar 14, 2013, 10:59:55 AM (12 years ago)
- Location:
- branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/include/vci_cc_vcache_wrapper.h
r315 r323 376 376 sc_signal<size_t> r_icache_cc_word; // word counter for cc update 377 377 sc_signal<bool> r_icache_cc_need_write; // activate the cache for writing 378 sc_signal<bool> r_icache_cc_fifo_done; // tels when fifo is all poped379 378 380 379 // icache flush handling … … 450 449 sc_signal<size_t> r_dcache_cc_word; // word counter for cc update 451 450 sc_signal<bool> r_dcache_cc_need_write; // activate the cache for writing 452 sc_signal<bool> r_dcache_cc_fifo_done; // tels when fifo is all poped453 451 454 452 // dcache flush handling -
branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/src/vci_cc_vcache_wrapper.cpp
r321 r323 140 140 }; 141 141 142 const char *cc_receive_fsm_state_str[] {142 const char *cc_receive_fsm_state_str[] = { 143 143 "CC_RECEIVE_IDLE", 144 144 "CC_RECEIVE_CLACK", … … 152 152 }; 153 153 154 const char *cc_send_fsm_state_str[] {154 const char *cc_send_fsm_state_str[] = { 155 155 "CC_SEND_IDLE", 156 156 "CC_SEND_CLEANUP_1", … … 255 255 r_icache_cc_word("r_icache_cc_word"), 256 256 r_icache_cc_need_write("r_icache_cc_need_write"), 257 r_icache_cc_fifo_done("r_icache_cc_fifo_done"),258 257 259 258 r_icache_flush_count("r_icache_flush_count"), … … 316 315 r_dcache_cc_word("r_dcache_cc_word"), 317 316 r_dcache_cc_need_write("r_dcache_cc_need_write"), 318 r_dcache_cc_fifo_done("r_dcache_cc_fifo_done"),319 317 320 318 r_dcache_flush_count("r_dcache_flush_count"), … … 1770 1768 // just pop the fifo , don't write in icache 1771 1769 r_icache_cc_need_write = false; 1772 r_icache_cc_fifo_done = false;1773 1770 } 1774 1771 // the request is dealt with … … 1814 1811 r_icache_fsm = ICACHE_CC_UPDT; 1815 1812 r_icache_cc_word = r_cc_receive_word_idx.read(); 1816 r_icache_cc_fifo_done = false;1817 1813 } 1818 1814 else if (r_cc_receive_icache_type.read() == CC_TYPE_INVAL) // hit inval … … 1834 1830 // just pop the fifo , don't write in icache 1835 1831 r_icache_cc_need_write = false; 1836 r_icache_cc_fifo_done = false;1837 1832 } 1838 1833 else // No response needed … … 1910 1905 size_t set = r_icache_cc_set.read(); 1911 1906 1912 if (not r_icache_cc_fifo_done.read()) 1913 { 1914 if (r_cc_receive_updt_fifo_be.rok()) 1915 { 1916 if (r_icache_cc_need_write.read()) 1907 if (r_cc_receive_updt_fifo_be.rok()) 1908 { 1909 if (r_icache_cc_need_write.read()) 1910 { 1911 r_icache.write( way, 1912 set, 1913 word, 1914 r_cc_receive_updt_fifo_data.read(), 1915 r_cc_receive_updt_fifo_be.read() ); 1916 1917 r_icache_cc_word = word+1; 1918 } 1919 if ( r_cc_receive_updt_fifo_eop.read() ) // last word 1920 { 1921 // no need to write in the cache anymore 1922 r_icache_cc_need_write = false; 1923 // wait to send a request to cc_send_fsm 1924 if(not r_icache_cc_send_req.read()) // cc_send is available 1917 1925 { 1918 r_icache.write( way, 1919 set, 1920 word, 1921 r_cc_receive_updt_fifo_data.read(), 1922 r_cc_receive_updt_fifo_be.read() ); 1923 1924 r_icache_cc_word = word+1; 1926 // coherence request completed 1927 r_cc_receive_icache_req = false; 1928 // request multicast acknowledgement 1929 r_icache_cc_send_req = true; 1930 r_icache_cc_send_updt_tab_idx = r_cc_receive_icache_updt_tab_idx.read(); 1931 r_icache_cc_send_type = CC_TYPE_MULTI_ACK; 1932 1933 r_icache_fsm = r_icache_fsm_save.read(); 1925 1934 } 1926 if ( r_cc_receive_updt_fifo_eop.read() ) // last word 1927 { 1928 // the fifo is all poped 1929 r_icache_cc_fifo_done = true; 1930 // no need to write in the cache anymore 1931 r_icache_cc_need_write = false; 1932 } 1933 //consume fifo 1935 } 1936 else 1937 { 1938 //consume fifo if not eop 1934 1939 cc_receive_updt_fifo_get = true; 1935 }1936 }1937 else1938 {1939 // wait to send a request to cc_send_fsm1940 if(not r_icache_cc_send_req.read()) // cc_send is available1941 {1942 // coherence request completed1943 r_cc_receive_icache_req = false;1944 // request multicast acknowledgement1945 r_icache_cc_send_req = true;1946 r_icache_cc_send_updt_tab_idx = r_cc_receive_icache_updt_tab_idx.read();1947 r_icache_cc_send_type = CC_TYPE_MULTI_ACK;1948 1949 r_icache_fsm = r_icache_fsm_save.read();1950 1940 } 1951 1941 } … … 4392 4382 // just pop the fifo , don't write in icache 4393 4383 r_dcache_cc_need_write = false; 4394 r_dcache_cc_fifo_done = false;4395 4384 } 4396 4385 // the request is dealt with … … 4438 4427 r_dcache_fsm = DCACHE_CC_UPDT; 4439 4428 r_dcache_cc_word = r_cc_receive_word_idx.read(); 4440 r_dcache_cc_fifo_done = false;4441 4429 } 4442 4430 else if (r_cc_receive_dcache_type.read() == CC_TYPE_INVAL) // hit inval … … 4458 4446 // just pop the fifo , don't write in icache 4459 4447 r_dcache_cc_need_write = false; 4460 r_dcache_cc_fifo_done = false;4461 4448 } 4462 4449 else // No response needed … … 4556 4543 size_t set = r_dcache_cc_set.read(); 4557 4544 4558 if ( not r_dcache_cc_fifo_done.read())4559 { 4560 if (r_ cc_receive_updt_fifo_be.rok())4561 { 4562 if ( r_dcache_cc_need_write.read())4545 if (r_cc_receive_updt_fifo_be.rok()) 4546 { 4547 if (r_dcache_cc_need_write.read()) 4548 { 4549 if ( r_dcache_in_tlb[way*m_dcache_sets+set] ) // selective TLB inval 4563 4550 { 4564 if ( r_dcache_in_tlb[way*m_dcache_sets+set] ) // selective TLB inval 4551 r_dcache_in_tlb[way*m_dcache_sets+set] = false; 4552 r_dcache_tlb_inval_line = r_cc_receive_dcache_nline.read() / (m_dcache_words<<2); 4553 r_dcache_tlb_inval_set = 0; 4554 r_dcache_fsm_scan_save = r_dcache_fsm.read(); 4555 r_dcache_fsm = DCACHE_INVAL_TLB_SCAN; 4556 break; 4557 } 4558 else 4559 { 4560 if ( r_dcache_contains_ptd[way*m_dcache_sets+set] ) // TLB flush 4565 4561 { 4566 r_dcache_in_tlb[way*m_dcache_sets+set] = false; 4567 r_dcache_tlb_inval_line = r_cc_receive_dcache_nline.read() / (m_dcache_words<<2); 4568 r_dcache_tlb_inval_set = 0; 4569 r_dcache_fsm_scan_save = r_dcache_fsm.read(); 4570 r_dcache_fsm = DCACHE_INVAL_TLB_SCAN; 4571 break; 4572 } 4573 else 4574 { 4575 if ( r_dcache_contains_ptd[way*m_dcache_sets+set] ) // TLB flush 4576 { 4577 r_itlb.reset(); 4578 r_dtlb.reset(); 4579 r_dcache_contains_ptd[way*m_dcache_sets+set] = false; 4562 r_itlb.reset(); 4563 r_dtlb.reset(); 4564 r_dcache_contains_ptd[way*m_dcache_sets+set] = false; 4580 4565 4581 4566 #if DEBUG_DCACHE … … 4586 4571 } 4587 4572 #endif 4588 4573 } 4589 4574 4590 4575 #ifdef INSTRUMENTATION 4591 4576 m_cpt_dcache_data_write++; 4592 4577 #endif 4593 4594 4595 4596 4597 4598 4599 4578 r_dcache.write( way, 4579 set, 4580 word, 4581 r_cc_receive_updt_fifo_data.read(), 4582 r_cc_receive_updt_fifo_be.read() ); 4583 4584 r_dcache_cc_word = word + 1; 4600 4585 4601 4586 #if DEBUG_DCACHE … … 4610 4595 } 4611 4596 #endif 4612 }4613 4597 } 4614 if ( r_cc_receive_updt_fifo_eop.read() ) // last word 4598 } 4599 4600 if ( r_cc_receive_updt_fifo_eop.read() ) // last word 4601 { 4602 // no need to write in the cache anymore 4603 r_dcache_cc_need_write = false; 4604 4605 // wait to send a request to cc_send_fsm 4606 if(not r_icache_cc_send_req.read()) 4607 // cc_send is available 4615 4608 { 4616 // the fifo is all poped 4617 r_dcache_cc_fifo_done = true; 4618 // no need to write in the cache anymore 4619 r_dcache_cc_need_write = false; 4609 //consume last fifo flit if eop and request to cc_send possible 4610 cc_receive_updt_fifo_get = true; 4611 4612 // coherence request completed 4613 r_cc_receive_dcache_req = false; 4614 4615 // request multicast acknowledgement 4616 r_dcache_cc_send_req = true; 4617 r_dcache_cc_send_updt_tab_idx = r_cc_receive_dcache_updt_tab_idx.read(); 4618 r_dcache_cc_send_type = CC_TYPE_MULTI_ACK; 4619 4620 r_dcache_fsm = r_dcache_fsm_cc_save.read(); 4620 4621 } 4621 //consume fifo 4622 } 4623 else 4624 { 4625 //consume fifo if not eop 4622 4626 cc_receive_updt_fifo_get = true; 4623 4627 } 4624 } 4625 else 4626 { 4627 // wait to send a request to cc_send_fsm 4628 if(not r_icache_cc_send_req.read()) // cc_send is available 4629 { 4630 // coherence request completed 4631 r_cc_receive_dcache_req = false; 4632 // request multicast acknowledgement 4633 r_dcache_cc_send_req = true; 4634 r_dcache_cc_send_updt_tab_idx = r_cc_receive_dcache_updt_tab_idx.read(); 4635 r_dcache_cc_send_type = CC_TYPE_MULTI_ACK; 4636 4637 r_dcache_fsm = r_dcache_fsm_cc_save.read(); 4638 } 4628 4639 4629 } 4640 4630 break;
Note: See TracChangeset
for help on using the changeset viewer.