- Timestamp:
- Jul 12, 2013, 12:16:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r430 r434 77 77 78 78 /* States of the TGT_CMD fsm */ 79 enum tgt_cmd_fsm_state_e{ 79 enum tgt_cmd_fsm_state_e 80 { 80 81 TGT_CMD_IDLE, 81 82 TGT_CMD_ERROR, 82 83 TGT_CMD_READ, 83 84 TGT_CMD_WRITE, 84 TGT_CMD_CAS 85 TGT_CMD_CAS, 86 TGT_CMD_CONFIG 85 87 }; 86 88 … … 144 146 MULTI_ACK_UPT_LOCK, 145 147 MULTI_ACK_UPT_CLEAR, 146 MULTI_ACK_WRITE_RSP 148 MULTI_ACK_WRITE_RSP, 149 MULTI_ACK_CONFIG_ACK 150 }; 151 152 /* States of the CONFIG fsm */ 153 enum config_fsm_state_e 154 { 155 CONFIG_IDLE, 156 CONFIG_LOOP, 157 CONFIG_RSP, 158 CONFIG_DIR_REQ, 159 CONFIG_DIR_ACCESS, 160 CONFIG_DIR_INVAL, 161 CONFIG_BC_UPT_LOCK, 162 CONFIG_BC_SEND, 163 CONFIG_BC_WAIT, 164 165 CONFIG_UPT_WAIT, 166 167 CONFIG_UPT_LOCK, 168 169 CONFIG_HEAP_REQ 147 170 }; 148 171 … … 277 300 CLEANUP_UPT_CLEAR, 278 301 CLEANUP_WRITE_RSP, 279 CLEANUP_SEND_ACK 302 CLEANUP_CONFIG_ACK, 303 CLEANUP_SEND_CLACK 280 304 }; 281 305 … … 284 308 { 285 309 ALLOC_DIR_RESET, 310 ALLOC_DIR_CONFIG, 286 311 ALLOC_DIR_READ, 287 312 ALLOC_DIR_WRITE, … … 304 329 enum alloc_upt_fsm_state_e 305 330 { 331 ALLOC_UPT_CONFIG, 306 332 ALLOC_UPT_WRITE, 307 333 ALLOC_UPT_XRAM_RSP, … … 350 376 }; 351 377 378 /* Configuration commands */ 379 enum cmd_config_type_e 380 { 381 CMD_CONFIG_INVAL = 0, 382 CMD_CONFIG_SYNC = 1 383 }; 384 352 385 // debug variables (for each FSM) 353 bool m_debug_global; 354 bool m_debug_tgt_cmd_fsm; 355 bool m_debug_tgt_rsp_fsm; 356 bool m_debug_cc_send_fsm; 357 bool m_debug_cc_receive_fsm; 358 bool m_debug_multi_ack_fsm; 359 bool m_debug_read_fsm; 360 bool m_debug_write_fsm; 361 bool m_debug_cas_fsm; 362 bool m_debug_cleanup_fsm; 363 bool m_debug_ixr_cmd_fsm; 364 bool m_debug_ixr_rsp_fsm; 365 bool m_debug_xram_rsp_fsm; 386 bool m_debug; 366 387 bool m_debug_previous_hit; 367 388 size_t m_debug_previous_count; … … 373 394 // instrumentation counters 374 395 uint32_t m_cpt_cycles; // Counter of cycles 396 375 397 uint32_t m_cpt_read; // Number of READ transactions 398 uint32_t m_cpt_read_remote; // number of remote READ transactions 399 uint32_t m_cpt_read_flits; // number of flits for READs 400 uint32_t m_cpt_read_cost; // Number of (flits * distance) for READs 401 376 402 uint32_t m_cpt_read_miss; // Number of MISS READ 403 377 404 uint32_t m_cpt_write; // Number of WRITE transactions 405 uint32_t m_cpt_write_remote; // number of remote WRITE transactions 406 uint32_t m_cpt_write_flits; // number of flits for WRITEs 407 uint32_t m_cpt_write_cost; // Number of (flits * distance) for WRITEs 408 378 409 uint32_t m_cpt_write_miss; // Number of MISS WRITE 379 410 uint32_t m_cpt_write_cells; // Cumulated length for WRITE transactions … … 391 422 uint32_t m_cpt_cas; // Number of CAS transactions 392 423 424 uint32_t m_cpt_cleanup_cost; // Number of (flits * distance) for CLEANUPs 425 426 uint32_t m_cpt_update_flits; // Number of flits for UPDATEs 427 uint32_t m_cpt_update_cost; // Number of (flits * distance) for UPDATEs 428 429 uint32_t m_cpt_inval_cost; // Number of (flits * distance) for INVALs 430 431 uint32_t m_cpt_get; 432 433 uint32_t m_cpt_put; 434 393 435 size_t m_prev_count; 394 436 … … 407 449 VciMemCache( 408 450 sc_module_name name, // Instance Name 409 const soclib::common::MappingTable &mtp, // Mapping table directnetwork410 const soclib::common::MappingTable &mtx, // Mapping table externalnetwork411 const soclib::common::IntTab &srcid_x, // global index on externalnetwork412 const soclib::common::IntTab &tgtid_d, // global index on directnetwork413 const size_t cc_global_id, // global index on ccnetwork451 const soclib::common::MappingTable &mtp, // Mapping table INT network 452 const soclib::common::MappingTable &mtx, // Mapping table RAM network 453 const soclib::common::IntTab &srcid_x, // global index RAM network 454 const soclib::common::IntTab &tgtid_d, // global index INT network 455 const size_t cc_global_id, // global index CC network 414 456 const size_t nways, // Number of ways per set 415 457 const size_t nsets, // Number of sets 416 458 const size_t nwords, // Number of words per line 417 const size_t max_copies, // max number of copies in heap459 const size_t max_copies, // max number of copies 418 460 const size_t heap_size=HEAP_ENTRIES, 419 461 const size_t trt_lines=TRT_ENTRIES, … … 437 479 438 480 // Component attributes 439 std::list<soclib::common::Segment> m_seglist; // segments allocated to memcache481 std::list<soclib::common::Segment> m_seglist; // segments allocated 440 482 size_t m_nseg; // number of segments 441 483 soclib::common::Segment **m_seg; // array of segments pointers 442 const size_t m_srcid_x; // global index on external network 484 size_t m_seg_config; // config segment index 485 const size_t m_srcid_x; // global index on RAM network 443 486 const size_t m_initiators; // Number of initiators 444 487 const size_t m_heap_size; // Size of the heap … … 458 501 size_t m_max_copies; // max number of copies in heap 459 502 GenericLLSCGlobalTable 460 < 32 , 461 4096, 462 8000, 463 addr_t > m_llsc_table; // ll/sc globalregistration table503 < 32 , // number of slots 504 4096, // number of processors in the system 505 8000, // registration life (# of LL operations) 506 addr_t > m_llsc_table; // ll/sc registration table 464 507 465 508 // adress masks … … 511 554 // (segmentation violation response request) 512 555 sc_signal<bool> r_tgt_cmd_to_tgt_rsp_req; 556 557 sc_signal<uint32_t> r_tgt_cmd_to_tgt_rsp_rdata; 558 sc_signal<size_t> r_tgt_cmd_to_tgt_rsp_error; 513 559 sc_signal<size_t> r_tgt_cmd_to_tgt_rsp_srcid; 514 560 sc_signal<size_t> r_tgt_cmd_to_tgt_rsp_trdid; 515 561 sc_signal<size_t> r_tgt_cmd_to_tgt_rsp_pktid; 516 562 563 sc_signal<addr_t> r_tgt_cmd_config_addr; 564 sc_signal<size_t> r_tgt_cmd_config_cmd; 565 566 /////////////////////////////////////////////////////// 567 // Registers controlled by the CONFIG fsm 568 /////////////////////////////////////////////////////// 569 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 580 sc_signal<size_t> r_config_upt_index; // UPT index 581 sc_signal<bool> r_config_is_cnt; // counter mode (broadcast required) 582 583 // Buffer between CONFIG fsm and TGT_RSP fsm (send a done response to L1 cache) 584 sc_signal<bool> r_config_to_tgt_rsp_req; // valid request 585 sc_signal<bool> r_config_to_tgt_rsp_error; // error response 586 sc_signal<size_t> r_config_to_tgt_rsp_srcid; // Transaction srcid 587 sc_signal<size_t> r_config_to_tgt_rsp_trdid; // Transaction trdid 588 sc_signal<size_t> r_config_to_tgt_rsp_pktid; // Transaction pktid 589 590 // Buffer between CONFIG fsm and CC_SEND fsm (multi-inval / broadcast-inval) 591 sc_signal<bool> r_config_to_cc_send_multi_req; // multi-inval request 592 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 index 594 sc_signal<size_t> r_config_to_cc_send_trdid; // UPT index 595 517 596 /////////////////////////////////////////////////////// 518 597 // Registers controlled by the READ fsm 519 598 /////////////////////////////////////////////////////// 520 599 521 sc_signal<int> r_read_fsm; // FSM state522 sc_signal<size_t> r_read_copy; // Srcid of the first copy523 sc_signal<size_t> r_read_copy_cache; // Srcid of the first copy524 sc_signal<bool> r_read_copy_inst; // Type of the first copy525 sc_signal<tag_t> r_read_tag; // cache line tag (in directory)526 sc_signal<bool> r_read_is_cnt; // is_cnt bit (in directory)527 sc_signal<bool> r_read_lock; // lock bit (in directory)528 sc_signal<bool> r_read_dirty; // dirty bit (in directory)529 sc_signal<size_t> r_read_count; // number of copies530 sc_signal<size_t> r_read_ptr; // pointer to the heap531 sc_signal<data_t> * r_read_data; // data (one cache line)532 sc_signal<size_t> r_read_way; // associative way (in cache)533 sc_signal<size_t> r_read_trt_index; // Transaction Table index534 sc_signal<size_t> r_read_next_ptr; // Next entry to point to535 sc_signal<bool> r_read_last_free; // Last free entry536 sc_signal<addr_t> r_read_ll_key; // LL key from the llsc_global_table600 sc_signal<int> r_read_fsm; // FSM state 601 sc_signal<size_t> r_read_copy; // Srcid of the first copy 602 sc_signal<size_t> r_read_copy_cache; // Srcid of the first copy 603 sc_signal<bool> r_read_copy_inst; // Type of the first copy 604 sc_signal<tag_t> r_read_tag; // cache line tag (in directory) 605 sc_signal<bool> r_read_is_cnt; // is_cnt bit (in directory) 606 sc_signal<bool> r_read_lock; // lock bit (in directory) 607 sc_signal<bool> r_read_dirty; // dirty bit (in directory) 608 sc_signal<size_t> r_read_count; // number of copies 609 sc_signal<size_t> r_read_ptr; // pointer to the heap 610 sc_signal<data_t> * r_read_data; // data (one cache line) 611 sc_signal<size_t> r_read_way; // associative way (in cache) 612 sc_signal<size_t> r_read_trt_index; // Transaction Table index 613 sc_signal<size_t> r_read_next_ptr; // Next entry to point to 614 sc_signal<bool> r_read_last_free; // Last free entry 615 sc_signal<addr_t> r_read_ll_key; // LL key from the llsc_global_table 537 616 538 617 // Buffer between READ fsm and IXR_CMD fsm (ask a missing cache line to XRAM) … … 626 705 sc_signal<addr_t> r_multi_ack_nline; // pending write nline 627 706 707 // signaling completion of multi-inval to CONFIG fsm 708 sc_signal<bool> r_multi_ack_to_config_ack; 709 628 710 // Buffer between MULTI_ACK fsm and TGT_RSP fsm (complete write/update transaction) 629 711 sc_signal<bool> r_multi_ack_to_tgt_rsp_req; // valid request … … 662 744 sc_signal<size_t> r_cleanup_way; // associative way (in cache) 663 745 664 sc_signal<size_t> r_cleanup_write_srcid; // srcid of write r esponse746 sc_signal<size_t> r_cleanup_write_srcid; // srcid of write rsp 665 747 sc_signal<size_t> r_cleanup_write_trdid; // trdid of write rsp 666 748 sc_signal<size_t> r_cleanup_write_pktid; // pktid of write rsp 667 sc_signal<bool> r_cleanup_write_need_rsp;// needs a write rsp 749 750 sc_signal<bool> r_cleanup_need_rsp; // write response required 751 sc_signal<bool> r_cleanup_need_ack; // config acknowledge required 668 752 669 753 sc_signal<size_t> r_cleanup_index; // index of the INVAL line (in the UPT) 670 754 755 // signaling completion of broadcast-inval to CONFIG fsm 756 sc_signal<bool> r_cleanup_to_config_ack; 757 671 758 // Buffer between CLEANUP fsm and TGT_RSP fsm (acknowledge a write command from L1) 672 759 sc_signal<bool> r_cleanup_to_tgt_rsp_req; // valid request
Note: See TracChangeset
for help on using the changeset viewer.