Changeset 494 for branches/ODCCP/modules/vci_cc_vcache_wrapper
- Timestamp:
- Aug 20, 2013, 2:13:08 PM (11 years ago)
- Location:
- branches/ODCCP/modules/vci_cc_vcache_wrapper
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ODCCP/modules/vci_cc_vcache_wrapper
- Property svn:mergeinfo changed
/trunk/modules/vci_cc_vcache_wrapper merged: 484,487-488
- Property svn:mergeinfo changed
-
branches/ODCCP/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h
r479 r494 179 179 CC_RECEIVE_INS_UPDT_HEADER, 180 180 CC_RECEIVE_INS_UPDT_NLINE, 181 CC_RECEIVE_INS_UPDT_DATA,182 181 CC_RECEIVE_DATA_INVAL_HEADER, 183 182 CC_RECEIVE_DATA_INVAL_NLINE, 184 183 CC_RECEIVE_DATA_UPDT_HEADER, 185 184 CC_RECEIVE_DATA_UPDT_NLINE, 185 CC_RECEIVE_INS_UPDT_DATA, 186 186 CC_RECEIVE_DATA_UPDT_DATA, 187 187 }; … … 404 404 sc_signal<bool> r_icache_tlb_rsp_error; // tlb miss response error 405 405 406 // Filp-Flop in ICACHE FSM for saving the cleanup victim request 407 sc_signal<bool> r_icache_cleanup_victim_req; 408 sc_signal<paddr_t> r_icache_cleanup_victim_nline; 409 406 410 // communication between ICACHE FSM and CC_SEND FSM 407 411 sc_signal<bool> r_icache_cc_send_req; // ICACHE cc_send request … … 497 501 sc_signal<int> r_dcache_xtn_opcode; // xtn request type 498 502 503 // Filp-Flop in DCACHE FSM for saving the cleanup victim request 504 sc_signal<bool> r_dcache_cleanup_victim_req; 505 sc_signal<paddr_t> r_dcache_cleanup_victim_nline; 506 499 507 // communication between DCACHE FSM and CC_SEND FSM 500 508 sc_signal<bool> r_dcache_cc_send_req; // DCACHE cc_send request … … 507 515 sc_signal<bool> r_dcache_cc_cleanup_updt_data; // Register for cleanup with data (wb updt) 508 516 sc_signal<bool> r_dcache_cleanup_ncc; // Register for cleanup no coherent 517 //sc_signal<bool> r_miss_cleanup_ncc_pending; // Register for cleanup no coherent 518 sc_signal<bool> r_dcache_cleanup_will_contains_data; // Register for cleanup no coherent 519 sc_signal<bool> r_dcache_cleanup_will_ncc; // Register for cleanup no coherent 509 520 sc_signal<bool> r_dcache_miss_victim_no_coherence; // Register for victim in no coherence mode 510 521 sc_signal<bool> r_dcache_line_no_coherence; // Register for line current in no coherence mode -
branches/ODCCP/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r492 r494 36 36 #define DEBUG_CLEANUP 1 37 37 #define INSTRUMENTATION 1 38 #define FETCH_ON_WRITE_ENABLE 038 #define FETCH_ON_WRITE_ENABLE 1 39 39 #define DEBUG_CMD 0 40 40 … … 285 285 r_icache_tlb_rsp_error("r_icache_tlb_rsp_error"), 286 286 287 r_icache_cleanup_victim_req("r_icache_cleanup_victim_req"), 288 r_icache_cleanup_victim_nline("r_icache_cleanup_victim_nline"), 289 287 290 r_icache_cc_send_req("r_icache_cc_send_req"), 288 291 r_icache_cc_send_type("r_icache_cc_send_type"), … … 357 360 r_dcache_xtn_opcode("r_dcache_xtn_opcode"), 358 361 362 r_dcache_cleanup_victim_req("r_dcache_cleanup_victim_req"), 363 r_dcache_cleanup_victim_nline("r_dcache_cleanup_victim_nline"), 364 359 365 r_dcache_cc_send_req("r_dcache_cc_send_req"), 360 366 r_dcache_cc_send_type("r_dcache_cc_send_type"), … … 363 369 r_dcache_cc_send_updt_tab_idx("r_dcache_cc_send_updt_tab_idx"), 364 370 365 r_cc_send_data_fifo("r_cc_send_data_fifo", 2), // ODCCP371 r_cc_send_data_fifo("r_cc_send_data_fifo", 16), // ODCCP 366 372 367 373 r_vci_cmd_fsm("r_vci_cmd_fsm"), … … 792 798 // No request from ICACHE_FSM to CC_SEND FSM 793 799 r_icache_cc_send_req = false; 800 r_icache_cleanup_victim_req = false; 794 801 795 802 r_icache_clack_req = false; … … 814 821 // No request from DCACHE FSM to CC_SEND FSM 815 822 r_dcache_cc_send_req = false; 816 823 r_dcache_cleanup_victim_req = false; 824 817 825 r_dcache_clack_req = false; 818 826 … … 852 860 r_dcache_miss_data_cpt = 0; 853 861 r_dcache_miss_data_addr = 0; 862 //r_miss_cleanup_ncc_pending = false; 854 863 855 864 // activity counters … … 1093 1102 1094 1103 // coherence interrupt 1095 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() 1104 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1096 1105 { 1097 1106 r_icache_fsm = ICACHE_CC_CHECK; … … 1330 1339 1331 1340 // coherence interrupt 1332 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() 1341 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1333 1342 { 1334 1343 r_icache_fsm = ICACHE_CC_CHECK; … … 1382 1391 1383 1392 // coherence request (from CC_RECEIVE FSM) 1384 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() 1393 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1385 1394 { 1386 1395 r_icache_fsm = ICACHE_CC_CHECK; … … 1572 1581 //////////////////////// 1573 1582 case ICACHE_MISS_SELECT: // Try to select a slot in associative set, 1574 // if previous cleanup has been sent.1575 1583 // Waiting in this state if no slot available. 1576 // Set the r_icache_cleanup_req flip-flop 1577 // and the r_icache_miss_clack flip-flop, 1584 // If a victim slot has been choosen and the r_icache_cc_send_req is false, 1585 // we send the cleanup request in this state. 1586 // If not, a r_icache_cleanup_victim_req flip-flop is 1587 // utilized for saving this cleanup request, and it will be sent later 1588 // in state ICACHE_MISS_WAIT or ICACHE_MISS_UPDT_DIR. 1589 // The r_icache_miss_clack flip-flop is set 1578 1590 // when a cleanup is required 1579 1591 { … … 1589 1601 1590 1602 // coherence interrupt 1591 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() 1603 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1592 1604 { 1593 1605 r_icache_fsm = ICACHE_CC_CHECK; … … 1596 1608 } 1597 1609 1598 if ( not r_icache_cc_send_req.read() ) // wait for previous cc_send request to be sent 1599 { 1600 bool found; 1601 bool cleanup; 1602 size_t way; 1603 size_t set; 1604 paddr_t victim; 1610 1611 bool found; 1612 bool cleanup; 1613 size_t way; 1614 size_t set; 1615 paddr_t victim; 1605 1616 1606 1617 #ifdef INSTRUMENTATION 1607 1618 m_cpt_icache_dir_read++; 1608 1619 #endif 1609 r_icache.read_select(r_icache_vci_paddr.read(), 1610 &victim, 1611 &way, 1612 &set, 1613 &found, 1614 &cleanup ); 1615 if ( found ) 1616 { 1617 r_icache_miss_way = way; 1618 r_icache_miss_set = set; 1619 1620 if ( cleanup ) 1620 r_icache.read_select(r_icache_vci_paddr.read(), 1621 &victim, 1622 &way, 1623 &set, 1624 &found, 1625 &cleanup ); 1626 if ( not found ) 1627 { 1628 break; 1629 } 1630 else 1631 { 1632 r_icache_miss_way = way; 1633 r_icache_miss_set = set; 1634 1635 if ( cleanup ) 1636 { 1637 if ( not r_icache_cc_send_req.read() ) 1621 1638 { 1622 r_icache_fsm = ICACHE_MISS_CLEAN; 1623 r_icache_miss_clack = true; 1624 // request cleanup 1625 r_icache_cc_send_req = true; 1626 r_icache_cc_send_nline = victim; 1627 r_icache_cc_send_way = way; 1628 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1639 r_icache_cc_send_req = true; 1640 r_icache_cc_send_nline = victim; 1641 r_icache_cc_send_way = way; 1642 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1629 1643 } 1630 1644 else 1631 1645 { 1632 r_icache_fsm = ICACHE_MISS_WAIT; 1646 r_icache_cleanup_victim_req = true; 1647 r_icache_cleanup_victim_nline = victim; 1633 1648 } 1649 1650 r_icache_miss_clack = true; 1651 r_icache_fsm = ICACHE_MISS_CLEAN; 1652 } 1653 else 1654 { 1655 r_icache_fsm = ICACHE_MISS_WAIT; 1656 } 1634 1657 1635 1658 #if DEBUG_ICACHE … … 1644 1667 } 1645 1668 #endif 1646 }1647 1669 } 1648 1670 break; … … 1677 1699 if (m_ireq.valid) m_cost_ins_miss_frz++; 1678 1700 1701 // send cleanup victim request 1702 if ( r_icache_cleanup_victim_req.read() and not r_icache_cc_send_req.read() ) 1703 { 1704 r_icache_cc_send_req = true; 1705 r_icache_cc_send_nline = r_icache_cleanup_victim_nline; 1706 r_icache_cc_send_way = r_icache_miss_way; 1707 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1708 r_icache_cleanup_victim_req = false; 1709 } 1710 1679 1711 // coherence clack interrupt 1680 1712 if ( r_icache_clack_req.read() ) … … 1684 1716 break; 1685 1717 } 1686 1718 1687 1719 // coherence interrupt 1688 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() )1720 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() and not r_icache_cleanup_victim_req.read() ) 1689 1721 { 1690 1722 r_icache_fsm = ICACHE_CC_CHECK; … … 1756 1788 if ( m_ireq.valid ) m_cost_ins_miss_frz++; 1757 1789 1790 // send cleanup victim request 1791 if ( r_icache_cleanup_victim_req.read() and not r_icache_cc_send_req.read() ) 1792 { 1793 r_icache_cc_send_req = true; 1794 r_icache_cc_send_nline = r_icache_cleanup_victim_nline; 1795 r_icache_cc_send_way = r_icache_miss_way; 1796 r_icache_cc_send_type = CC_TYPE_CLEANUP; 1797 r_icache_cleanup_victim_req = false; 1798 } 1799 1758 1800 // coherence clack interrupt 1759 1801 if ( r_icache_clack_req.read() ) … … 1765 1807 1766 1808 // coherence interrupt 1767 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() )1809 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() and not r_icache_cleanup_victim_req.read() ) 1768 1810 { 1769 1811 r_icache_fsm = ICACHE_CC_CHECK; … … 1844 1886 1845 1887 // coherence interrupt 1846 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read() 1888 if ( r_cc_receive_icache_req.read() and not r_icache_cc_send_req.read()) 1847 1889 { 1848 1890 r_icache_fsm = ICACHE_CC_CHECK; … … 1923 1965 break; 1924 1966 } 1967 1968 assert ( not r_icache_cc_send_req.read() and "CC_SEND must be available in ICACHE_CC_CHECK"); 1925 1969 1926 1970 // Match between MISS address and CC address … … 1961 2005 #endif 1962 2006 } 1963 1964 1965 assert ( not r_icache_cc_send_req.read() and "CC_SEND must be available in ICACHE_CC_CHECK");1966 2007 1967 2008 // CC request handler … … 3107 3148 3108 3149 // coherence request (from CC_RECEIVE FSM) 3109 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 3150 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3110 3151 { 3111 3152 r_dcache_fsm = DCACHE_CC_CHECK; … … 3414 3455 3415 3456 // coherence request (from CC_RECEIVE FSM) 3416 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 3457 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3417 3458 { 3418 3459 r_dcache_fsm = DCACHE_CC_CHECK; … … 3721 3762 3722 3763 // coherence request (from CC_RECEIVE FSM) 3723 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 3764 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3724 3765 { 3725 3766 r_dcache_fsm = DCACHE_CC_CHECK; … … 3800 3841 3801 3842 // coherence request (from CC_RECEIVE FSM) 3802 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 3843 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3803 3844 { 3804 3845 r_dcache_fsm = DCACHE_CC_CHECK; … … 3830 3871 3831 3872 // coherence request (from CC_RECEIVE FSM) 3832 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 3873 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3833 3874 { 3834 3875 r_dcache_fsm = DCACHE_CC_CHECK; … … 3873 3914 3874 3915 // coherence request (from CC_RECEIVE FSM) 3875 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 3916 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 3876 3917 { 3877 3918 r_dcache_fsm = DCACHE_CC_CHECK; … … 3971 4012 &set, 3972 4013 &word); 4014 4015 /*if (m_proc_id == 1) { std::cout << "rdata XTN_FLUSH_DATA = " << std::hex << rdata << std::dec << " | at cycle = " << m_cpt_total_cycles << std::endl; } 4016 if (m_proc_id == 1) { r_cc_send_data_fifo.print(); }*/ 4017 3973 4018 if(r_cc_send_data_fifo.wok()) 3974 4019 { … … 4047 4092 { 4048 4093 paddr = (paddr_t)r_dcache_save_wdata.read(); 4094 if (vci_param::N > 32) 4095 paddr = paddr | ((paddr_t)(r_dcache_paddr_ext.read()) << 32); 4049 4096 hit = true; 4050 4097 } … … 4233 4280 &set, 4234 4281 &word); 4282 4283 /*if (m_proc_id == 1) { std::cout << "rdata XTN_INVAL_DATA = " << std::hex << rdata << std::dec << " | at cycle = " << m_cpt_total_cycles << std::endl; } 4284 if (m_proc_id == 1) { r_cc_send_data_fifo.print(); }*/ 4285 4235 4286 if(r_cc_send_data_fifo.wok()) 4236 4287 { … … 4263 4314 } 4264 4315 //////////////////////// 4265 case DCACHE_MISS_SELECT: // Try to select a slot in associative set 4266 // if previous cleanup has been sent. 4267 // Waiting in this state if no slot available 4268 // Set the r_dcache_cleanup_req flip-flop 4269 // and the r_dcache_miss_clack flip-flop 4270 // when a cleanup is required 4316 case DCACHE_MISS_SELECT: // Try to select a slot in associative set, 4317 // Waiting in this state if no slot available. 4318 // If a victim slot has been choosen and the r_icache_cc_send_req is false, 4319 // we send the cleanup request in this state. 4320 // If not, a r_icache_cleanup_victim_req flip-flop is 4321 // utilized for saving this cleanup request, and it will be sent later 4322 // in state ICACHE_MISS_WAIT or ICACHE_MISS_UPDT_DIR. 4323 // The r_icache_miss_clack flip-flop is set 4324 // when a cleanup is required 4271 4325 { 4272 4326 if ( m_dreq.valid) m_cost_data_miss_frz++; … … 4281 4335 4282 4336 // coherence request (from CC_RECEIVE FSM) 4283 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 4337 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4284 4338 { 4285 4339 r_dcache_fsm = DCACHE_CC_CHECK; … … 4288 4342 } 4289 4343 4290 if ( not r_dcache_cc_send_req.read() ) // blocked until previous cc_send request is sent4291 {4292 bool found= false;4293 bool cleanup= false;4294 4295 4296 4344 bool found = false; 4345 bool cleanup = false; 4346 bool dirty = false; 4347 bool ncc = false; 4348 size_t way = 0; 4349 size_t set = 0; 4350 paddr_t victim = 0; 4297 4351 int state; 4298 4352 … … 4300 4354 m_cpt_dcache_dir_read++; 4301 4355 #endif 4302 4303 4304 4305 4306 4307 4356 r_dcache.read_select( r_dcache_save_paddr.read(), 4357 &victim, 4358 &way, 4359 &set, 4360 &found, 4361 &cleanup ); 4308 4362 state = r_dcache.get_cache_state(way,set); 4309 if ( found ) 4310 { 4311 r_dcache_miss_way = way; 4312 r_dcache_miss_set = set; 4313 4314 if ( cleanup ) 4363 if ( not found ) 4364 { 4365 break; 4366 } 4367 else 4368 { 4369 r_dcache_miss_way = way; 4370 r_dcache_miss_set = set; 4371 4372 if ( cleanup ) 4373 { 4374 4375 r_dcache_miss_clack = true; 4376 r_dcache_fsm = DCACHE_MISS_CLEAN; 4377 4378 4379 if( (state == CACHE_SLOT_STATE_VALID_NCC) ) 4315 4380 { 4316 r_dcache_miss_clack = true; 4317 r_dcache_fsm = DCACHE_MISS_CLEAN; 4318 // request cleanup 4319 r_dcache_cc_send_req = true; 4320 r_dcache_cc_send_nline = victim; 4321 r_dcache_cc_send_way = way; 4322 r_dcache_cc_send_type = CC_TYPE_CLEANUP; 4323 4324 if( (state == CACHE_SLOT_STATE_VALID_NCC) ) 4381 //r_dcache_cleanup_ncc = true; 4382 ncc = true; 4383 r_dcache_cleanup_will_ncc = true; 4384 4385 /*ODCCP*/ // if line is dirty we must save the data values 4386 if (r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_DATA_DIRTY) 4325 4387 { 4326 r_dcache_cleanup_ncc = true; 4327 4328 /*ODCCP*/ // if line is dirty we must save the data values 4329 if (r_dcache_content_state[way*m_dcache_sets+set] == LINE_CACHE_DATA_DIRTY) 4388 //r_dcache_cc_cleanup_updt_data = true; 4389 dirty = true; 4390 r_dcache_cleanup_will_contains_data = true; 4391 r_dcache_miss_data_addr = (victim*m_dcache_words)*4; 4392 r_dcache_fsm = DCACHE_MISS_DATA; 4393 4394 /*TEST*/ 4395 /*if (not r_dcache_cc_send_req.read()) 4396 r_miss_cleanup_ncc_pending = true; 4397 else 4398 r_miss_cleanup_ncc_pending = false;*/ 4399 4400 m_cpt_data_cleanup_dirty ++; 4401 4402 /*STATS DIRTY*/ 4403 for (size_t w = 0; w < m_dcache_words; w++) 4330 4404 { 4331 r_dcache_cc_cleanup_updt_data = true; 4332 r_dcache_miss_data_addr = (victim*m_dcache_words)*4; 4333 r_dcache_fsm = DCACHE_MISS_DATA; 4334 m_cpt_data_cleanup_dirty ++; 4335 4336 /*STATS DIRTY*/ 4337 for (size_t w = 0; w < m_dcache_words; w++) 4338 { 4339 if(dirty_stats[(way * m_dcache_sets + set) * m_dcache_words + w] == true) 4340 m_cpt_words_dirty++; 4341 } 4405 if(dirty_stats[(way * m_dcache_sets + set) * m_dcache_words + w] == true) 4406 m_cpt_words_dirty++; 4342 4407 } 4343 else 4344 { 4345 r_dcache_cc_cleanup_updt_data = false; 4346 } 4347 } 4408 } 4348 4409 else 4349 4410 { 4350 r_dcache_cc_cleanup_updt_data = false;4351 r_dcache_cleanup_ ncc= false;4411 //r_dcache_cc_cleanup_updt_data = false; 4412 r_dcache_cleanup_will_contains_data = false; 4352 4413 } 4414 } 4415 else 4416 { 4417 r_dcache_cleanup_will_contains_data = false; 4418 r_dcache_cleanup_will_ncc = false; 4419 //r_dcache_cc_cleanup_updt_data = false; 4420 //r_dcache_cleanup_ncc = false; 4421 } 4422 4423 if ( not r_dcache_cc_send_req.read() ) 4424 { 4425 if (dirty) r_dcache_cc_cleanup_updt_data = true; 4426 else r_dcache_cc_cleanup_updt_data = false; 4427 4428 if (ncc) r_dcache_cleanup_ncc = true; 4429 else r_dcache_cleanup_ncc = false; 4430 4431 r_dcache_cc_send_req = true; 4432 r_dcache_cc_send_nline = victim; 4433 r_dcache_cc_send_way = way; 4434 r_dcache_cc_send_type = CC_TYPE_CLEANUP; 4353 4435 } 4354 4436 else 4355 4437 { 4356 r_dcache_fsm = DCACHE_MISS_WAIT; 4438 r_dcache_cleanup_victim_req = true; 4439 r_dcache_cleanup_victim_nline = victim; 4357 4440 } 4441 } 4442 else 4443 { 4444 r_dcache_fsm = DCACHE_MISS_WAIT; 4445 } 4358 4446 4359 4447 #if DEBUG_DCACHE … … 4369 4457 } 4370 4458 #endif 4371 } // end found 4372 } 4459 } // end found 4373 4460 break; 4374 4461 } … … 4385 4472 &set, 4386 4473 &word); 4474 4475 /*if (m_proc_id == 1) { std::cout << "rdata MISS_DATA = " << std::hex << rdata << std::dec << " | at cycle = " << m_cpt_total_cycles << std::endl; } 4476 if (m_proc_id == 1) { r_cc_send_data_fifo.print(); }*/ 4387 4477 4388 4478 if(r_cc_send_data_fifo.wok()) … … 4466 4556 if ( m_dreq.valid) m_cost_data_miss_frz++; 4467 4557 4558 // send cleanup victim request 4559 if ( r_dcache_cleanup_victim_req.read() and not r_dcache_cc_send_req.read() ) 4560 { 4561 r_dcache_cc_send_req = true; 4562 r_dcache_cc_send_nline = r_dcache_cleanup_victim_nline; 4563 r_dcache_cc_send_way = r_dcache_miss_way; 4564 r_dcache_cc_send_type = CC_TYPE_CLEANUP; 4565 r_dcache_cleanup_victim_req = false; 4566 if (r_dcache_cleanup_will_contains_data.read() == true) 4567 r_dcache_cc_cleanup_updt_data = true; 4568 else 4569 r_dcache_cc_cleanup_updt_data = false; 4570 4571 if (r_dcache_cleanup_will_ncc.read()) r_dcache_cleanup_ncc = true; 4572 else r_dcache_cleanup_ncc = false; 4573 } 4574 4468 4575 // coherence clack request (from DSPIN CLACK) 4469 4576 if ( r_dcache_clack_req.read() ) … … 4475 4582 4476 4583 // coherence request (from CC_RECEIVE FSM) 4477 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() )4584 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() and not r_dcache_cleanup_victim_req.read() /*and not r_miss_cleanup_ncc_pending.read()*/) 4478 4585 { 4479 4586 r_dcache_fsm = DCACHE_CC_CHECK; … … 4589 4696 if ( m_dreq.valid) m_cost_data_miss_frz++; 4590 4697 4698 // send cleanup victim request 4699 if ( r_dcache_cleanup_victim_req.read() and not r_dcache_cc_send_req.read() ) 4700 { 4701 r_dcache_cc_send_req = true; 4702 r_dcache_cc_send_nline = r_dcache_cleanup_victim_nline; 4703 r_dcache_cc_send_way = r_dcache_miss_way; 4704 r_dcache_cc_send_type = CC_TYPE_CLEANUP; 4705 r_dcache_cleanup_victim_req = false; 4706 if (r_dcache_cleanup_will_contains_data.read()) r_dcache_cc_cleanup_updt_data = true; 4707 else r_dcache_cc_cleanup_updt_data = false; 4708 4709 if (r_dcache_cleanup_will_ncc.read()) r_dcache_cleanup_ncc = true; 4710 else r_dcache_cleanup_ncc = false; 4711 } 4712 4591 4713 // coherence clack request (from DSPIN CLACK) 4592 4714 if ( r_dcache_clack_req.read() ) … … 4598 4720 4599 4721 // coherence request (from CC_RECEIVE FSM) 4600 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() )4722 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() and not r_dcache_cleanup_victim_req.read() /*and not r_miss_cleanup_ncc_pending.read()*/) 4601 4723 { 4602 4724 r_dcache_fsm = DCACHE_CC_CHECK; … … 4712 4834 4713 4835 // coherence request (from CC_RECEIVE FSM) 4714 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 4836 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4715 4837 { 4716 4838 r_dcache_fsm = DCACHE_CC_CHECK; … … 4757 4879 4758 4880 // coherence request (from CC_RECEIVE FSM) 4759 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 4881 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4760 4882 { 4761 4883 r_dcache_fsm = DCACHE_CC_CHECK; … … 4811 4933 4812 4934 // coherence request (from CC_RECEIVE FSM) 4813 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 4935 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4814 4936 { 4815 4937 r_dcache_fsm = DCACHE_CC_CHECK; … … 4911 5033 4912 5034 // coherence request (from CC_RECEIVE FSM) 4913 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() 5035 if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read()) 4914 5036 { 4915 5037 r_dcache_fsm = DCACHE_CC_CHECK; … … 5010 5132 } 5011 5133 5012 5134 assert ( not r_dcache_cc_send_req.read() and "CC_SEND must be available in DCACHE_CC_CHECK" ); 5135 5013 5136 // Match between MISS address and CC address 5014 // note: In the same cycle we can handle a CLACK and a MISS match5015 // because the CLACK access the directory but the MISS match dont.5016 5137 if (r_cc_receive_dcache_req.read() and 5017 5138 ((r_dcache_fsm_cc_save == DCACHE_MISS_SELECT ) or … … 5049 5170 #endif 5050 5171 } 5051 5052 5053 assert ( not r_dcache_cc_send_req.read() and "CC_SEND must be available in DCACHE_CC_CHECK");5054 5172 5055 5173 // CC request handler … … 5236 5354 &set, 5237 5355 &word); 5356 5357 /*if (m_proc_id == 1) { std::cout << "rdata CC_INVAL_DATA = " << std::hex << rdata << std::dec << " | at cycle = " << m_cpt_total_cycles << std::endl; } 5358 if (m_proc_id == 1) { r_cc_send_data_fifo.print(); }*/ 5359 5238 5360 if(r_cc_send_data_fifo.wok()) 5239 5361 { 5362 5240 5363 r_dcache_cc_inval_addr = r_dcache_cc_inval_addr.read() + 4; 5241 5364 … … 5258 5381 << " / WAY = " << way 5259 5382 << " / SET = " << set << std::endl; 5383 r_dcache.printTrace(); 5260 5384 } 5261 5385 #endif … … 6005 6129 r_dcache_cc_send_req = false; 6006 6130 r_dcache_cc_cleanup_updt_data = false; 6131 //r_miss_cleanup_ncc_pending = false; 6007 6132 r_cc_send_cpt_word = 0; 6008 6133 r_cc_send_fsm = CC_SEND_IDLE; … … 6095 6220 // flip_flop to check that ? 6096 6221 if (not (r_cc_receive_icache_req.read()) and 6097 not (r_cc_receive_dcache_req.read()) and 6222 not (r_cc_receive_dcache_req.read()) and 6098 6223 (p_dspin_m2p.write.read())) 6099 6224 { … … 6135 6260 uint64_t receive_data = p_dspin_m2p.data.read(); 6136 6261 // for data INVAL, wait for dcache to take the request 6137 if (p_dspin_m2p.write.read() and not r_cc_receive_dcache_req.read()) 6262 if (p_dspin_m2p.write.read() and 6263 not r_cc_receive_dcache_req.read() ) 6138 6264 { 6139 6265 // request dcache to handle the INVAL … … 6153 6279 uint64_t receive_data = p_dspin_m2p.data.read(); 6154 6280 // for ins INVAL, wait for icache to take the request 6155 if (p_dspin_m2p.write.read() and not r_cc_receive_icache_req.read()) 6281 if (p_dspin_m2p.write.read() and 6282 not r_cc_receive_icache_req.read() ) 6156 6283 { 6157 6284 // request icache to handle the INVAL … … 6203 6330 // for data INVAL, wait for dcache to take the request and fifo to 6204 6331 // be empty 6205 if ( r_cc_receive_updt_fifo_be.empty() and 6332 if ( r_cc_receive_updt_fifo_be.empty() and 6206 6333 p_dspin_m2p.write.read() ) 6207 6334 { … … 6223 6350 // for ins INVAL, wait for icache to take the request and fifo to be 6224 6351 // empty 6225 if ( r_cc_receive_updt_fifo_be.empty() and 6352 if ( r_cc_receive_updt_fifo_be.empty() and 6226 6353 p_dspin_m2p.write.read() ) 6227 6354 {
Note: See TracChangeset
for help on using the changeset viewer.