Changeset 439 for trunk/modules
- Timestamp:
- Jul 16, 2013, 6:58:00 PM (11 years ago)
- Location:
- trunk/modules/vci_mem_cache/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r434 r439 90 90 enum tgt_rsp_fsm_state_e 91 91 { 92 TGT_RSP_CONFIG_IDLE, 92 93 TGT_RSP_TGT_CMD_IDLE, 93 94 TGT_RSP_READ_IDLE, … … 97 98 TGT_RSP_MULTI_ACK_IDLE, 98 99 TGT_RSP_CLEANUP_IDLE, 100 TGT_RSP_CONFIG, 99 101 TGT_RSP_TGT_CMD, 100 102 TGT_RSP_READ, … … 118 120 enum cc_send_fsm_state_e 119 121 { 122 CC_SEND_CONFIG_IDLE, 120 123 CC_SEND_XRAM_RSP_IDLE, 121 124 CC_SEND_WRITE_IDLE, 122 125 CC_SEND_CAS_IDLE, 123 126 CC_SEND_CLEANUP_IDLE, 127 CC_SEND_CONFIG_INVAL_HEADER, 128 CC_SEND_CONFIG_INVAL_NLINE, 129 CC_SEND_CONFIG_BRDCAST_HEADER, 130 CC_SEND_CONFIG_BRDCAST_NLINE, 124 131 CC_SEND_CLEANUP_ACK, 125 132 CC_SEND_XRAM_RSP_BRDCAST_HEADER, … … 158 165 CONFIG_DIR_REQ, 159 166 CONFIG_DIR_ACCESS, 160 CONFIG_DIR_INVAL, 161 CONFIG_BC_UPT_LOCK, 167 CONFIG_DIR_UPT_LOCK, 162 168 CONFIG_BC_SEND, 163 169 CONFIG_BC_WAIT, 164 165 CONFIG_UPT_WAIT, 166 167 CONFIG_UPT_LOCK, 168 169 CONFIG_HEAP_REQ 170 CONFIG_INV_SEND, 171 CONFIG_HEAP_REQ, 172 CONFIG_HEAP_SCAN, 173 CONFIG_HEAP_LAST, 174 CONFIG_INV_WAIT 170 175 }; 171 176 … … 345 350 ALLOC_HEAP_CAS, 346 351 ALLOC_HEAP_CLEANUP, 347 ALLOC_HEAP_XRAM_RSP 352 ALLOC_HEAP_XRAM_RSP, 353 ALLOC_HEAP_CONFIG 348 354 }; 349 355 … … 568 574 /////////////////////////////////////////////////////// 569 575 570 sc_signal<int> r_config_fsm; // FSM state 571 sc_signal<bool> r_config_lock; // lock protecting exclusive access 572 sc_signal<int> r_config_cmd; // config request status 573 sc_signal<addr_t> r_config_address; // target buffer physical address 574 sc_signal<size_t> r_config_srcid; // config request srcid 575 sc_signal<size_t> r_config_trdid; // config request trdid 576 sc_signal<size_t> r_config_pktid; // config request pktid 577 sc_signal<size_t> r_config_nlines; // number of lines covering the buffer 578 sc_signal<size_t> r_config_way; // selected way 579 sc_signal<size_t> r_config_count; // number of copies 576 sc_signal<int> r_config_fsm; // FSM state 577 sc_signal<bool> r_config_lock; // lock protecting exclusive access 578 sc_signal<int> r_config_cmd; // config request status 579 sc_signal<addr_t> r_config_address; // target buffer physical address 580 sc_signal<size_t> r_config_srcid; // config request srcid 581 sc_signal<size_t> r_config_trdid; // config request trdid 582 sc_signal<size_t> r_config_pktid; // config request pktid 583 sc_signal<size_t> r_config_nlines; // number of lines covering the buffer 584 sc_signal<size_t> r_config_dir_way; // DIR: selected way 585 sc_signal<size_t> r_config_dir_count; // DIR: number of copies 586 sc_signal<bool> r_config_dir_is_cnt; // DIR: counter mode (broadcast required) 587 sc_signal<size_t> r_config_dir_copy_srcid; // DIR: first copy SRCID 588 sc_signal<bool> r_config_dir_copy_inst; // DIR: first copy L1 type 589 sc_signal<size_t> r_config_dir_next_ptr; // DIR: index of next copy in HEAP 590 sc_signal<size_t> r_config_heap_next; // current pointer to scan HEAP 591 580 592 sc_signal<size_t> r_config_upt_index; // UPT index 581 sc_signal<bool> r_config_is_cnt; // counter mode (broadcast required)582 593 583 594 // Buffer between CONFIG fsm and TGT_RSP fsm (send a done response to L1 cache) … … 591 602 sc_signal<bool> r_config_to_cc_send_multi_req; // multi-inval request 592 603 sc_signal<bool> r_config_to_cc_send_brdcast_req; // broadcast-inval request 593 sc_signal< size_t> r_config_to_cc_send_nline; // line index604 sc_signal<addr_t> r_config_to_cc_send_nline; // line index 594 605 sc_signal<size_t> r_config_to_cc_send_trdid; // UPT index 606 GenericFifo<bool> m_config_to_cc_send_inst_fifo; // fifo for the L1 type 607 GenericFifo<size_t> m_config_to_cc_send_srcid_fifo; // fifo for owners srcid 608 609 #if L1_MULTI_CACHE 610 GenericFifo<size_t> m_config_to_cc_send_cache_id_fifo; // fifo for cache_id 611 #endif 595 612 596 613 /////////////////////////////////////////////////////// -
trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r434 r439 69 69 const char *tgt_rsp_fsm_str[] = 70 70 { 71 "TGT_RSP_CONFIG_IDLE", 71 72 "TGT_RSP_TGT_CMD_IDLE", 72 73 "TGT_RSP_READ_IDLE", … … 76 77 "TGT_RSP_MULTI_ACK_IDLE", 77 78 "TGT_RSP_CLEANUP_IDLE", 79 "TGT_RSP_CONFIG", 78 80 "TGT_RSP_TGT_CMD", 79 81 "TGT_RSP_READ", … … 93 95 const char *cc_send_fsm_str[] = 94 96 { 97 "CC_SEND_CONFIG_IDLE", 95 98 "CC_SEND_XRAM_RSP_IDLE", 96 99 "CC_SEND_WRITE_IDLE", 97 100 "CC_SEND_CAS_IDLE", 98 101 "CC_SEND_CLEANUP_IDLE", 102 "CC_SEND_CONFIG_INVAL_HEADER", 103 "CC_SEND_CONFIG_INVAL_NLINE", 104 "CC_SEND_CONFIG_BRDCAST_HEADER", 105 "CC_SEND_CONFIG_BRDCAST_NLINE", 99 106 "CC_SEND_CLEANUP_ACK", 100 107 "CC_SEND_XRAM_RSP_BRDCAST_HEADER", … … 121 128 "MULTI_ACK_WRITE_RSP", 122 129 "MULTI_ACK_CONFIG_ACK" 130 }; 131 const char *config_fsm_str[] = 132 { 133 "CONFIG_IDLE", 134 "CONFIG_LOOP", 135 "CONFIG_RSP", 136 "CONFIG_DIR_REQ", 137 "CONFIG_DIR_ACCESS", 138 "CONFIG_DIR_UPT_LOCK", 139 "CONFIG_BC_SEND", 140 "CONFIG_BC_WAIT", 141 "CONFIG_INV_SEND", 142 "CONFIG_HEAP_REQ", 143 "CONFIG_HEAP_SCAN", 144 "CONFIG_HEAP_LAST", 145 "CONFIG_INV_WAIT" 123 146 }; 124 147 const char *read_fsm_str[] = … … 274 297 "ALLOC_HEAP_CAS", 275 298 "ALLOC_HEAP_CLEANUP", 276 "ALLOC_HEAP_XRAM_RSP" 299 "ALLOC_HEAP_XRAM_RSP", 300 "ALLOC_HEAP_CONFIG" 277 301 }; 278 302 … … 375 399 m_cc_receive_to_multi_ack_fifo("m_cc_receive_to_multi_ack_fifo", 4), 376 400 377 r_read_fsm("r_read_fsm"), 378 379 r_write_fsm("r_write_fsm"), 401 r_config_fsm( "r_config_fsm" ), 402 403 m_config_to_cc_send_inst_fifo( "m_config_to_cc_send_inst_fifo", 8 ), 404 m_config_to_cc_send_srcid_fifo( "m_config_to_cc_send_srcid_fifo", 8 ), 405 406 r_read_fsm( "r_read_fsm" ), 407 408 r_write_fsm( "r_write_fsm" ), 380 409 381 410 m_write_to_cc_send_inst_fifo("m_write_to_cc_send_inst_fifo",8), … … 563 592 << " | " << write_fsm_str[r_write_fsm.read()] 564 593 << " | " << cas_fsm_str[r_cas_fsm.read()] 594 << " | " << config_fsm_str[r_config_fsm.read()] 565 595 << " | " << cleanup_fsm_str[r_cleanup_fsm.read()] << std::endl; 566 596 std::cout << " " << cc_send_fsm_str[r_cc_send_fsm.read()] … … 686 716 r_config_lock = false; 687 717 718 m_config_to_cc_send_inst_fifo.init(); 719 m_config_to_cc_send_srcid_fifo.init(); 720 #if L1_MULTI_CACHE 721 m_config_to_cc_send_cache_id_fifo.init(); 722 #endif 723 688 724 r_tgt_cmd_to_tgt_rsp_req = false; 689 725 … … 802 838 size_t xram_rsp_to_cc_send_fifo_cache_id = 0; 803 839 #endif 840 841 bool config_to_cc_send_fifo_put = false; 842 bool config_to_cc_send_fifo_get = false; 843 bool config_to_cc_send_fifo_inst = false; 844 size_t config_to_cc_send_fifo_srcid = 0; 804 845 805 846 bool cas_to_cc_send_fifo_put = false; … … 856 897 // acces key, second flit the data to write => WRITE FSM. 857 898 // 858 // The READ/WRITE commands accepted in the configuration segment are targeting ,899 // The READ/WRITE commands accepted in the configuration segment are targeting 859 900 // configuration or status registers. They must contain one single flit. 860 901 // - For almost all addressable registers, the response is returned immediately. … … 873 914 std::cout << " <MEMC " << name() 874 915 << " TGT_CMD_IDLE> Receive command from srcid " 875 << std:: dec<< p_vci_tgt.srcid.read()916 << std::hex << p_vci_tgt.srcid.read() 876 917 << " / address " << std::hex << p_vci_tgt.address.read() << std::endl; 877 918 #endif … … 991 1032 case TGT_CMD_CONFIG: // execute config request and return response 992 1033 { 993 if ( r_tgt_cmd_to_tgt_rsp_req.read() ) break;994 995 1034 addr_t seg_base = m_seg[m_seg_config]->baseAddress(); 996 1035 addr_t address = p_vci_tgt.address.read(); 997 1036 size_t cell = (address - seg_base)/vci_param_int::B; 998 bool need_rsp = true; // default value 999 size_t error = 0; // default value 1000 uint32_t rdata = 0; // default value 1037 1038 bool need_rsp; 1039 size_t error; 1040 uint32_t rdata = 0; // default value 1001 1041 1002 1042 if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_READ) // get lock 1003 1043 and (cell == MEMC_LOCK) ) 1004 1044 { 1005 rdata = (uint32_t)r_config_lock.read(); 1006 r_config_lock = true; 1045 rdata = (uint32_t)r_config_lock.read(); 1046 need_rsp = true; 1047 error = 0; 1048 r_config_lock = true; 1007 1049 } 1008 1050 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // release lock 1009 1051 and (cell == MEMC_LOCK) ) 1010 1052 { 1011 r_config_lock = false; 1053 need_rsp = true; 1054 error = 0; 1055 r_config_lock = false; 1056 } 1057 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set addr_lo 1058 and (cell == MEMC_ADDR_LO) ) 1059 { 1060 need_rsp = true; 1061 error = 0; 1062 r_config_address = (r_config_address.read() & 0xFFFFFFFF00000000LL) | 1063 (addr_t)p_vci_tgt.wdata.read(); 1064 } 1065 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set addr_hi 1066 and (cell == MEMC_ADDR_HI) ) 1067 { 1068 need_rsp = true; 1069 error = 0; 1070 r_config_address = (r_config_address.read() & 0x00000000FFFFFFFFLL) | 1071 ((addr_t)p_vci_tgt.wdata.read())<<32; 1072 } 1073 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set buf_lines 1074 and (cell == MEMC_BUF_LENGTH) ) 1075 { 1076 need_rsp = true; 1077 error = 0; 1078 size_t lines = (size_t)(p_vci_tgt.wdata.read()/(m_words<<2)); 1079 if ( r_config_address.read()/(m_words*vci_param_int::B) ) lines++; 1080 r_config_nlines = lines; 1012 1081 } 1013 1082 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set cmd type 1014 1083 and (cell == MEMC_CMD_TYPE) ) 1015 1084 { 1016 r_config_cmd = p_vci_tgt.wdata.read(); 1017 need_rsp = false; 1018 } 1019 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set addr_lo 1020 and (cell == MEMC_ADDR_LO) ) 1021 { 1022 r_config_address = (r_config_address.read() & 0xFFFFFFFF00000000LL) | 1023 (addr_t)p_vci_tgt.wdata.read(); 1024 } 1025 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set addr_hi 1026 and (cell == MEMC_ADDR_HI) ) 1027 { 1028 r_config_address = (r_config_address.read() & 0x00000000FFFFFFFFLL) | 1029 ((addr_t)p_vci_tgt.wdata.read())<<32; 1030 } 1031 else if ( (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) // set buf_lines 1032 and (cell == MEMC_BUF_LENGTH) ) 1033 { 1034 size_t lines = (size_t)(p_vci_tgt.wdata.read()/(m_words*vci_param_int::B)); 1035 if ( r_config_address.read()/(m_words*vci_param_int::B) ) lines++; 1036 r_config_nlines = lines; 1085 need_rsp = false; 1086 error = 0; 1087 r_config_cmd = p_vci_tgt.wdata.read(); 1088 r_config_srcid = p_vci_tgt.srcid.read(); 1089 r_config_trdid = p_vci_tgt.trdid.read(); 1090 r_config_pktid = p_vci_tgt.pktid.read(); 1037 1091 } 1038 1092 else 1039 1093 { 1040 error = 1; 1094 need_rsp = true; 1095 error = 1; 1041 1096 } 1042 1097 … … 1168 1223 // update the UPT. 1169 1224 // 1170 // It can be update or inval requests initiated by the WRITE or CAS FSM, 1171 // or inval requests initiated by the XRAM_RSP FSM. 1225 // - The FSM decrements the proper entry in UPT, 1226 // and clear the UPT entry when all responses have been received. 1227 // - If required, it sends a request to the TGT_RSP FSM to complete 1228 // a pending write transaction. 1229 // - If required, it sends an acknowledge to the CONFIG FSM to signal 1230 // completion of a line inval. 1172 1231 // 1173 // The FSM decrements the proper entry in UPT. 1174 // It sends a request to the TGT_RSP FSM to complete the pending 1175 // write transaction (acknowledge response to the writer processor), 1176 // and clear the UPT entry when all responses have been received. 1177 // 1178 // All those response packets are one flit packet. 1179 // The index in the Table is defined in the UPDT_TABLE INDEX field, and 1180 // the transaction type is defined in the UPT entry. 1232 // All those multi-ack packets are one flit packet. 1233 // The index in the UPT is defined in the UPDTID field. 1181 1234 //////////////////////////////////////////////////////////////////////// 1182 1235 … … 1225 1278 std::cout << " <MEMC " << name() 1226 1279 << " MULTI_ACK_IDLE> Response for UPT entry " 1227 << updt_index << std::endl;1280 << (size_t)updt_index << std::endl; 1228 1281 } 1229 1282 else … … 1370 1423 // The config inval response is sent only when the last line has been invalidated. 1371 1424 // 1372 // - SYNC request: Not implemented yet 1425 // - SYNC request: 1426 // 1427 // ... Not implemented yet ... 1373 1428 // 1374 1429 // From the software point of view, a configuration request is a sequence … … 1390 1445 { 1391 1446 r_config_fsm = CONFIG_LOOP; 1392 }1393 1447 1394 1448 #if DEBUG_MEMC_CONFIG … … 1399 1453 << " / type = " << r_config_cmd.read() << std::endl; 1400 1454 #endif 1455 } 1401 1456 break; 1402 1457 } … … 1416 1471 #if DEBUG_MEMC_CONFIG 1417 1472 if(m_debug) 1418 std::cout << " <MEMC " << name() << " CONFIG_ SYNC_LOOP>"1473 std::cout << " <MEMC " << name() << " CONFIG_LOOP>" 1419 1474 << " address = " << std::hex << r_config_address.read() 1420 1475 << " / nlines = " << std::dec << r_config_nlines.read() 1421 << " / type= " << r_config_cmd.read() << std::endl;1476 << " / command = " << r_config_cmd.read() << std::endl; 1422 1477 #endif 1423 1478 break; … … 1433 1488 #if DEBUG_MEMC_CONFIG 1434 1489 if(m_debug) 1435 std::cout << " <MEMC " << name() << " CONFIG_ INVAL_DIR_REQ>"1490 std::cout << " <MEMC " << name() << " CONFIG_DIR_REQ>" 1436 1491 << " Request DIR access" << std::endl; 1437 1492 #endif … … 1439 1494 } 1440 1495 /////////////////////// 1441 case CONFIG_DIR_ACCESS: // Access directory and decode c md1496 case CONFIG_DIR_ACCESS: // Access directory and decode config command 1442 1497 { 1443 1498 size_t way = 0; … … 1447 1502 (r_config_cmd.read() == MEMC_CMD_INVAL) ) 1448 1503 { 1449 r_config_way = way; 1450 r_config_is_cnt = entry.is_cnt; 1451 r_config_count = entry.count; 1452 r_config_fsm = CONFIG_DIR_INVAL; 1504 r_config_dir_way = way; 1505 r_config_dir_copy_inst = entry.owner.inst; 1506 r_config_dir_copy_srcid = entry.owner.srcid; 1507 r_config_dir_is_cnt = entry.is_cnt; 1508 r_config_dir_count = entry.count; 1509 r_config_dir_next_ptr = entry.ptr; 1510 1511 r_config_fsm = CONFIG_DIR_UPT_LOCK; 1453 1512 } 1454 1513 else if ( entry.valid and // hit & sync command … … 1460 1519 exit(0); 1461 1520 } 1462 else // nothing to do :return to LOOP1521 else // return to LOOP 1463 1522 { 1464 1523 r_config_nlines = r_config_nlines.read() - 1; 1465 r_config_address = r_config_address.read() + (m_words *vci_param_int::B);1524 r_config_address = r_config_address.read() + (m_words<<2); 1466 1525 r_config_fsm = CONFIG_LOOP; 1467 1526 } … … 1470 1529 if(m_debug) 1471 1530 std::cout << " <MEMC " << name() << " CONFIG_DIR_ACCESS> Accessing directory: " 1472 << " address = " << std::hex << m_cmd_read_addr_fifo.read()1531 << " address = " << std::hex << r_config_address.read() 1473 1532 << " / hit = " << std::dec << entry.valid 1474 << " / dirty = " << std::dec <<entry.dirty1475 << " / count = " << std::dec <<entry.count1533 << " / dirty = " << entry.dirty 1534 << " / count = " << entry.count 1476 1535 << " / is_cnt = " << entry.is_cnt << std::endl; 1477 1536 #endif 1478 1537 break; 1479 1538 } 1480 ////////////////////// 1481 case CONFIG_DIR_INVAL: // Invalidate the directory entry 1482 { 1483 size_t set = m_y[(addr_t)(r_config_address.read())]; 1484 size_t way = r_config_way.read(); 1485 1486 m_cache_directory.inval( way, set ); 1487 1488 if ( r_config_count.read() == 0 ) // return to LOOP 1489 { 1490 r_config_nlines = r_config_nlines.read() - 1; 1491 r_config_address = r_config_address.read() + (m_words*vci_param_int::B); 1492 r_config_fsm = CONFIG_LOOP; 1493 } 1494 else if ( r_config_is_cnt.read() ) // broacast required 1495 { 1496 r_config_fsm = CONFIG_BC_UPT_LOCK; 1497 } 1498 else 1499 { 1500 r_config_fsm = CONFIG_UPT_LOCK; 1501 } 1502 1503 #if DEBUG_MEMC_CONFIG 1504 if(m_debug) 1505 std::cout << " <MEMC " << name() << " CONFIG_DIR_INVAL> Inval directory entry" << std::endl; 1506 #endif 1507 break; 1508 } 1509 //////////////////////// 1510 case CONFIG_BC_UPT_LOCK: // try to register BC transaction in UPT 1539 ///////////////////////// 1540 case CONFIG_DIR_UPT_LOCK: // enter this state in case of INVAL command 1541 // Try to get both DIR & UPT locks, and return 1542 // to LOOP state if UPT full. 1543 // Register inval in UPT, and invalidate the 1544 // directory if UPT not full. 1511 1545 { 1512 1546 if ( r_alloc_upt_fsm.read() == ALLOC_UPT_CONFIG ) 1513 1547 { 1514 bool wok = false; 1515 size_t index = 0; 1516 size_t srcid = r_config_srcid.read(); 1517 size_t trdid = r_config_trdid.read(); 1518 size_t pktid = r_config_pktid.read(); 1519 addr_t nline = m_nline[(addr_t)(r_config_address.read())]; 1520 size_t nb_copies = r_config_count.read(); 1521 1522 wok = m_upt.set(false, // it's an inval transaction 1523 true, // it's a broadcast 1524 false, // no response required 1525 true, // acknowledge required 1526 srcid, 1527 trdid, 1528 pktid, 1529 nline, 1530 nb_copies, 1531 index); 1532 if ( wok ) 1548 size_t set = m_y[(addr_t)(r_config_address.read())]; 1549 size_t way = r_config_dir_way.read(); 1550 1551 if ( r_config_dir_count.read() == 0 ) // inval DIR and return to LOOP 1533 1552 { 1534 r_config_fsm = CONFIG_BC_SEND; 1535 r_config_upt_index = index; 1553 m_cache_directory.inval( way, set ); 1554 r_config_nlines = r_config_nlines.read() - 1; 1555 r_config_address = r_config_address.read() + (m_words<<2); 1556 r_config_fsm = CONFIG_LOOP; 1536 1557 1537 1558 #if DEBUG_MEMC_CONFIG 1538 if( m_debug)1539 std::cout << " <MEMC " << name() 1540 << " CONFIG_BC_UPT_LOCK> Register broadcast inval in UPT"<< std::endl;1559 if(m_debug) 1560 std::cout << " <MEMC " << name() << " CONFIG_DIR_UPT_LOCK>" 1561 << " No copies in L1 : inval DIR entry" << std::endl; 1541 1562 #endif 1542 1563 } 1543 else 1564 else // try to register inval in UPT 1544 1565 { 1545 r_config_fsm = CONFIG_UPT_WAIT; 1546 1566 bool wok = false; 1567 size_t index = 0; 1568 bool broadcast = r_config_dir_is_cnt.read(); 1569 size_t srcid = r_config_srcid.read(); 1570 size_t trdid = r_config_trdid.read(); 1571 size_t pktid = r_config_pktid.read(); 1572 addr_t nline = m_nline[(addr_t)(r_config_address.read())]; 1573 size_t nb_copies = r_config_dir_count.read(); 1574 1575 wok = m_upt.set(false, // it's an inval transaction 1576 broadcast, 1577 false, // no response required 1578 true, // acknowledge required 1579 srcid, 1580 trdid, 1581 pktid, 1582 nline, 1583 nb_copies, 1584 index); 1585 if ( wok ) // UPT success => inval DIR slot 1586 { 1587 m_cache_directory.inval( way, set ); 1588 r_config_upt_index = index; 1589 if ( broadcast ) r_config_fsm = CONFIG_BC_SEND; 1590 else r_config_fsm = CONFIG_INV_SEND; 1591 1547 1592 #if DEBUG_MEMC_CONFIG 1548 if( m_debug ) 1549 std::cout << " <MEMC " << name() << " CONFIG_BC_UPT_LOCK>" 1550 << " UPT full" << std::endl; 1551 #endif 1593 if(m_debug) 1594 std::cout << " <MEMC " << name() << " CONFIG_DIR_UPT_LOCK>" 1595 << " Inval DIR entry and register inval in UPT" 1596 << " : index = " << std::dec << index 1597 << " / broadcast = " << broadcast << std::endl; 1598 #endif 1599 } 1600 else // UPT full => release both DIR and UPT locks 1601 { 1602 r_config_fsm = CONFIG_LOOP; 1603 1604 #if DEBUG_MEMC_CONFIG 1605 if(m_debug) 1606 std::cout << " <MEMC " << name() << " CONFIG_DIR_UPT_LOCK>" 1607 << " UPT full : release DIR & UPT locks and retry" << std::endl; 1608 #endif 1609 } 1552 1610 } 1553 1611 } … … 1564 1622 r_config_to_cc_send_trdid = r_config_upt_index.read(); 1565 1623 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 1566 1567 1624 r_cleanup_to_config_ack = false; 1568 1569 1625 r_config_fsm = CONFIG_BC_WAIT; 1570 1626 … … 1581 1637 case CONFIG_BC_WAIT: // wait broadcast completion to return to LOOP 1582 1638 { 1583 if ( r_cleanup_to_config_ack.read() ) r_config_fsm = CONFIG_LOOP; 1639 if ( r_cleanup_to_config_ack.read() ) 1640 { 1641 r_config_fsm = CONFIG_LOOP; 1642 r_config_nlines = r_config_nlines.read() - 1; 1643 r_config_address = r_config_address.read() + (m_words<<2); 1644 } 1584 1645 1585 1646 #if DEBUG_MEMC_CONFIG 1586 1647 if(m_debug) 1587 std::cout << " <MEMC " << name() << " CONFIG_BC_WAIT>" 1588 << " Waiting broadcast inval completion" << std::endl; 1648 std::cout << " <MEMC " << name() << " CONFIG_BC_WAIT> Waiting BC completion " 1649 << " done = " << r_cleanup_to_config_ack.read() 1650 << std::endl; 1589 1651 #endif 1590 1652 break; 1591 1653 } 1592 1654 ///////////////////// 1593 case CONFIG_UPT_LOCK: // Try to register multi-update in UPT 1594 { 1595 if ( r_alloc_upt_fsm.read() == ALLOC_UPT_CONFIG ) 1655 case CONFIG_INV_SEND: // Post a multi inval request to CC_SEND FSM 1656 { 1657 if( not r_config_to_cc_send_multi_req.read() and 1658 not r_config_to_cc_send_brdcast_req.read() ) 1596 1659 { 1597 bool wok = false; 1598 size_t index = 0; 1599 size_t srcid = r_config_srcid.read(); 1600 size_t trdid = r_config_trdid.read(); 1601 size_t pktid = r_config_pktid.read(); 1602 addr_t nline = m_nline[(addr_t)(r_config_address.read())]; 1603 size_t nb_copies = r_config_count.read(); 1604 1605 wok = m_upt.set(false, // it's an inval transaction 1606 false, // not a broadcast 1607 false, // no response required 1608 true, // acknowledge required 1609 srcid, 1610 trdid, 1611 pktid, 1612 nline, 1613 nb_copies, 1614 index); 1615 if ( wok ) 1616 { 1617 r_config_fsm = CONFIG_BC_SEND; 1618 r_config_upt_index = index; 1660 r_config_to_cc_send_multi_req = true; 1661 r_config_to_cc_send_brdcast_req = false; 1662 r_config_to_cc_send_trdid = r_config_upt_index.read(); 1663 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 1664 r_multi_ack_to_config_ack = false; 1665 1666 config_to_cc_send_fifo_srcid = r_config_dir_copy_srcid.read(); 1667 config_to_cc_send_fifo_inst = r_config_dir_copy_inst.read(); 1668 config_to_cc_send_fifo_put = true; 1669 1670 if ( r_config_dir_count.read() == 1 ) r_config_fsm = CONFIG_INV_WAIT; 1671 else r_config_fsm = CONFIG_HEAP_REQ; 1619 1672 1620 1673 #if DEBUG_MEMC_CONFIG 1621 if( m_debug ) 1622 std::cout << " <MEMC " << name() 1623 << " CONFIG_BC_UPT_LOCK> Register broadcast inval in UPT" << std::endl; 1624 #endif 1625 } 1626 else 1627 { 1628 r_config_fsm = CONFIG_UPT_WAIT; 1674 if(m_debug) 1675 std::cout << " <MEMC " << name() << " CONFIG_INV_SEND>" 1676 << " Post multi inval request to CC_SEND FSM" 1677 << " / address = " << std::hex << r_config_address.read() 1678 << " / copy = " << r_config_dir_copy_srcid.read() 1679 << " / inst = " << std::dec << r_config_dir_copy_inst.read() << std::endl; 1680 #endif 1681 } 1682 break; 1683 } 1684 ///////////////////// 1685 case CONFIG_HEAP_REQ: // Try to get access to Heap 1686 { 1687 if ( r_alloc_heap_fsm.read() == ALLOC_HEAP_CONFIG ) 1688 { 1689 r_config_fsm = CONFIG_HEAP_SCAN; 1690 r_config_heap_next = r_config_dir_next_ptr.read(); 1691 } 1692 1693 #if DEBUG_MEMC_CONFIG 1694 if(m_debug) 1695 std::cout << " <MEMC " << name() << " CONFIG_HEAP_REQ>" 1696 << " Requesting HEAP lock" << std::endl; 1697 #endif 1698 break; 1699 } 1700 ////////////////////// 1701 case CONFIG_HEAP_SCAN: // scan HEAP and send inval to CC_SEND FSM 1702 { 1703 HeapEntry entry = m_heap.read( r_config_heap_next.read() ); 1704 bool last_copy = (entry.next == r_config_heap_next.read()); 1705 1706 config_to_cc_send_fifo_srcid = entry.owner.srcid; 1707 config_to_cc_send_fifo_inst = entry.owner.inst; 1708 // config_to_cc_send_fifo_last = last_copy; 1709 config_to_cc_send_fifo_put = true; 1710 1711 if ( m_config_to_cc_send_inst_fifo.wok() ) // inval request accepted 1712 { 1713 r_config_heap_next = entry.next; 1714 if ( last_copy ) r_config_fsm = CONFIG_HEAP_LAST; 1715 } 1629 1716 1630 1717 #if DEBUG_MEMC_CONFIG 1631 if( m_debug ) 1632 std::cout << " <MEMC " << name() << " CONFIG_BC_UPT_LOCK>" 1633 << " UPT full" << std::endl; 1634 #endif 1635 } 1718 if(m_debug) 1719 std::cout << " <MEMC " << name() << " CONFIG_HEAP_SCAN>" 1720 << " Post multi inval request to CC_SEND FSM" 1721 << " / address = " << std::hex << r_config_address.read() 1722 << " / copy = " << entry.owner.srcid 1723 << " / inst = " << std::dec << entry.owner.inst << std::endl; 1724 #endif 1725 break; 1726 } 1727 ////////////////////// 1728 case CONFIG_HEAP_LAST: // HEAP housekeeping 1729 { 1730 size_t free_pointer = m_heap.next_free_ptr(); 1731 HeapEntry last_entry; 1732 last_entry.owner.srcid = 0; 1733 last_entry.owner.inst = false; 1734 1735 if ( m_heap.is_full() ) 1736 { 1737 last_entry.next = r_config_dir_next_ptr.read(); 1738 m_heap.unset_full(); 1739 } 1740 else 1741 { 1742 last_entry.next = free_pointer; 1743 } 1744 1745 m_heap.write_free_ptr( r_config_dir_next_ptr.read() ); 1746 m_heap.write( r_config_heap_next.read(), last_entry ); 1747 r_config_fsm = CONFIG_INV_WAIT; 1636 1748 1637 1749 #if DEBUG_MEMC_CONFIG 1638 1750 if(m_debug) 1639 std::cout << " <MEMC " << name() << " CONFIG_UPT_LOCK> Request access to UPT" << std::endl; 1640 #endif 1751 std::cout << " <MEMC " << name() << " CONFIG_HEAP_LAST>" 1752 << " Heap housekeeping" << std::endl; 1753 #endif 1754 break; 1755 } 1756 ///////////////////// 1757 case CONFIG_INV_WAIT: // wait inval completion to return to LOOP 1758 { 1759 if ( r_multi_ack_to_config_ack.read() ) 1760 { 1761 r_config_fsm = CONFIG_LOOP; 1762 r_config_nlines = r_config_nlines.read() - 1; 1763 r_config_address = r_config_address.read() + (m_words<<2); 1641 1764 } 1642 break; 1643 } 1644 ///////////////////// 1645 case CONFIG_HEAP_REQ: // request access to the heap 1646 { 1647 break; 1765 1766 #if DEBUG_MEMC_CONFIG 1767 if(m_debug) 1768 std::cout << " <MEMC " << name() << " CONFIG_INV_WAIT> Waiting inval completion " 1769 << " done = " << r_multi_ack_to_config_ack.read() 1770 << std::endl; 1771 #endif 1772 break; 1648 1773 } 1649 1774 … … 1651 1776 case CONFIG_RSP: // request TGT_RSP FSM to return response 1652 1777 { 1653 if ( not r_config_to_tgt_rsp_req )1778 if ( not r_config_to_tgt_rsp_req.read() ) 1654 1779 { 1655 1780 r_config_to_tgt_rsp_srcid = r_config_srcid.read(); … … 1664 1789 std::cout << " <MEMC " << name() << " CONFIG_RSP> Request TGT_RSP FSM to return response:" 1665 1790 << " error = " << r_config_to_tgt_rsp_error.read() 1666 << " / rsrcid = " << std::hex << m_cmd_read_srcid_fifo.read() << std::endl;1791 << " / rsrcid = " << std::hex << r_config_srcid.read() << std::endl; 1667 1792 #endif 1668 1793 } 1669 1794 break; 1670 1795 1671 }1672 /////////////////////1673 case CONFIG_UPT_WAIT: // release the lock on UPT for one cycle, and retry1674 {1675 if ( r_config_is_cnt.read() ) r_config_fsm = CONFIG_BC_UPT_LOCK;1676 else r_config_fsm = CONFIG_UPT_LOCK;1677 1678 #if DEBUG_MEMC_CONFIG1679 if(m_debug)1680 std::cout << " <MEMC " << name() << " CONFIG_UPT_WAIT>"1681 << " Release UPT lock" << std::endl;1682 #endif1683 break;1684 1796 } 1685 1797 } // end switch r_config_fsm … … 5729 5841 // the CLEANUP fsm. 5730 5842 // 5731 // It implements a round-robin priority between the four possible client FSMs 5732 // XRAM_RSP, WRITE, CAS and CLEANUP. Each FSM can request the next services: 5843 // It implements a round-robin priority between the five possible client FSMs 5844 // XRAM_RSP > CAS > CLEANUP > WRITE > CONFIG 5845 // 5846 // Each FSM can request the next services: 5733 5847 // - r_xram_rsp_to_cc_send_multi_req : multi-inval 5734 5848 // r_xram_rsp_to_cc_send_brdcast_req : broadcast-inval … … 5737 5851 // - r_cas_to_cc_send_multi_req : multi-update 5738 5852 // r_cas_to_cc_send_brdcast_req : broadcast-inval 5853 // - r_config_to_cc_send_multi_req : multi-inval 5854 // r_config_to_cc_send_brdcast_req : broadcast-inval 5855 // 5739 5856 // - r_cleanup_to_cc_send_req : cleanup acknowledgement 5740 5857 // … … 5750 5867 switch(r_cc_send_fsm.read()) 5751 5868 { 5752 case CC_SEND_WRITE_IDLE: 5753 { 5754 // XRAM_RSP FSM has highest priority 5869 ///////////////////////// 5870 case CC_SEND_CONFIG_IDLE: // XRAM_RSP FSM has highest priority 5871 { 5872 // XRAM_RSP 5755 5873 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or 5756 5874 r_xram_rsp_to_cc_send_multi_req.read()) … … 5760 5878 break; 5761 5879 } 5762 5763 5880 if(r_xram_rsp_to_cc_send_brdcast_req.read()) 5764 5881 { … … 5767 5884 break; 5768 5885 } 5769 5886 // CAS 5770 5887 if(m_cas_to_cc_send_inst_fifo.rok() or 5771 5888 r_cas_to_cc_send_multi_req.read()) … … 5775 5892 break; 5776 5893 } 5777 5778 5894 if(r_cas_to_cc_send_brdcast_req.read()) 5779 5895 { … … 5782 5898 break; 5783 5899 } 5784 5900 // CLEANUP 5785 5901 if (r_cleanup_to_cc_send_req.read()) 5786 5902 { … … 5788 5904 break; 5789 5905 } 5790 5906 // WRITE 5791 5907 if(m_write_to_cc_send_inst_fifo.rok() or 5792 5908 r_write_to_cc_send_multi_req.read()) … … 5796 5912 break; 5797 5913 } 5798 5799 5914 if(r_write_to_cc_send_brdcast_req.read()) 5800 5915 { 5801 5916 r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_HEADER; 5802 5917 m_cpt_inval++; 5918 break; 5919 } 5920 // CONFIG 5921 if(r_config_to_cc_send_multi_req.read()) 5922 { 5923 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER; 5924 m_cpt_inval++; 5925 break; 5926 } 5927 if(r_config_to_cc_send_brdcast_req.read()) 5928 { 5929 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER; 5930 m_cpt_inval++; 5931 break; 5803 5932 } 5804 5933 break; 5805 5934 } 5806 5807 case CC_SEND_XRAM_RSP_IDLE: 5808 { 5809 // CAS FSM has highest priority 5935 //////////////////////// 5936 case CC_SEND_WRITE_IDLE: // CONFIG FSM has highest priority 5937 { 5938 // CONFIG 5939 if(r_config_to_cc_send_multi_req.read()) 5940 { 5941 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER; 5942 m_cpt_inval++; 5943 break; 5944 } 5945 if(r_config_to_cc_send_brdcast_req.read()) 5946 { 5947 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER; 5948 m_cpt_inval++; 5949 break; 5950 } 5951 // XRAM_RSP 5952 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or 5953 r_xram_rsp_to_cc_send_multi_req.read()) 5954 { 5955 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_HEADER; 5956 m_cpt_inval++; 5957 break; 5958 } 5959 if(r_xram_rsp_to_cc_send_brdcast_req.read()) 5960 { 5961 r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_HEADER; 5962 m_cpt_inval++; 5963 break; 5964 } 5965 // CAS 5810 5966 if(m_cas_to_cc_send_inst_fifo.rok() or 5811 5967 r_cas_to_cc_send_multi_req.read()) … … 5815 5971 break; 5816 5972 } 5817 5818 5973 if(r_cas_to_cc_send_brdcast_req.read()) 5819 5974 { … … 5822 5977 break; 5823 5978 } 5824 5825 if (r_cleanup_to_cc_send_req.read())5979 // CLEANUP 5980 if (r_cleanup_to_cc_send_req.read()) 5826 5981 { 5827 5982 r_cc_send_fsm = CC_SEND_CLEANUP_ACK; 5828 5983 break; 5829 5984 } 5830 5985 // WRITE 5831 5986 if(m_write_to_cc_send_inst_fifo.rok() or 5832 5987 r_write_to_cc_send_multi_req.read()) … … 5836 5991 break; 5837 5992 } 5838 5839 5993 if(r_write_to_cc_send_brdcast_req.read()) 5840 5994 { … … 5843 5997 break; 5844 5998 } 5845 5999 break; 6000 } 6001 /////////////////////////// 6002 case CC_SEND_XRAM_RSP_IDLE: // CAS FSM has highest priority 6003 { 6004 // CAS 6005 if(m_cas_to_cc_send_inst_fifo.rok() or 6006 r_cas_to_cc_send_multi_req.read()) 6007 { 6008 r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER; 6009 m_cpt_update++; 6010 break; 6011 } 6012 if(r_cas_to_cc_send_brdcast_req.read()) 6013 { 6014 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER; 6015 m_cpt_inval++; 6016 break; 6017 } 6018 // CLEANUP 6019 if(r_cleanup_to_cc_send_req.read()) 6020 { 6021 r_cc_send_fsm = CC_SEND_CLEANUP_ACK; 6022 break; 6023 } 6024 // WRITE 6025 if(m_write_to_cc_send_inst_fifo.rok() or 6026 r_write_to_cc_send_multi_req.read()) 6027 { 6028 r_cc_send_fsm = CC_SEND_WRITE_UPDT_HEADER; 6029 m_cpt_update++; 6030 break; 6031 } 6032 6033 if(r_write_to_cc_send_brdcast_req.read()) 6034 { 6035 r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_HEADER; 6036 m_cpt_inval++; 6037 break; 6038 } 6039 // CONFIG 6040 if(r_config_to_cc_send_multi_req.read()) 6041 { 6042 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER; 6043 m_cpt_inval++; 6044 break; 6045 } 6046 if(r_config_to_cc_send_brdcast_req.read()) 6047 { 6048 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER; 6049 m_cpt_inval++; 6050 break; 6051 } 6052 // XRAM_RSP 5846 6053 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or 5847 6054 r_xram_rsp_to_cc_send_multi_req.read()) … … 5851 6058 break; 5852 6059 } 5853 5854 6060 if(r_xram_rsp_to_cc_send_brdcast_req.read()) 5855 6061 { 5856 6062 r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_HEADER; 5857 6063 m_cpt_inval++; 5858 }5859 6064 break; 6065 } 5860 6066 break; 5861 6067 } 5862 5863 case CC_SEND_CAS_IDLE: 5864 { 5865 // CLEANUP FSM has highest priority 6068 ////////////////////// 6069 case CC_SEND_CAS_IDLE: // CLEANUP FSM has highest priority 6070 { 5866 6071 if(r_cleanup_to_cc_send_req.read()) 5867 6072 { … … 5869 6074 break; 5870 6075 } 5871 5872 6076 if(m_write_to_cc_send_inst_fifo.rok() or 5873 6077 r_write_to_cc_send_multi_req.read()) … … 5877 6081 break; 5878 6082 } 5879 5880 6083 if(r_write_to_cc_send_brdcast_req.read()) 5881 6084 { … … 5884 6087 break; 5885 6088 } 5886 6089 // CONFIG 6090 if(r_config_to_cc_send_multi_req.read()) 6091 { 6092 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER; 6093 m_cpt_inval++; 6094 break; 6095 } 6096 if(r_config_to_cc_send_brdcast_req.read()) 6097 { 6098 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER; 6099 m_cpt_inval++; 6100 break; 6101 } 5887 6102 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or 5888 6103 r_xram_rsp_to_cc_send_multi_req.read()) … … 5892 6107 break; 5893 6108 } 5894 5895 6109 if(r_xram_rsp_to_cc_send_brdcast_req.read()) 5896 6110 { … … 5899 6113 break; 5900 6114 } 5901 5902 6115 if(m_cas_to_cc_send_inst_fifo.rok() or 5903 6116 r_cas_to_cc_send_multi_req.read()) … … 5907 6120 break; 5908 6121 } 5909 5910 6122 if(r_cas_to_cc_send_brdcast_req.read()) 5911 6123 { 5912 6124 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_HEADER; 5913 6125 m_cpt_inval++; 6126 break; 5914 6127 } 5915 6128 break; 5916 6129 } 5917 5918 case CC_SEND_CLEANUP_IDLE:5919 { 5920 // WRITE FSM has highest priority6130 ////////////////////////// 6131 case CC_SEND_CLEANUP_IDLE: // WRITE FSM has highest priority 6132 { 6133 // WRITE 5921 6134 if(m_write_to_cc_send_inst_fifo.rok() or 5922 6135 r_write_to_cc_send_multi_req.read()) … … 5926 6139 break; 5927 6140 } 5928 5929 6141 if(r_write_to_cc_send_brdcast_req.read()) 5930 6142 { … … 5933 6145 break; 5934 6146 } 5935 6147 // CONFIG 6148 if(r_config_to_cc_send_multi_req.read()) 6149 { 6150 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER; 6151 m_cpt_inval++; 6152 break; 6153 } 6154 if(r_config_to_cc_send_brdcast_req.read()) 6155 { 6156 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_HEADER; 6157 m_cpt_inval++; 6158 break; 6159 } 6160 // XRAM_RSP 5936 6161 if(m_xram_rsp_to_cc_send_inst_fifo.rok() or 5937 6162 r_xram_rsp_to_cc_send_multi_req.read()) … … 5941 6166 break; 5942 6167 } 5943 5944 6168 if(r_xram_rsp_to_cc_send_brdcast_req.read()) 5945 6169 { … … 5948 6172 break; 5949 6173 } 5950 6174 // CAS 5951 6175 if(m_cas_to_cc_send_inst_fifo.rok() or 5952 6176 r_cas_to_cc_send_multi_req.read()) … … 5956 6180 break; 5957 6181 } 5958 5959 6182 if(r_cas_to_cc_send_brdcast_req.read()) 5960 6183 { … … 5963 6186 break; 5964 6187 } 5965 6188 // CLEANUP 5966 6189 if(r_cleanup_to_cc_send_req.read()) 5967 6190 { 5968 6191 r_cc_send_fsm = CC_SEND_CLEANUP_ACK; 5969 }5970 6192 break; 6193 } 5971 6194 break; 5972 6195 } 5973 5974 case CC_SEND_CLEANUP_ACK: 5975 { 5976 // send only flit for a cleanup acknowledgement (from CLEANUP FSM) 6196 ///////////////////////////////// 6197 case CC_SEND_CONFIG_INVAL_HEADER: // send first flit multi-inval (from CONFIG FSM) 6198 { 6199 if(m_config_to_cc_send_inst_fifo.rok()) 6200 { 6201 if(not p_dspin_out.read) break; 6202 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_NLINE; 6203 break; 6204 } 6205 if(r_config_to_cc_send_multi_req.read()) r_config_to_cc_send_multi_req = false; 6206 r_cc_send_fsm = CC_SEND_CONFIG_IDLE; 6207 break; 6208 } 6209 //////////////////////////////// 6210 case CC_SEND_CONFIG_INVAL_NLINE: // send second flit multi-inval (from CONFIG FSM) 6211 { 6212 if(not p_dspin_out.read) break; 6213 m_cpt_inval_mult++; 6214 config_to_cc_send_fifo_get = true; 6215 r_cc_send_fsm = CC_SEND_CONFIG_INVAL_HEADER; 6216 6217 #if DEBUG_MEMC_CC_SEND 6218 if(m_debug) 6219 std::cout << " <MEMC " << name() 6220 << " CC_SEND_CONFIG_INVAL_NLINE> multi-inval for line " 6221 << std::hex << r_config_to_cc_send_nline.read() << std::endl; 6222 #endif 6223 break; 6224 } 6225 /////////////////////////////////// 6226 case CC_SEND_CONFIG_BRDCAST_HEADER: // send first flit BC-inval (from CONFIG FSM) 6227 { 6228 if(not p_dspin_out.read) break; 6229 r_cc_send_fsm = CC_SEND_CONFIG_BRDCAST_NLINE; 6230 break; 6231 } 6232 ////////////////////////////////// 6233 case CC_SEND_CONFIG_BRDCAST_NLINE: // send second flit BC-inval (from CONFIG FSM) 6234 { 6235 if(not p_dspin_out.read) break; 6236 m_cpt_inval_brdcast++; 6237 r_config_to_cc_send_brdcast_req = false; 6238 r_cc_send_fsm = CC_SEND_CONFIG_IDLE; 6239 6240 #if DEBUG_MEMC_CC_SEND 6241 if(m_debug) 6242 std::cout << " <MEMC " << name() 6243 << " CC_SEND_CONFIG_BRDCAST_NLINE> BC-Inval for line " 6244 << std::hex << r_config_to_cc_send_nline.read() << std::endl; 6245 #endif 6246 break; 6247 } 6248 ///////////////////////// 6249 case CC_SEND_CLEANUP_ACK: // send one flit for a cleanup acknowledgement 6250 { 5977 6251 if(not p_dspin_out.read) break; 5978 6252 … … 5988 6262 break; 5989 6263 } 5990 5991 case CC_SEND_XRAM_RSP_INVAL_HEADER: 5992 { 5993 // send first flit multi-inval (from XRAM_RSP FSM) 6264 /////////////////////////////////// 6265 case CC_SEND_XRAM_RSP_INVAL_HEADER: // send first flit multi-inval (from XRAM_RSP FSM) 6266 { 5994 6267 if(m_xram_rsp_to_cc_send_inst_fifo.rok()) 5995 6268 { 5996 6269 if(not p_dspin_out.read) break; 5997 5998 6270 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_NLINE; 5999 6271 break; 6000 6272 } 6001 6002 if(r_xram_rsp_to_cc_send_multi_req.read()) 6003 { 6004 r_xram_rsp_to_cc_send_multi_req = false; 6005 } 6006 6273 if(r_xram_rsp_to_cc_send_multi_req.read()) r_xram_rsp_to_cc_send_multi_req = false; 6007 6274 r_cc_send_fsm = CC_SEND_XRAM_RSP_IDLE; 6008 6275 break; 6009 6276 } 6010 6011 case CC_SEND_XRAM_RSP_INVAL_NLINE: 6012 { 6013 // send second flit multi-inval (from XRAM_RSP FSM) 6277 ////////////////////////////////// 6278 case CC_SEND_XRAM_RSP_INVAL_NLINE: // send second flit multi-inval (from XRAM_RSP FSM) 6279 { 6014 6280 if(not p_dspin_out.read) break; 6015 6016 6281 m_cpt_inval_mult++; 6017 6018 6282 xram_rsp_to_cc_send_fifo_get = true; 6019 r_cc_send_fsm 6283 r_cc_send_fsm = CC_SEND_XRAM_RSP_INVAL_HEADER; 6020 6284 6021 6285 #if DEBUG_MEMC_CC_SEND … … 6027 6291 break; 6028 6292 } 6029 6030 case CC_SEND_XRAM_RSP_BRDCAST_HEADER: 6031 { 6032 // send first flit broadcast-inval (from XRAM_RSP FSM) 6293 ///////////////////////////////////// 6294 case CC_SEND_XRAM_RSP_BRDCAST_HEADER: // send first flit broadcast-inval (from XRAM_RSP FSM) 6295 { 6033 6296 if(not p_dspin_out.read) break; 6034 6035 6297 r_cc_send_fsm = CC_SEND_XRAM_RSP_BRDCAST_NLINE; 6036 6298 break; 6037 6299 } 6038 6039 case CC_SEND_XRAM_RSP_BRDCAST_NLINE: 6040 { 6041 // send second flit broadcast-inval (from XRAM_RSP FSM) 6300 //////////////////////////////////// 6301 case CC_SEND_XRAM_RSP_BRDCAST_NLINE: // send second flit broadcast-inval (from XRAM_RSP FSM) 6302 { 6042 6303 if(not p_dspin_out.read) break; 6043 6044 6304 m_cpt_inval_brdcast++; 6045 6046 6305 r_xram_rsp_to_cc_send_brdcast_req = false; 6047 6306 r_cc_send_fsm = CC_SEND_XRAM_RSP_IDLE; … … 6055 6314 break; 6056 6315 } 6057 6058 case CC_SEND_WRITE_BRDCAST_HEADER: 6059 { 6060 // send first flit broadcast-inval (from WRITE FSM) 6316 ////////////////////////////////// 6317 case CC_SEND_WRITE_BRDCAST_HEADER: // send first flit broadcast-inval (from WRITE FSM) 6318 { 6061 6319 if(not p_dspin_out.read) break; 6062 6063 6320 r_cc_send_fsm = CC_SEND_WRITE_BRDCAST_NLINE; 6064 6321 break; 6065 6322 } 6066 6067 case CC_SEND_WRITE_BRDCAST_NLINE: 6068 { 6069 // send second flit broadcast-inval (from WRITE FSM) 6323 ///////////////////////////////// 6324 case CC_SEND_WRITE_BRDCAST_NLINE: // send second flit broadcast-inval (from WRITE FSM) 6325 { 6070 6326 if(not p_dspin_out.read) break; 6071 6327 … … 6083 6339 break; 6084 6340 } 6085 6086 case CC_SEND_WRITE_UPDT_HEADER: 6087 { 6088 // send first flit for a multi-update (from WRITE FSM) 6341 /////////////////////////////// 6342 case CC_SEND_WRITE_UPDT_HEADER: // send first flit for a multi-update (from WRITE FSM) 6343 { 6089 6344 if(m_write_to_cc_send_inst_fifo.rok()) 6090 6345 { … … 6103 6358 break; 6104 6359 } 6105 6106 case CC_SEND_WRITE_UPDT_NLINE: 6107 { 6108 // send second flit for a multi-update (from WRITE FSM) 6360 ////////////////////////////// 6361 case CC_SEND_WRITE_UPDT_NLINE: // send second flit for a multi-update (from WRITE FSM) 6362 { 6109 6363 if(not p_dspin_out.read) break; 6110 6111 6364 m_cpt_update_mult++; 6112 6365 … … 6115 6368 6116 6369 #if DEBUG_MEMC_CC_SEND 6117 if(m_debug) 6118 { 6119 std::cout 6120 << " <MEMC " << name() 6121 << " CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line " 6122 << r_write_to_cc_send_nline.read() 6123 << std::endl; 6124 } 6370 if(m_debug) 6371 std::cout << " <MEMC " << name() 6372 << " CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line " 6373 << r_write_to_cc_send_nline.read() << std::endl; 6125 6374 #endif 6126 6375 break; 6127 6376 } 6128 6129 case CC_SEND_WRITE_UPDT_DATA: 6130 { 6131 // send N data flits for a multi-update (from WRITE FSM) 6377 ///////////////////////////// 6378 case CC_SEND_WRITE_UPDT_DATA: // send N data flits for a multi-update (from WRITE FSM) 6379 { 6132 6380 if(not p_dspin_out.read) break; 6133 6134 6381 if(r_cc_send_cpt.read() == (r_write_to_cc_send_count.read()-1)) 6135 6382 { … … 6142 6389 break; 6143 6390 } 6144 6145 case CC_SEND_CAS_BRDCAST_HEADER: 6146 { 6147 // send first flit for a broadcast-inval (from CAS FSM) 6391 //////////////////////////////// 6392 case CC_SEND_CAS_BRDCAST_HEADER: // send first flit broadcast-inval (from CAS FSM) 6393 { 6148 6394 if(not p_dspin_out.read) break; 6149 6150 6395 r_cc_send_fsm = CC_SEND_CAS_BRDCAST_NLINE; 6151 6396 break; 6152 6397 } 6153 6154 case CC_SEND_CAS_BRDCAST_NLINE: 6155 { 6156 // send second flit broadcast-inval (from CAS FSM) 6398 /////////////////////////////// 6399 case CC_SEND_CAS_BRDCAST_NLINE: // send second flit broadcast-inval (from CAS FSM) 6400 { 6157 6401 if(not p_dspin_out.read) break; 6158 6159 6402 m_cpt_inval_brdcast++; 6160 6403 … … 6163 6406 6164 6407 #if DEBUG_MEMC_CC_SEND 6165 if(m_debug) 6166 { 6167 std::cout 6168 << " <MEMC " << name() 6169 << " CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line " 6170 << r_cas_to_cc_send_nline.read() 6171 << std::endl; 6172 } 6408 if(m_debug) 6409 std::cout << " <MEMC " << name() 6410 << " CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line " 6411 << r_cas_to_cc_send_nline.read() << std::endl; 6173 6412 #endif 6174 6413 break; 6175 6414 } 6176 6177 case CC_SEND_CAS_UPDT_HEADER: 6178 { 6179 // send first flit for a multi-update (from CAS FSM) 6415 ///////////////////////////// 6416 case CC_SEND_CAS_UPDT_HEADER: // send first flit for a multi-update (from CAS FSM) 6417 { 6180 6418 if(m_cas_to_cc_send_inst_fifo.rok()) 6181 6419 { … … 6195 6433 break; 6196 6434 } 6197 6198 case CC_SEND_CAS_UPDT_NLINE: 6199 { 6200 // send second flit for a multi-update (from CAS FSM) 6435 //////////////////////////// 6436 case CC_SEND_CAS_UPDT_NLINE: // send second flit for a multi-update (from CAS FSM) 6437 { 6201 6438 if(not p_dspin_out.read) break; 6202 6439 … … 6214 6451 break; 6215 6452 } 6216 6217 case CC_SEND_CAS_UPDT_DATA: 6218 { 6219 // send first data for a multi-update (from CAS FSM) 6453 /////////////////////////// 6454 case CC_SEND_CAS_UPDT_DATA: // send first data for a multi-update (from CAS FSM) 6455 { 6220 6456 if(not p_dspin_out.read) break; 6221 6457 … … 6230 6466 break; 6231 6467 } 6232 6233 case CC_SEND_CAS_UPDT_DATA_HIGH: 6234 { 6235 // send second data for a multi-update (from CAS FSM) 6468 //////////////////////////////// 6469 case CC_SEND_CAS_UPDT_DATA_HIGH: // send second data for a multi-update (from CAS FSM) 6470 { 6236 6471 if(not p_dspin_out.read) break; 6237 6238 6472 cas_to_cc_send_fifo_get = true; 6239 6473 r_cc_send_fsm = CC_SEND_CAS_UPDT_HEADER; … … 6334 6568 } 6335 6569 } 6336 ///////////////////////////////////////////////////////////////////// 6570 ////////////////////////////////////////////////////////////////////////// 6337 6571 // TGT_RSP FSM 6338 ///////////////////////////////////////////////////////////////////// 6572 ////////////////////////////////////////////////////////////////////////// 6339 6573 // The TGT_RSP fsm sends the responses on the VCI target port 6340 // with a round robin priority between seven requests : 6574 // with a round robin priority between eigth requests : 6575 // - r_config_to_tgt_rsp_req 6341 6576 // - r_tgt_cmd_to_tgt_rsp_req 6342 6577 // - r_read_to_tgt_rsp_req … … 6348 6583 // 6349 6584 // The ordering is : 6350 // tgt_cmd > read > write > cas > xram > multi_ack > cleanup6351 ///////////////////////////////////////////////////////////////////// 6585 // config >tgt_cmd > read > write > cas > xram > multi_ack > cleanup 6586 ////////////////////////////////////////////////////////////////////////// 6352 6587 6353 6588 switch(r_tgt_rsp_fsm.read()) 6354 6589 { 6355 case TGT_RSP_TGT_CMD_IDLE: // read requests have the highest priority 6356 { 6357 if(r_read_to_tgt_rsp_req) 6590 ///////////////////////// 6591 case TGT_RSP_CONFIG_IDLE: // tgt_cmd requests have the highest priority 6592 { 6593 if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6594 else if(r_read_to_tgt_rsp_req) 6358 6595 { 6359 6596 r_tgt_rsp_fsm = TGT_RSP_READ; 6360 6597 r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read(); 6361 6598 } 6362 else if(r_write_to_tgt_rsp_req) 6363 { 6364 r_tgt_rsp_fsm = TGT_RSP_WRITE; 6365 } 6366 else if(r_cas_to_tgt_rsp_req) 6367 { 6368 r_tgt_rsp_fsm = TGT_RSP_CAS ; 6369 } 6599 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6600 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS; 6370 6601 else if(r_xram_rsp_to_tgt_rsp_req) 6371 6602 { … … 6373 6604 r_tgt_rsp_cpt = r_xram_rsp_to_tgt_rsp_word.read(); 6374 6605 } 6375 else if(r_multi_ack_to_tgt_rsp_req) 6376 { 6377 r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK; 6378 } 6379 else if(r_cleanup_to_tgt_rsp_req) 6380 { 6381 r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6382 } 6383 else if(r_tgt_cmd_to_tgt_rsp_req) 6384 { 6385 r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6386 } 6606 else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK; 6607 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6608 else if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6609 break; 6610 } 6611 ////////////////////////// 6612 case TGT_RSP_TGT_CMD_IDLE: // read requests have the highest priority 6613 { 6614 if(r_read_to_tgt_rsp_req) 6615 { 6616 r_tgt_rsp_fsm = TGT_RSP_READ; 6617 r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read(); 6618 } 6619 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6620 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS; 6621 else if(r_xram_rsp_to_tgt_rsp_req) 6622 { 6623 r_tgt_rsp_fsm = TGT_RSP_XRAM; 6624 r_tgt_rsp_cpt = r_xram_rsp_to_tgt_rsp_word.read(); 6625 } 6626 else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK; 6627 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6628 else if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6629 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6387 6630 break; 6388 6631 } … … 6390 6633 case TGT_RSP_READ_IDLE: // write requests have the highest priority 6391 6634 { 6392 if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;6393 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS;6635 if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6636 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS; 6394 6637 else if(r_xram_rsp_to_tgt_rsp_req) 6395 6638 { … … 6398 6641 } 6399 6642 else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK; 6400 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6401 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6643 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6644 else if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6645 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6402 6646 else if(r_read_to_tgt_rsp_req) 6403 6647 { … … 6410 6654 case TGT_RSP_WRITE_IDLE: // cas requests have the highest priority 6411 6655 { 6412 if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS;6656 if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS; 6413 6657 else if(r_xram_rsp_to_tgt_rsp_req) 6414 6658 { … … 6417 6661 } 6418 6662 else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK; 6419 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6420 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6663 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6664 else if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6665 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6421 6666 else if(r_read_to_tgt_rsp_req) 6422 6667 { … … 6424 6669 r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read(); 6425 6670 } 6426 6427 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6671 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6428 6672 break; 6429 6673 } … … 6437 6681 } 6438 6682 else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK ; 6439 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6440 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6683 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6684 else if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6685 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6441 6686 else if(r_read_to_tgt_rsp_req) 6442 6687 { … … 6444 6689 r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read(); 6445 6690 } 6446 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;6447 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ;6691 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6692 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ; 6448 6693 break; 6449 6694 } … … 6452 6697 { 6453 6698 6454 if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK ; 6455 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6456 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6699 if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK ; 6700 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6701 else if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6702 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6457 6703 else if(r_read_to_tgt_rsp_req) 6458 6704 { … … 6460 6706 r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read(); 6461 6707 } 6462 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;6463 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ;6708 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6709 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ; 6464 6710 else if(r_xram_rsp_to_tgt_rsp_req) 6465 6711 { … … 6469 6715 break; 6470 6716 } 6471 /////////////////////// 6717 //////////////////////////// 6472 6718 case TGT_RSP_MULTI_ACK_IDLE: // cleanup requests have the highest priority 6473 6719 { 6474 if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6475 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6720 if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6721 else if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6722 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6476 6723 else if(r_read_to_tgt_rsp_req) 6477 6724 { … … 6479 6726 r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read(); 6480 6727 } 6481 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;6482 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ;6728 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6729 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ; 6483 6730 else if(r_xram_rsp_to_tgt_rsp_req) 6484 6731 { … … 6489 6736 break; 6490 6737 } 6491 /////////////////////// 6738 ////////////////////////// 6492 6739 case TGT_RSP_CLEANUP_IDLE: // tgt cmd requests have the highest priority 6493 6740 { 6494 if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6741 if(r_config_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CONFIG; 6742 else if(r_tgt_cmd_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_TGT_CMD; 6495 6743 else if(r_read_to_tgt_rsp_req) 6496 6744 { … … 6498 6746 r_tgt_rsp_cpt = r_read_to_tgt_rsp_word.read(); 6499 6747 } 6500 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE;6501 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ;6748 else if(r_write_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_WRITE; 6749 else if(r_cas_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CAS ; 6502 6750 else if(r_xram_rsp_to_tgt_rsp_req) 6503 6751 { … … 6506 6754 } 6507 6755 else if(r_multi_ack_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_MULTI_ACK ; 6508 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6509 break; 6510 } 6511 ///////////////////// 6512 case TGT_RSP_TGT_CMD: // send the response after a segmentation violation 6513 // or after a config transaction 6756 else if(r_cleanup_to_tgt_rsp_req) r_tgt_rsp_fsm = TGT_RSP_CLEANUP; 6757 break; 6758 } 6759 //////////////////// 6760 case TGT_RSP_CONFIG: // send the response for a config transaction 6514 6761 { 6515 6762 if ( p_vci_tgt.rspack ) 6516 6763 { 6517 r_ tgt_cmd_to_tgt_rsp_req = false;6518 r_tgt_rsp_fsm = TGT_RSP_TGT_CMD_IDLE;6764 r_config_to_tgt_rsp_req = false; 6765 r_tgt_rsp_fsm = TGT_RSP_CONFIG_IDLE; 6519 6766 6520 6767 #if DEBUG_MEMC_TGT_RSP … … 6523 6770 std::cout 6524 6771 << " <MEMC " << name() 6525 << " TGT_RSP_TGT_CMD> Segmentation violation ior config access response" 6772 << " TGT_RSP_CONFIG> Config transaction completed response" 6773 << " / rsrcid = " << std::hex << r_config_to_tgt_rsp_srcid.read() 6774 << " / rtrdid = " << r_config_to_tgt_rsp_trdid.read() 6775 << " / rpktid = " << r_config_to_tgt_rsp_pktid.read() 6776 << std::endl; 6777 } 6778 #endif 6779 } 6780 break; 6781 } 6782 ///////////////////// 6783 case TGT_RSP_TGT_CMD: // send the response for a segmentation violation 6784 { 6785 if ( p_vci_tgt.rspack ) 6786 { 6787 r_tgt_cmd_to_tgt_rsp_req = false; 6788 r_tgt_rsp_fsm = TGT_RSP_TGT_CMD_IDLE; 6789 6790 #if DEBUG_MEMC_TGT_RSP 6791 if( m_debug ) 6792 { 6793 std::cout 6794 << " <MEMC " << name() 6795 << " TGT_RSP_TGT_CMD> Segmentation violation response" 6526 6796 << " / rsrcid = " << std::hex << r_tgt_cmd_to_tgt_rsp_srcid.read() 6527 6797 << " / rtrdid = " << r_tgt_cmd_to_tgt_rsp_trdid.read() … … 6531 6801 #endif 6532 6802 } 6533 } 6534 break; 6535 6803 break; 6804 } 6536 6805 ////////////////// 6537 6806 case TGT_RSP_READ: // send the response to a read … … 6634 6903 break; 6635 6904 } 6636 6637 6905 ////////////////// 6638 6906 case TGT_RSP_XRAM: // send the response after XRAM access … … 6717 6985 ////////////////////// 6718 6986 case ALLOC_UPT_CONFIG: // allocated to CONFIG FSM 6719 if ( (r_config_fsm.read() != CONFIG_UPT_LOCK) and 6720 (r_config_fsm.read() != CONFIG_BC_UPT_LOCK) ) 6987 if (r_config_fsm.read() != CONFIG_DIR_UPT_LOCK) 6721 6988 { 6722 6989 if(r_multi_ack_fsm.read() == MULTI_ACK_UPT_LOCK) … … 6758 7025 r_alloc_upt_fsm = ALLOC_UPT_CAS; 6759 7026 6760 else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or 6761 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK)) 7027 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 6762 7028 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 6763 7029 } … … 6779 7045 r_alloc_upt_fsm = ALLOC_UPT_CAS; 6780 7046 6781 else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or 6782 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK)) 7047 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 6783 7048 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 6784 7049 … … 6799 7064 r_alloc_upt_fsm = ALLOC_UPT_CAS; 6800 7065 6801 else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or 6802 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK)) 7066 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 6803 7067 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 6804 7068 … … 6821 7085 r_alloc_upt_fsm = ALLOC_UPT_CAS; 6822 7086 6823 else if((r_config_fsm.read() == CONFIG_UPT_LOCK) or 6824 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK)) 7087 else if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 6825 7088 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 6826 7089 … … 6842 7105 (r_cas_fsm.read() != CAS_BC_UPT_LOCK)) 6843 7106 { 6844 if((r_config_fsm.read() == CONFIG_UPT_LOCK) or 6845 (r_config_fsm.read() == CONFIG_BC_UPT_LOCK)) 7107 if(r_config_fsm.read() == CONFIG_DIR_UPT_LOCK) 6846 7108 r_alloc_upt_fsm = ALLOC_UPT_CONFIG; 6847 7109 … … 6891 7153 if ( (r_config_fsm.read() != CONFIG_DIR_REQ) and 6892 7154 (r_config_fsm.read() != CONFIG_DIR_ACCESS) and 6893 (r_config_fsm.read() != CONFIG_DIR_ INVAL) )7155 (r_config_fsm.read() != CONFIG_DIR_UPT_LOCK) ) 6894 7156 { 6895 7157 if(r_read_fsm.read() == READ_DIR_REQ) … … 7189 7451 //////////////////////////////////////////////////////////////////////////////////// 7190 7452 // The ALLOC_HEAP FSM allocates the access to the heap 7191 // with a round robin priority between 5user FSMs :7192 // The cyclic ordering is READ > WRITE > CAS > CLEANUP > XRAM_RSP 7453 // with a round robin priority between 6 user FSMs : 7454 // The cyclic ordering is READ > WRITE > CAS > CLEANUP > XRAM_RSP > CONFIG 7193 7455 // The ressource is always allocated. 7194 7456 ///////////////////////////////////////////////////////////////////////////////////// … … 7197 7459 { 7198 7460 //////////////////// 7199 case ALLOC_HEAP_RESET:7461 case ALLOC_HEAP_RESET: 7200 7462 // Initializes the heap one ENTRY each cycle. 7201 7463 … … 7211 7473 7212 7474 //////////////////// 7213 case ALLOC_HEAP_READ:7475 case ALLOC_HEAP_READ: 7214 7476 if((r_read_fsm.read() != READ_HEAP_REQ) and 7215 7477 (r_read_fsm.read() != READ_HEAP_LOCK) and … … 7227 7489 else if(r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_REQ) 7228 7490 r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 7491 7492 else if(r_config_fsm.read() == CONFIG_HEAP_REQ) 7493 r_alloc_heap_fsm = ALLOC_HEAP_CONFIG; 7229 7494 } 7230 7495 break; 7231 7496 7232 7497 ///////////////////// 7233 case ALLOC_HEAP_WRITE:7498 case ALLOC_HEAP_WRITE: 7234 7499 if((r_write_fsm.read() != WRITE_UPT_HEAP_LOCK) and 7235 7500 (r_write_fsm.read() != WRITE_UPT_REQ) and … … 7245 7510 r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 7246 7511 7512 else if(r_config_fsm.read() == CONFIG_HEAP_REQ) 7513 r_alloc_heap_fsm = ALLOC_HEAP_CONFIG; 7514 7247 7515 else if(r_read_fsm.read() == READ_HEAP_REQ) 7248 7516 r_alloc_heap_fsm = ALLOC_HEAP_READ; … … 7251 7519 7252 7520 //////////////////// 7253 case ALLOC_HEAP_CAS:7521 case ALLOC_HEAP_CAS: 7254 7522 if((r_cas_fsm.read() != CAS_UPT_HEAP_LOCK) and 7255 7523 (r_cas_fsm.read() != CAS_UPT_REQ) and … … 7262 7530 r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 7263 7531 7532 else if(r_config_fsm.read() == CONFIG_HEAP_REQ) 7533 r_alloc_heap_fsm = ALLOC_HEAP_CONFIG; 7534 7264 7535 else if(r_read_fsm.read() == READ_HEAP_REQ) 7265 7536 r_alloc_heap_fsm = ALLOC_HEAP_READ; … … 7271 7542 7272 7543 /////////////////////// 7273 case ALLOC_HEAP_CLEANUP:7544 case ALLOC_HEAP_CLEANUP: 7274 7545 if((r_cleanup_fsm.read() != CLEANUP_HEAP_REQ) and 7275 7546 (r_cleanup_fsm.read() != CLEANUP_HEAP_LOCK) and … … 7280 7551 r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 7281 7552 7553 else if(r_config_fsm.read() == CONFIG_HEAP_REQ) 7554 r_alloc_heap_fsm = ALLOC_HEAP_CONFIG; 7555 7282 7556 else if(r_read_fsm.read() == READ_HEAP_REQ) 7283 7557 r_alloc_heap_fsm = ALLOC_HEAP_READ; … … 7292 7566 7293 7567 //////////////////////// 7294 case ALLOC_HEAP_XRAM_RSP:7568 case ALLOC_HEAP_XRAM_RSP: 7295 7569 if((r_xram_rsp_fsm.read() != XRAM_RSP_HEAP_REQ) and 7296 7570 (r_xram_rsp_fsm.read() != XRAM_RSP_HEAP_ERASE)) 7297 7571 { 7572 if(r_config_fsm.read() == CONFIG_HEAP_REQ) 7573 r_alloc_heap_fsm = ALLOC_HEAP_CONFIG; 7574 7575 else if(r_read_fsm.read() == READ_HEAP_REQ) 7576 r_alloc_heap_fsm = ALLOC_HEAP_READ; 7577 7578 else if(r_write_fsm.read() == WRITE_UPT_HEAP_LOCK) 7579 r_alloc_heap_fsm = ALLOC_HEAP_WRITE; 7580 7581 else if(r_cas_fsm.read() == CAS_UPT_HEAP_LOCK) 7582 r_alloc_heap_fsm = ALLOC_HEAP_CAS; 7583 7584 else if(r_cleanup_fsm.read() == CLEANUP_HEAP_REQ) 7585 r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP; 7586 7587 } 7588 break; 7589 7590 /////////////////////// 7591 case ALLOC_HEAP_CONFIG: 7592 if((r_config_fsm.read() != CONFIG_HEAP_REQ) and 7593 (r_config_fsm.read() != CONFIG_HEAP_SCAN)) 7594 { 7298 7595 if(r_read_fsm.read() == READ_HEAP_REQ) 7299 7596 r_alloc_heap_fsm = ALLOC_HEAP_READ; … … 7308 7605 r_alloc_heap_fsm = ALLOC_HEAP_CLEANUP; 7309 7606 7607 if(r_xram_rsp_fsm.read() == XRAM_RSP_HEAP_REQ) 7608 r_alloc_heap_fsm = ALLOC_HEAP_XRAM_RSP; 7310 7609 } 7311 7610 break; … … 7332 7631 ///////////////////////////////////////////////////////////////////// 7333 7632 7334 if(cmd_write_fifo_put) 7335 { 7336 if(cmd_write_fifo_get) 7337 { 7338 m_cmd_write_addr_fifo.put_and_get((addr_t)(p_vci_tgt.address.read())); 7339 m_cmd_write_eop_fifo.put_and_get(p_vci_tgt.eop.read()); 7340 m_cmd_write_srcid_fifo.put_and_get(p_vci_tgt.srcid.read()); 7341 m_cmd_write_trdid_fifo.put_and_get(p_vci_tgt.trdid.read()); 7342 m_cmd_write_pktid_fifo.put_and_get(p_vci_tgt.pktid.read()); 7343 m_cmd_write_data_fifo.put_and_get(p_vci_tgt.wdata.read()); 7344 m_cmd_write_be_fifo.put_and_get(p_vci_tgt.be.read()); 7345 } 7346 else 7347 { 7348 m_cmd_write_addr_fifo.simple_put((addr_t)(p_vci_tgt.address.read())); 7349 m_cmd_write_eop_fifo.simple_put(p_vci_tgt.eop.read()); 7350 m_cmd_write_srcid_fifo.simple_put(p_vci_tgt.srcid.read()); 7351 m_cmd_write_trdid_fifo.simple_put(p_vci_tgt.trdid.read()); 7352 m_cmd_write_pktid_fifo.simple_put(p_vci_tgt.pktid.read()); 7353 m_cmd_write_data_fifo.simple_put(p_vci_tgt.wdata.read()); 7354 m_cmd_write_be_fifo.simple_put(p_vci_tgt.be.read()); 7355 } 7356 } 7357 else 7358 { 7359 if(cmd_write_fifo_get) 7360 { 7361 m_cmd_write_addr_fifo.simple_get(); 7362 m_cmd_write_eop_fifo.simple_get(); 7363 m_cmd_write_srcid_fifo.simple_get(); 7364 m_cmd_write_trdid_fifo.simple_get(); 7365 m_cmd_write_pktid_fifo.simple_get(); 7366 m_cmd_write_data_fifo.simple_get(); 7367 m_cmd_write_be_fifo.simple_get(); 7368 } 7369 } 7633 m_cmd_write_addr_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put, 7634 (addr_t)p_vci_tgt.address.read() ); 7635 m_cmd_write_eop_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put, 7636 p_vci_tgt.eop.read() ); 7637 m_cmd_write_srcid_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put, 7638 p_vci_tgt.srcid.read() ); 7639 m_cmd_write_trdid_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put, 7640 p_vci_tgt.trdid.read() ); 7641 m_cmd_write_pktid_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put, 7642 p_vci_tgt.pktid.read() ); 7643 m_cmd_write_data_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put, 7644 p_vci_tgt.wdata.read() ); 7645 m_cmd_write_be_fifo.update( cmd_write_fifo_get, cmd_write_fifo_put, 7646 p_vci_tgt.be.read() ); 7647 7370 7648 //////////////////////////////////////////////////////////////////////////////////// 7371 7649 // TGT_CMD to CAS FIFO 7372 7650 //////////////////////////////////////////////////////////////////////////////////// 7373 7651 7374 if(cmd_cas_fifo_put) 7375 { 7376 if(cmd_cas_fifo_get) 7377 { 7378 m_cmd_cas_addr_fifo.put_and_get((addr_t)(p_vci_tgt.address.read())); 7379 m_cmd_cas_eop_fifo.put_and_get(p_vci_tgt.eop.read()); 7380 m_cmd_cas_srcid_fifo.put_and_get(p_vci_tgt.srcid.read()); 7381 m_cmd_cas_trdid_fifo.put_and_get(p_vci_tgt.trdid.read()); 7382 m_cmd_cas_pktid_fifo.put_and_get(p_vci_tgt.pktid.read()); 7383 m_cmd_cas_wdata_fifo.put_and_get(p_vci_tgt.wdata.read()); 7384 } 7385 else 7386 { 7387 m_cmd_cas_addr_fifo.simple_put((addr_t)(p_vci_tgt.address.read())); 7388 m_cmd_cas_eop_fifo.simple_put(p_vci_tgt.eop.read()); 7389 m_cmd_cas_srcid_fifo.simple_put(p_vci_tgt.srcid.read()); 7390 m_cmd_cas_trdid_fifo.simple_put(p_vci_tgt.trdid.read()); 7391 m_cmd_cas_pktid_fifo.simple_put(p_vci_tgt.pktid.read()); 7392 m_cmd_cas_wdata_fifo.simple_put(p_vci_tgt.wdata.read()); 7393 } 7394 } 7395 else 7396 { 7397 if(cmd_cas_fifo_get) 7398 { 7399 m_cmd_cas_addr_fifo.simple_get(); 7400 m_cmd_cas_eop_fifo.simple_get(); 7401 m_cmd_cas_srcid_fifo.simple_get(); 7402 m_cmd_cas_trdid_fifo.simple_get(); 7403 m_cmd_cas_pktid_fifo.simple_get(); 7404 m_cmd_cas_wdata_fifo.simple_get(); 7405 } 7406 } 7652 m_cmd_cas_addr_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put, 7653 (addr_t)p_vci_tgt.address.read() ); 7654 m_cmd_cas_eop_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put, 7655 p_vci_tgt.eop.read() ); 7656 m_cmd_cas_srcid_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put, 7657 p_vci_tgt.srcid.read() ); 7658 m_cmd_cas_trdid_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put, 7659 p_vci_tgt.trdid.read() ); 7660 m_cmd_cas_pktid_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put, 7661 p_vci_tgt.pktid.read() ); 7662 m_cmd_cas_wdata_fifo.update( cmd_cas_fifo_get, cmd_cas_fifo_put, 7663 p_vci_tgt.wdata.read() ); 7664 7407 7665 //////////////////////////////////////////////////////////////////////////////////// 7408 7666 // CC_RECEIVE to CLEANUP FIFO 7409 7667 //////////////////////////////////////////////////////////////////////////////////// 7410 7668 7411 if(cc_receive_to_cleanup_fifo_put) 7412 { 7413 if(cc_receive_to_cleanup_fifo_get) 7414 { 7415 m_cc_receive_to_cleanup_fifo.put_and_get(p_dspin_in.data.read()); 7416 } 7417 else 7418 { 7419 m_cc_receive_to_cleanup_fifo.simple_put(p_dspin_in.data.read()); 7420 } 7421 } 7422 else 7423 { 7424 if(cc_receive_to_cleanup_fifo_get) 7425 { 7426 m_cc_receive_to_cleanup_fifo.simple_get(); 7427 } 7428 } 7669 m_cc_receive_to_cleanup_fifo.update( cc_receive_to_cleanup_fifo_get, 7670 cc_receive_to_cleanup_fifo_put, 7671 p_dspin_in.data.read() ); 7429 7672 7430 7673 //////////////////////////////////////////////////////////////////////////////////// … … 7432 7675 //////////////////////////////////////////////////////////////////////////////////// 7433 7676 7434 if(cc_receive_to_multi_ack_fifo_put) 7435 { 7436 if(cc_receive_to_multi_ack_fifo_get) 7437 { 7438 m_cc_receive_to_multi_ack_fifo.put_and_get(p_dspin_in.data.read()); 7439 } 7440 else 7441 { 7442 m_cc_receive_to_multi_ack_fifo.simple_put(p_dspin_in.data.read()); 7443 } 7444 } 7445 else 7446 { 7447 if(cc_receive_to_multi_ack_fifo_get) 7448 { 7449 m_cc_receive_to_multi_ack_fifo.simple_get(); 7450 } 7451 } 7677 m_cc_receive_to_multi_ack_fifo.update( cc_receive_to_multi_ack_fifo_get, 7678 cc_receive_to_multi_ack_fifo_put, 7679 p_dspin_in.data.read() ); 7452 7680 7453 7681 //////////////////////////////////////////////////////////////////////////////////// … … 7455 7683 //////////////////////////////////////////////////////////////////////////////////// 7456 7684 7457 if(write_to_cc_send_fifo_put) 7458 { 7459 if(write_to_cc_send_fifo_get) 7460 { 7461 m_write_to_cc_send_inst_fifo.put_and_get(write_to_cc_send_fifo_inst); 7462 m_write_to_cc_send_srcid_fifo.put_and_get(write_to_cc_send_fifo_srcid); 7685 m_write_to_cc_send_inst_fifo.update( write_to_cc_send_fifo_get, write_to_cc_send_fifo_put, 7686 write_to_cc_send_fifo_inst ); 7687 m_write_to_cc_send_srcid_fifo.update( write_to_cc_send_fifo_get, write_to_cc_send_fifo_put, 7688 write_to_cc_send_fifo_srcid ); 7463 7689 #if L1_MULTI_CACHE 7464 m_write_to_cc_send_cache_id_fifo.put_and_get(write_to_cc_send_fifo_cache_id); 7465 #endif 7466 } 7467 else 7468 { 7469 m_write_to_cc_send_inst_fifo.simple_put(write_to_cc_send_fifo_inst); 7470 m_write_to_cc_send_srcid_fifo.simple_put(write_to_cc_send_fifo_srcid); 7690 m_write_to_cc_send_cache_id_fifo.update( write_to_cc_send_fifo_get, write_to_cc_send_fifo_put, 7691 write_to_cc_send_fifo_cache_id ); 7692 #endif 7693 7694 //////////////////////////////////////////////////////////////////////////////////// 7695 // CONFIG to CC_SEND FIFO 7696 //////////////////////////////////////////////////////////////////////////////////// 7697 7698 m_config_to_cc_send_inst_fifo.update( config_to_cc_send_fifo_get, config_to_cc_send_fifo_put, 7699 config_to_cc_send_fifo_inst ); 7700 m_config_to_cc_send_srcid_fifo.update( config_to_cc_send_fifo_get, config_to_cc_send_fifo_put, 7701 config_to_cc_send_fifo_srcid ); 7471 7702 #if L1_MULTI_CACHE 7472 m_write_to_cc_send_cache_id_fifo.simple_put(write_to_cc_send_fifo_cache_id); 7473 #endif 7474 } 7475 } 7476 else 7477 { 7478 if(write_to_cc_send_fifo_get) 7479 { 7480 m_write_to_cc_send_inst_fifo.simple_get(); 7481 m_write_to_cc_send_srcid_fifo.simple_get(); 7482 #if L1_MULTI_CACHE 7483 m_write_to_cc_send_cache_id_fifo.simple_get(); 7484 #endif 7485 } 7486 } 7703 m_config_to_cc_send_cache_id_fifo.update( config_to_cc_send_fifo_get, config_to_cc_send_fifo_put, 7704 config_to_cc_send_fifo_cache_id ); 7705 #endif 7706 7487 7707 //////////////////////////////////////////////////////////////////////////////////// 7488 7708 // XRAM_RSP to CC_SEND FIFO 7489 7709 //////////////////////////////////////////////////////////////////////////////////// 7490 7710 7491 if(xram_rsp_to_cc_send_fifo_put) 7492 { 7493 if(xram_rsp_to_cc_send_fifo_get) 7494 { 7495 m_xram_rsp_to_cc_send_inst_fifo.put_and_get(xram_rsp_to_cc_send_fifo_inst); 7496 m_xram_rsp_to_cc_send_srcid_fifo.put_and_get(xram_rsp_to_cc_send_fifo_srcid); 7711 m_xram_rsp_to_cc_send_inst_fifo.update( xram_rsp_to_cc_send_fifo_get, xram_rsp_to_cc_send_fifo_put, 7712 xram_rsp_to_cc_send_fifo_inst ); 7713 m_xram_rsp_to_cc_send_srcid_fifo.update( xram_rsp_to_cc_send_fifo_get, xram_rsp_to_cc_send_fifo_put, 7714 xram_rsp_to_cc_send_fifo_srcid ); 7497 7715 #if L1_MULTI_CACHE 7498 m_xram_rsp_to_cc_send_cache_id_fifo.put_and_get(xram_rsp_to_cc_send_fifo_cache_id); 7499 #endif 7500 } 7501 else 7502 { 7503 m_xram_rsp_to_cc_send_inst_fifo.simple_put(xram_rsp_to_cc_send_fifo_inst); 7504 m_xram_rsp_to_cc_send_srcid_fifo.simple_put(xram_rsp_to_cc_send_fifo_srcid); 7505 #if L1_MULTI_CACHE 7506 m_xram_rsp_to_cc_send_cache_id_fifo.simple_put(xram_rsp_to_cc_send_fifo_cache_id); 7507 #endif 7508 } 7509 } 7510 else 7511 { 7512 if(xram_rsp_to_cc_send_fifo_get) 7513 { 7514 m_xram_rsp_to_cc_send_inst_fifo.simple_get(); 7515 m_xram_rsp_to_cc_send_srcid_fifo.simple_get(); 7516 #if L1_MULTI_CACHE 7517 m_xram_rsp_to_cc_send_cache_id_fifo.simple_get(); 7518 #endif 7519 } 7520 } 7716 m_xram_rsp_to_cc_send_cache_id_fifo.update( xram_rsp_to_cc_send_fifo_get, xram_rsp_to_cc_send_fifo_put, 7717 xram_rsp_to_cc_send_fifo_cache_id ); 7718 #endif 7719 7521 7720 //////////////////////////////////////////////////////////////////////////////////// 7522 7721 // CAS to CC_SEND FIFO 7523 7722 //////////////////////////////////////////////////////////////////////////////////// 7524 7723 7525 if(cas_to_cc_send_fifo_put) 7526 { 7527 if(cas_to_cc_send_fifo_get) 7528 { 7529 m_cas_to_cc_send_inst_fifo.put_and_get(cas_to_cc_send_fifo_inst); 7530 m_cas_to_cc_send_srcid_fifo.put_and_get(cas_to_cc_send_fifo_srcid); 7724 m_cas_to_cc_send_inst_fifo.update( cas_to_cc_send_fifo_get, cas_to_cc_send_fifo_put, 7725 cas_to_cc_send_fifo_inst ); 7726 m_cas_to_cc_send_srcid_fifo.update( cas_to_cc_send_fifo_get, cas_to_cc_send_fifo_put, 7727 cas_to_cc_send_fifo_srcid ); 7531 7728 #if L1_MULTI_CACHE 7532 m_cas_to_cc_send_cache_id_fifo.put_and_get(cas_to_cc_send_fifo_cache_id); 7533 #endif 7534 } 7535 else 7536 { 7537 m_cas_to_cc_send_inst_fifo.simple_put(cas_to_cc_send_fifo_inst); 7538 m_cas_to_cc_send_srcid_fifo.simple_put(cas_to_cc_send_fifo_srcid); 7539 #if L1_MULTI_CACHE 7540 m_cas_to_cc_send_cache_id_fifo.simple_put(cas_to_cc_send_fifo_cache_id); 7541 #endif 7542 } 7543 } 7544 else 7545 { 7546 if(cas_to_cc_send_fifo_get) 7547 { 7548 m_cas_to_cc_send_inst_fifo.simple_get(); 7549 m_cas_to_cc_send_srcid_fifo.simple_get(); 7550 #if L1_MULTI_CACHE 7551 m_cas_to_cc_send_cache_id_fifo.simple_get(); 7552 #endif 7553 } 7554 } 7729 m_cas_to_cc_send_cache_id_fifo.update( cas_to_cc_send_fifo_get, cas_to_cc_send_fifo_put, 7730 cas_to_cc_send_fifo_cache_id ); 7731 #endif 7555 7732 7556 7733 m_cpt_cycles++; … … 7675 7852 break; 7676 7853 7854 case TGT_CMD_CONFIG: 7677 7855 case TGT_CMD_ERROR: 7678 7856 p_vci_tgt.cmdack = not r_tgt_cmd_to_tgt_rsp_req.read(); … … 7689 7867 case TGT_CMD_CAS: 7690 7868 p_vci_tgt.cmdack = m_cmd_cas_addr_fifo.wok(); 7691 break;7692 7693 default:7694 p_vci_tgt.cmdack = false;7695 7869 break; 7696 7870 } … … 7702 7876 switch(r_tgt_rsp_fsm.read()) 7703 7877 { 7878 case TGT_RSP_CONFIG_IDLE: 7704 7879 case TGT_RSP_TGT_CMD_IDLE: 7705 7880 case TGT_RSP_READ_IDLE: … … 7709 7884 case TGT_RSP_MULTI_ACK_IDLE: 7710 7885 case TGT_RSP_CLEANUP_IDLE: 7886 { 7711 7887 p_vci_tgt.rspval = false; 7712 7888 p_vci_tgt.rsrcid = 0; … … 7717 7893 p_vci_tgt.reop = false; 7718 7894 break; 7895 } 7896 case TGT_RSP_CONFIG: 7897 { 7898 p_vci_tgt.rspval = true; 7899 p_vci_tgt.rdata = 0; 7900 p_vci_tgt.rsrcid = r_config_to_tgt_rsp_srcid.read(); 7901 p_vci_tgt.rtrdid = r_config_to_tgt_rsp_trdid.read(); 7902 p_vci_tgt.rpktid = r_config_to_tgt_rsp_pktid.read(); 7903 p_vci_tgt.rerror = r_config_to_tgt_rsp_error.read(); 7904 p_vci_tgt.reop = true; 7905 7906 break; 7907 } 7719 7908 7720 7909 case TGT_RSP_TGT_CMD: … … 7840 8029 { 7841 8030 /////////////////////////// 8031 case CC_SEND_CONFIG_IDLE: 7842 8032 case CC_SEND_XRAM_RSP_IDLE: 7843 8033 case CC_SEND_WRITE_IDLE: 7844 8034 case CC_SEND_CAS_IDLE: 7845 8035 case CC_SEND_CLEANUP_IDLE: 8036 { 7846 8037 break; 7847 8038 } 8039 //////////////////////////////// 8040 case CC_SEND_CONFIG_INVAL_HEADER: 8041 { 8042 uint8_t multi_inval_type; 8043 if(m_config_to_cc_send_inst_fifo.read()) 8044 { 8045 multi_inval_type = DspinDhccpParam::TYPE_MULTI_INVAL_INST; 8046 } 8047 else 8048 { 8049 multi_inval_type = DspinDhccpParam::TYPE_MULTI_INVAL_DATA; 8050 } 8051 8052 uint64_t flit = 0; 8053 uint64_t dest = m_config_to_cc_send_srcid_fifo.read() << 8054 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 8055 8056 DspinDhccpParam::dspin_set( flit, 8057 dest, 8058 DspinDhccpParam::MULTI_INVAL_DEST); 8059 8060 DspinDhccpParam::dspin_set( flit, 8061 m_cc_global_id, 8062 DspinDhccpParam::MULTI_INVAL_SRCID); 8063 8064 DspinDhccpParam::dspin_set( flit, 8065 r_config_to_cc_send_trdid.read(), 8066 DspinDhccpParam::MULTI_INVAL_UPDT_INDEX); 8067 8068 DspinDhccpParam::dspin_set( flit, 8069 multi_inval_type, 8070 DspinDhccpParam::FROM_MC_TYPE); 8071 p_dspin_out.write = true; 8072 p_dspin_out.data = flit; 8073 break; 8074 } 8075 //////////////////////////////// 8076 case CC_SEND_CONFIG_INVAL_NLINE: 8077 { 8078 uint64_t flit = 0; 8079 DspinDhccpParam::dspin_set( flit, 8080 r_config_to_cc_send_nline.read(), 8081 DspinDhccpParam::MULTI_INVAL_NLINE); 8082 p_dspin_out.eop = true; 8083 p_dspin_out.write = true; 8084 p_dspin_out.data = flit; 8085 break; 8086 } 7848 8087 //////////////////////// 7849 8088 case CC_SEND_CLEANUP_ACK: … … 7889 8128 7890 8129 break; 7891 8130 } 7892 8131 7893 8132 /////////////////////////////////// 7894 8133 case CC_SEND_XRAM_RSP_INVAL_HEADER: 7895 8134 { 7896 8135 if(not m_xram_rsp_to_cc_send_inst_fifo.rok()) break; 7897 8136 … … 7907 8146 7908 8147 uint64_t flit = 0; 7909 uint64_t dest = 7910 m_xram_rsp_to_cc_send_srcid_fifo.read() << 7911 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 7912 7913 DspinDhccpParam::dspin_set( 7914 flit, 7915 dest, 7916 DspinDhccpParam::MULTI_INVAL_DEST); 7917 7918 DspinDhccpParam::dspin_set( 7919 flit, 7920 m_cc_global_id, 7921 DspinDhccpParam::MULTI_INVAL_SRCID); 7922 7923 DspinDhccpParam::dspin_set( 7924 flit, 7925 r_xram_rsp_to_cc_send_trdid.read(), 7926 DspinDhccpParam::MULTI_INVAL_UPDT_INDEX); 7927 7928 DspinDhccpParam::dspin_set( 7929 flit, 7930 multi_inval_type, 7931 DspinDhccpParam::FROM_MC_TYPE); 7932 8148 uint64_t dest = m_xram_rsp_to_cc_send_srcid_fifo.read() << 8149 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 8150 8151 DspinDhccpParam::dspin_set( flit, 8152 dest, 8153 DspinDhccpParam::MULTI_INVAL_DEST); 8154 8155 DspinDhccpParam::dspin_set( flit, 8156 m_cc_global_id, 8157 DspinDhccpParam::MULTI_INVAL_SRCID); 8158 8159 DspinDhccpParam::dspin_set( flit, 8160 r_xram_rsp_to_cc_send_trdid.read(), 8161 DspinDhccpParam::MULTI_INVAL_UPDT_INDEX); 8162 8163 DspinDhccpParam::dspin_set( flit, 8164 multi_inval_type, 8165 DspinDhccpParam::FROM_MC_TYPE); 7933 8166 p_dspin_out.write = true; 7934 8167 p_dspin_out.data = flit; 7935 7936 8168 break; 7937 8169 } 7938 8170 7939 8171 ////////////////////////////////// 7940 8172 case CC_SEND_XRAM_RSP_INVAL_NLINE: 7941 8173 { 7942 8174 uint64_t flit = 0; 7943 8175 7944 DspinDhccpParam::dspin_set( 7945 flit, 7946 r_xram_rsp_to_cc_send_nline.read(), 7947 DspinDhccpParam::MULTI_INVAL_NLINE); 7948 7949 8176 DspinDhccpParam::dspin_set( flit, 8177 r_xram_rsp_to_cc_send_nline.read(), 8178 DspinDhccpParam::MULTI_INVAL_NLINE); 7950 8179 p_dspin_out.eop = true; 7951 8180 p_dspin_out.write = true; 7952 8181 p_dspin_out.data = flit; 7953 7954 8182 break; 7955 8183 } 7956 8184 7957 8185 ///////////////////////////////////// 8186 case CC_SEND_CONFIG_BRDCAST_HEADER: 7958 8187 case CC_SEND_XRAM_RSP_BRDCAST_HEADER: 7959 8188 case CC_SEND_WRITE_BRDCAST_HEADER: 7960 8189 case CC_SEND_CAS_BRDCAST_HEADER: 7961 8190 { 7962 8191 uint64_t flit = 0; 7963 8192 7964 DspinDhccpParam::dspin_set( 7965 flit, 7966 m_broadcast_boundaries, 7967 DspinDhccpParam::BROADCAST_BOX); 7968 7969 DspinDhccpParam::dspin_set( 7970 flit, 7971 m_cc_global_id, 7972 DspinDhccpParam::BROADCAST_SRCID); 7973 7974 DspinDhccpParam::dspin_set( 7975 flit, 7976 1ULL, 7977 DspinDhccpParam::FROM_MC_BC); 7978 8193 DspinDhccpParam::dspin_set( flit, 8194 m_broadcast_boundaries, 8195 DspinDhccpParam::BROADCAST_BOX); 8196 8197 DspinDhccpParam::dspin_set( flit, 8198 m_cc_global_id, 8199 DspinDhccpParam::BROADCAST_SRCID); 8200 8201 DspinDhccpParam::dspin_set( flit, 8202 1ULL, 8203 DspinDhccpParam::FROM_MC_BC); 7979 8204 p_dspin_out.write = true; 7980 8205 p_dspin_out.data = flit; 7981 7982 8206 break; 7983 8207 } 7984 8208 //////////////////////////////////// 7985 8209 case CC_SEND_XRAM_RSP_BRDCAST_NLINE: 7986 8210 { 7987 8211 uint64_t flit = 0; 7988 7989 DspinDhccpParam::dspin_set( 7990 flit, 7991 r_xram_rsp_to_cc_send_nline.read(), 7992 DspinDhccpParam::BROADCAST_NLINE); 7993 8212 DspinDhccpParam::dspin_set( flit, 8213 r_xram_rsp_to_cc_send_nline.read(), 8214 DspinDhccpParam::BROADCAST_NLINE); 7994 8215 p_dspin_out.write = true; 7995 8216 p_dspin_out.eop = true; 7996 8217 p_dspin_out.data = flit; 7997 7998 8218 break; 7999 8000 ///////////////////////////////// 8001 case CC_SEND_ WRITE_BRDCAST_NLINE:8002 8219 } 8220 ////////////////////////////////// 8221 case CC_SEND_CONFIG_BRDCAST_NLINE: 8222 { 8003 8223 uint64_t flit = 0; 8004 8005 DspinDhccpParam::dspin_set( 8006 flit, 8007 r_write_to_cc_send_nline.read(), 8008 DspinDhccpParam::BROADCAST_NLINE); 8009 8224 DspinDhccpParam::dspin_set( flit, 8225 r_config_to_cc_send_nline.read(), 8226 DspinDhccpParam::BROADCAST_NLINE); 8010 8227 p_dspin_out.write = true; 8011 8228 p_dspin_out.eop = true; 8012 8229 p_dspin_out.data = flit; 8013 8014 8230 break; 8015 8016 /////////////////////////////// 8017 case CC_SEND_ CAS_BRDCAST_NLINE:8018 8231 } 8232 ///////////////////////////////// 8233 case CC_SEND_WRITE_BRDCAST_NLINE: 8234 { 8019 8235 uint64_t flit = 0; 8020 8021 DspinDhccpParam::dspin_set( 8022 flit, 8023 r_cas_to_cc_send_nline.read(), 8024 DspinDhccpParam::BROADCAST_NLINE); 8025 8236 DspinDhccpParam::dspin_set( flit, 8237 r_write_to_cc_send_nline.read(), 8238 DspinDhccpParam::BROADCAST_NLINE); 8026 8239 p_dspin_out.write = true; 8027 8240 p_dspin_out.eop = true; 8028 8241 p_dspin_out.data = flit; 8029 8030 8242 break; 8031 } 8243 } 8244 /////////////////////////////// 8245 case CC_SEND_CAS_BRDCAST_NLINE: 8246 { 8247 uint64_t flit = 0; 8248 DspinDhccpParam::dspin_set( flit, 8249 r_cas_to_cc_send_nline.read(), 8250 DspinDhccpParam::BROADCAST_NLINE); 8251 p_dspin_out.write = true; 8252 p_dspin_out.eop = true; 8253 p_dspin_out.data = flit; 8254 break; 8255 } 8032 8256 /////////////////////////////// 8033 8257 case CC_SEND_WRITE_UPDT_HEADER: 8034 8258 { 8035 8259 if(not m_write_to_cc_send_inst_fifo.rok()) break; 8036 8260 … … 8074 8298 8075 8299 break; 8076 8300 } 8077 8301 ////////////////////////////// 8078 8302 case CC_SEND_WRITE_UPDT_NLINE: 8079 8303 { 8080 8304 uint64_t flit = 0; 8081 8305 … … 8094 8318 8095 8319 break; 8096 8320 } 8097 8321 ///////////////////////////// 8098 8322 case CC_SEND_WRITE_UPDT_DATA: 8099 8323 { 8100 8324 8101 8325 uint8_t multi_updt_cpt = … … 8122 8346 8123 8347 break; 8124 8348 } 8125 8349 //////////////////////////// 8126 8350 case CC_SEND_CAS_UPDT_HEADER: 8127 8351 { 8128 8352 if (not m_cas_to_cc_send_inst_fifo.rok()) break; 8129 8353 … … 8167 8391 8168 8392 break; 8169 8393 } 8170 8394 //////////////////////////// 8171 8395 case CC_SEND_CAS_UPDT_NLINE: 8172 8396 { 8173 8397 uint64_t flit = 0; 8174 8398 … … 8187 8411 8188 8412 break; 8189 8413 } 8190 8414 /////////////////////////// 8191 8415 case CC_SEND_CAS_UPDT_DATA: 8192 8416 { 8193 8417 uint64_t flit = 0; 8194 8418 … … 8208 8432 8209 8433 break; 8210 8434 } 8211 8435 //////////////////////////////// 8212 8436 case CC_SEND_CAS_UPDT_DATA_HIGH: 8213 8437 { 8214 8438 uint64_t flit = 0; 8215 8439 … … 8229 8453 8230 8454 break; 8231 8455 } 8232 8456 } 8233 8457
Note: See TracChangeset
for help on using the changeset viewer.