Changeset 901 for branches/RWT/modules
- Timestamp:
- Dec 3, 2014, 5:59:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r837 r901 1300 1300 // The TGT_CMD_FSM controls the incoming VCI command pakets from the processors, 1301 1301 // and dispatch these commands to the proper FSM through dedicated FIFOs. 1302 // These READ/WRITE commands can be for the XRAM segment, or for the 1303 // CONFIG segment: 1302 1304 // 1303 // There are 5 types of commands accepted inthe XRAM segment:1305 // There are 5 types of commands accepted for the XRAM segment: 1304 1306 // - READ : A READ request has a length of 1 VCI flit. It can be a single word 1305 1307 // or an entire cache line, depending on the PLEN value => READ FSM … … 1311 1313 // acces key, second flit the data to write => WRITE FSM. 1312 1314 // 1313 // The READ/WRITE commands accepted in the configurationsegment are targeting1315 // The READ/WRITE commands accepted for the CONFIG segment are targeting 1314 1316 // configuration or status registers. They must contain one single flit. 1315 1317 // - For almost all addressable registers, the response is returned immediately. … … 1370 1372 // ==> TYPE_WRITE = X100 with the TSAR encoding 1371 1373 // ==> mask = 0b0111 = 0x7 1372 assert((((p_vci_tgt.pktid.read() & 0x7) == 0x4) or ((p_vci_tgt.pktid.read() & 0x7) == 0x0)) and 1373 "The type specified in the pktid field is incompatible with the WRITE CMD"); 1374 assert((((p_vci_tgt.pktid.read() & 0x7) == 0x4) or 1375 ((p_vci_tgt.pktid.read() & 0x7) == 0x0)) and 1376 "The type specified in the pktid field is incompatible with the WRITE CMD"); 1374 1377 r_tgt_cmd_fsm = TGT_CMD_WRITE; 1375 1378 } … … 1411 1414 break; 1412 1415 1413 1416 /////////////////// 1414 1417 case TGT_CMD_ERROR: // response error must be sent 1415 1418 … … 1442 1445 break; 1443 1446 1444 1447 //////////////////// 1445 1448 case TGT_CMD_CONFIG: // execute config request and return response 1446 1449 { … … 1490 1493 1491 1494 addr_t addr_lsb = p_vci_tgt.address.read() & m_config_addr_mask; 1492 1493 1495 addr_t cell = (addr_lsb / vci_param_int::B); 1494 1495 1496 size_t regr = cell & m_config_regr_idx_mask; 1496 1497 1497 size_t func = (cell >> m_config_regr_width) & m_config_func_idx_mask; 1498 1498 … … 2311 2311 } 2312 2312 //////////////////// 2313 case CONFIG_TRT_SET: 2314 // and post a PUT request in TRT2313 case CONFIG_TRT_SET: // read data in cache 2314 // and post a PUT request in TRT 2315 2315 { 2316 2316 assert((r_alloc_dir_fsm.read() == ALLOC_DIR_CONFIG) and … … 2480 2480 { 2481 2481 // post bc inval request 2482 r_config_to_cc_send_multi_req 2482 r_config_to_cc_send_multi_req = false; 2483 2483 r_config_to_cc_send_brdcast_req = true; 2484 r_config_to_cc_send_trdid 2485 r_config_to_cc_send_nline 2484 r_config_to_cc_send_trdid = r_config_ivt_index.read(); 2485 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 2486 2486 2487 2487 // prepare next iteration … … 2507 2507 not r_config_to_cc_send_brdcast_req.read()) 2508 2508 { 2509 // post multi inval request 2510 r_config_to_cc_send_multi_req = true; 2511 r_config_to_cc_send_brdcast_req = false; 2512 r_config_to_cc_send_trdid = r_config_ivt_index.read(); 2513 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 2514 2515 // post data into FIFO 2509 // post first copy into FIFO 2516 2510 config_to_cc_send_fifo_srcid = r_config_dir_copy_srcid.read(); 2517 2511 config_to_cc_send_fifo_inst = r_config_dir_copy_inst.read(); 2518 2512 config_to_cc_send_fifo_put = true; 2519 2513 2520 if (r_config_dir_count.read() == 1) // one copy 2521 { 2522 // prepare next iteration 2514 if (r_config_dir_count.read() == 1) // only one copy 2515 { 2516 // post multi inval request 2517 r_config_to_cc_send_multi_req = true; 2518 r_config_to_cc_send_brdcast_req = false; 2519 r_config_to_cc_send_trdid = r_config_ivt_index.read(); 2520 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 2521 2522 // prepare next iteration (next line to be invalidated) 2523 2523 r_config_cmd_lines = r_config_cmd_lines.read() - 1; 2524 r_config_address 2525 r_config_fsm 2526 } 2527 else // several copies 2524 r_config_address = r_config_address.read() + (m_words << 2); 2525 r_config_fsm = CONFIG_LOOP; 2526 } 2527 else // several copies : must use heap 2528 2528 { 2529 2529 r_config_fsm = CONFIG_HEAP_REQ; … … 2567 2567 bool last_copy = (entry.next == r_config_heap_next.read()); 2568 2568 2569 // post one more copy into fifo 2569 2570 config_to_cc_send_fifo_srcid = entry.owner.srcid; 2570 config_to_cc_send_fifo_inst = entry.owner.inst; 2571 config_to_cc_send_fifo_put = true; 2572 2573 if (m_config_to_cc_send_inst_fifo.wok()) // inval request accepted 2574 { 2575 r_config_heap_next = entry.next; 2576 if (last_copy) r_config_fsm = CONFIG_HEAP_LAST; 2577 2578 // <Activity counters> 2579 m_cpt_heap_slot_available++; 2580 // </Activity counters> 2581 } 2582 2571 config_to_cc_send_fifo_inst = entry.owner.inst; 2572 config_to_cc_send_fifo_put = true; 2573 2574 assert ( (m_config_to_cc_send_inst_fifo.wok()) and 2575 "MEMC ERROR in CONFIG_HEAP_SCAN: The m_config_to_cc_send fifo should never overflow"); 2576 2577 r_config_heap_next = entry.next; 2578 if (last_copy) 2579 { 2580 // post multi inval request 2581 r_config_to_cc_send_multi_req = true; 2582 r_config_to_cc_send_brdcast_req = false; 2583 r_config_to_cc_send_trdid = r_config_ivt_index.read(); 2584 r_config_to_cc_send_nline = m_nline[(addr_t)(r_config_address.read())]; 2585 2586 // prepare next iteration (next line to be invalidated) 2587 r_config_cmd_lines = r_config_cmd_lines.read() - 1; 2588 r_config_address = r_config_address.read() + (m_words << 2); 2589 r_config_fsm = CONFIG_HEAP_LAST; 2590 } 2591 // <Activity counters> 2592 m_cpt_heap_slot_available++; 2593 // </Activity counters> 2583 2594 #if DEBUG_MEMC_CONFIG 2584 2595 if (m_debug) … … 2614 2625 m_heap.write(r_config_heap_next.read(), last_entry); 2615 2626 2616 // prepare next iteration2617 r_config_cmd_lines = r_config_cmd_lines.read() - 1;2618 r_config_address = r_config_address.read() + (m_words << 2);2619 2627 r_config_fsm = CONFIG_LOOP; 2620 2628
Note: See TracChangeset
for help on using the changeset viewer.