Changeset 601 for trunk/modules/vci_mem_cache
- Timestamp:
- Dec 17, 2013, 11:11:20 AM (11 years ago)
- Location:
- trunk/modules/vci_mem_cache
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r599 r601 466 466 sc_in<bool> p_clk; 467 467 sc_in<bool> p_resetn; 468 sc_out<bool> p_irq; 468 469 soclib::caba::VciTarget<vci_param_int> p_vci_tgt; 469 470 soclib::caba::VciInitiator<vci_param_ext> p_vci_ixr; … … 904 905 sc_signal<size_t> r_xram_rsp_ivt_index; // IVT entry index 905 906 sc_signal<size_t> r_xram_rsp_next_ptr; // Next pointer to the heap 907 sc_signal<bool> r_xram_rsp_rerror_irq; // WRITE MISS rerror irq 908 sc_signal<bool> r_xram_rsp_rerror_irq_enable; // WRITE MISS rerror irq enable 909 sc_signal<addr_t> r_xram_rsp_rerror_address; // WRITE MISS rerror address 910 sc_signal<size_t> r_xram_rsp_rerror_rsrcid; // WRITE MISS rerror srcid 906 911 907 912 // Buffer between XRAM_RSP fsm and TGT_RSP fsm (response to L1 cache) -
trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h
r549 r601 401 401 void write_rsp(const size_t index, 402 402 const size_t word, 403 const wide_data_t data) 403 const wide_data_t data, 404 const bool rerror) 404 405 { 405 406 data_t value; … … 417 418 assert( (tab[index].xram_read ) and 418 419 "MEMC ERROR: TRT entry is not a GET in TRT write_rsp()"); 420 421 if ( rerror ) 422 { 423 tab[index].rerror = true; 424 return; 425 } 419 426 420 427 // first 32 bits word -
trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r599 r601 1054 1054 r_xram_rsp_to_ixr_cmd_req = false; 1055 1055 r_xram_rsp_trt_index = 0; 1056 r_xram_rsp_rerror_irq = false; 1057 r_xram_rsp_rerror_irq_enable = false; 1056 1058 1057 1059 m_xram_rsp_to_cc_send_inst_fifo.init(); … … 1214 1216 addr_t address = p_vci_tgt.address.read(); 1215 1217 uint32_t plen = p_vci_tgt.plen.read(); 1216 bool found = false;1217 1218 bool config = false; 1218 1219 1219 for (size_t seg_id = 0; (seg_id < m_nseg) && !found; seg_id++)1220 for (size_t seg_id = 0; (seg_id < m_nseg) ; seg_id++) 1220 1221 { 1221 1222 if (m_seg[seg_id]->contains(address) && 1222 1223 m_seg[seg_id]->contains(address + plen - vci_param_int::B)) 1223 1224 { 1224 found = true;1225 1225 if (m_seg[seg_id]->special()) config = true; 1226 1226 } 1227 1227 } 1228 1228 1229 if (!found) /////////// out of segment error 1230 { 1231 r_tgt_cmd_fsm = TGT_CMD_ERROR; 1232 } 1233 else if (config) /////////// configuration command 1229 if (config) /////////// configuration command 1234 1230 { 1235 1231 if (!p_vci_tgt.eop.read()) r_tgt_cmd_fsm = TGT_CMD_ERROR; … … 1356 1352 // X : REGISTER INDEX // 1357 1353 // // 1354 // For WRITE MISS error signaling: FUNC = 0x010 // 1355 // // 1356 // REGS_IDX // 1357 // ============================================ // 1358 // RESERVED | X | // 1359 // (4 bits) | (3 bits) | // 1360 // ============================================ // 1361 // // 1362 // X : REGISTER INDEX // 1363 // // 1358 1364 /////////////////////////////////////////////////////////// 1359 1365 … … 1453 1459 { 1454 1460 error = read_instrumentation(regr, rdata); 1461 } 1462 else 1463 { 1464 error = 1; 1465 } 1466 1467 break; 1468 } 1469 1470 // xram GET bus error registers 1471 case MEMC_RERROR: 1472 { 1473 need_rsp = true; 1474 error = 0; 1475 1476 if (p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) 1477 { 1478 switch (regr) 1479 { 1480 case MEMC_RERROR_IRQ_ENABLE: 1481 r_xram_rsp_rerror_irq_enable = 1482 (p_vci_tgt.wdata.read() != 0); 1483 1484 break; 1485 1486 default: 1487 error = 1; 1488 break; 1489 } 1490 } 1491 else if (p_vci_tgt.cmd.read() == vci_param_int::CMD_READ) 1492 { 1493 switch (regr) 1494 { 1495 case MEMC_RERROR_SRCID: 1496 rdata = (uint32_t) 1497 r_xram_rsp_rerror_rsrcid.read(); 1498 1499 break; 1500 1501 case MEMC_RERROR_ADDR_LO: 1502 rdata = (uint32_t) 1503 (r_xram_rsp_rerror_address.read()) & 1504 ((1ULL<<32)-1); 1505 1506 break; 1507 1508 case MEMC_RERROR_ADDR_HI: 1509 rdata = (uint32_t) 1510 (r_xram_rsp_rerror_address.read() >> 32) & 1511 ((1ULL<<32)-1); 1512 1513 break; 1514 1515 case MEMC_RERROR_IRQ_RESET: 1516 if (not r_xram_rsp_rerror_irq.read()) break; 1517 1518 r_xram_rsp_rerror_irq = false; 1519 1520 break; 1521 1522 default: 1523 error = 1; 1524 break; 1525 } 1455 1526 } 1456 1527 else … … 4217 4288 r_ixr_rsp_trt_index = p_vci_ixr.rtrdid.read(); 4218 4289 4219 assert( ((p_vci_ixr.rerror.read() & 0x1) == 0) and 4220 "MEMC ERROR in IXR_RSP state: XRAM response error !"); 4221 4222 if (p_vci_ixr.reop.read()) // PUT 4290 if (p_vci_ixr.reop.read() and not 4291 p_vci_ixr.rerror.read()) // PUT 4223 4292 { 4224 4293 r_ixr_rsp_fsm = IXR_RSP_TRT_ERASE; … … 4249 4318 if (r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP) 4250 4319 { 4251 size_t index = r_ixr_rsp_trt_index.read(); 4320 size_t index = r_ixr_rsp_trt_index.read(); 4321 4252 4322 if (m_trt.is_config(index)) // it's a config transaction 4253 4323 { 4254 4324 config_rsp_lines_ixr_rsp_decr = true; 4255 m_trt.erase(index); 4256 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4257 } 4258 else // not a config transaction 4259 { 4260 m_trt.erase(index); 4261 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4262 } 4325 } 4326 4327 m_trt.erase(index); 4328 r_ixr_rsp_fsm = IXR_RSP_IDLE; 4263 4329 4264 4330 #if DEBUG_MEMC_IXR_RSP … … 4279 4345 bool eop = p_vci_ixr.reop.read(); 4280 4346 wide_data_t data = p_vci_ixr.rdata.read(); 4281 bool error= ((p_vci_ixr.rerror.read() & 0x1) == 1);4282 4283 assert(((eop == (word == (m_words-2))) or error) and4347 bool rerror = ((p_vci_ixr.rerror.read() & 0x1) == 1); 4348 4349 assert(((eop == (word == (m_words-2))) or rerror) and 4284 4350 "MEMC ERROR in IXR_RSP_TRT_READ state : invalid response from XRAM"); 4285 4351 4286 m_trt.write_rsp( index, word, data );4352 m_trt.write_rsp( index, word, data, rerror ); 4287 4353 4288 4354 r_ixr_rsp_cpt = word + 2; … … 4819 4885 4820 4886 // Next state 4821 if (r_xram_rsp_trt_buf.proc_read) r_xram_rsp_fsm = XRAM_RSP_ERROR_RSP; 4822 else r_xram_rsp_fsm = XRAM_RSP_IDLE; 4887 if (r_xram_rsp_trt_buf.proc_read) 4888 { 4889 r_xram_rsp_fsm = XRAM_RSP_ERROR_RSP; 4890 } 4891 else 4892 { 4893 // Trigger an interruption to signal a bus error from 4894 // the XRAM because a processor WRITE MISS (XRAM GET 4895 // transaction and not processor read). 4896 // 4897 // To avoid deadlocks we do not wait an error to be 4898 // acknowledged before signaling another one. 4899 // Therefore, when there is an active error, and other 4900 // errors arrive, these are not considered 4901 4902 if (!r_xram_rsp_rerror_irq.read() && r_xram_rsp_rerror_irq_enable.read() 4903 && r_xram_rsp_trt_buf.xram_read ) 4904 { 4905 r_xram_rsp_rerror_irq = true; 4906 r_xram_rsp_rerror_address = r_xram_rsp_trt_buf.nline * m_words * 4; 4907 r_xram_rsp_rerror_rsrcid = r_xram_rsp_trt_buf.srcid; 4908 4909 #if DEBUG_MEMC_XRAM_RSP 4910 if (m_debug) 4911 std::cout 4912 << " <MEMC " << name() << " XRAM_RSP_ERROR_ERASE>" 4913 << " Triggering interrupt to signal WRITE MISS bus error" 4914 << " / irq_enable = " << r_xram_rsp_rerror_irq_enable.read() 4915 << " / nline = " << r_xram_rsp_trt_buf.nline 4916 << " / rsrcid = " << r_xram_rsp_trt_buf.srcid 4917 << std::endl; 4918 #endif 4919 } 4920 4921 r_xram_rsp_fsm = XRAM_RSP_IDLE; 4922 } 4823 4923 4824 4924 #if DEBUG_MEMC_XRAM_RSP … … 8425 8525 8426 8526 //////////////////////////////////////////////////////////////////// 8527 // p_irq port 8528 // 8529 // WRITE MISS response error signaling 8530 //////////////////////////////////////////////////////////////////// 8531 8532 p_irq = 8533 r_xram_rsp_rerror_irq.read() && 8534 r_xram_rsp_rerror_irq_enable.read(); 8535 8536 //////////////////////////////////////////////////////////////////// 8427 8537 // p_dspin_m2p port (CC_SEND FSM) 8428 8538 //////////////////////////////////////////////////////////////////// -
trunk/modules/vci_mem_cache/include/soclib/mem_cache.h
r596 r601 32 32 MEMC_CONFIG = 0, 33 33 MEMC_INSTRM = 1, 34 MEMC_RERROR = 2, 34 35 35 36 MEMC_FUNC_SPAN = 0x200 … … 70 71 // // 71 72 // For configuration: FUNC_IDX = 0b000 // 73 // // 74 // REGS_IDX // 75 // ============================================ // 76 // RESERVED | X | // 77 // (4 bits) | (3 bits) | // 78 // ============================================ // 79 // // 80 // X : REGISTER INDEX // 81 // // 82 // For WRITE MISS error signaling: FUNC = 0x010 // 72 83 // // 73 84 // REGS_IDX // … … 166 177 }; 167 178 179 enum SoclibMemCacheRerrorRegs 180 { 181 MEMC_RERROR_ADDR_LO = 0, 182 MEMC_RERROR_ADDR_HI, 183 MEMC_RERROR_SRCID, 184 MEMC_RERROR_IRQ_RESET, 185 MEMC_RERROR_IRQ_ENABLE 186 }; 187 168 188 #define MEMC_REG(func,idx) ((func<<7)|idx) 169 189
Note: See TracChangeset
for help on using the changeset viewer.