Changeset 785 for branches/MESI/modules/vci_mem_cache/caba/source/include
- Timestamp:
- Sep 2, 2014, 6:25:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MESI/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r719 r785 38 38 #include <list> 39 39 #include <cassert> 40 40 41 #include "arithmetics.h" 41 42 #include "alloc_elems.h" … … 51 52 #include "update_tab.h" 52 53 #include "dspin_interface.h" 53 #include "dspin_ dhccp_param.h"54 #include "dspin_hmesi_param.h" 54 55 55 56 #define TRT_ENTRIES 4 // Number of entries in TRT … … 69 70 : public soclib::caba::BaseModule 70 71 { 71 typedef typename vci_param_int::fast_addr_t 72 typedef typename sc_dt::sc_uint<64> 73 typedef uint32_t 74 typedef uint32_t 75 typedef uint32_t 76 typedef uint32_t 72 typedef typename vci_param_int::fast_addr_t addr_t; 73 typedef typename sc_dt::sc_uint<64> wide_data_t; 74 typedef uint32_t data_t; 75 typedef uint32_t tag_t; 76 typedef uint32_t be_t; 77 typedef uint32_t copy_t; 77 78 78 79 /* States of the TGT_CMD fsm */ … … 392 393 // b1 accÚs table llsc type SW / other 393 394 // b2 WRITE/CAS/LL/SC 394 TYPE_DATA_UNC 395 TYPE_READ_DATA_MISS 396 TYPE_READ_INS_UNC 397 TYPE_READ_INS_MISS 398 TYPE_WRITE 399 TYPE_CAS 400 TYPE_LL 401 TYPE_SC 395 TYPE_DATA_UNC = 0x0, 396 TYPE_READ_DATA_MISS = 0x1, 397 TYPE_READ_INS_UNC = 0x2, 398 TYPE_READ_INS_MISS = 0x3, 399 TYPE_WRITE = 0x4, 400 TYPE_CAS = 0x5, 401 TYPE_LL = 0x6, 402 TYPE_SC = 0x7 402 403 }; 403 404 … … 405 406 enum sc_status_type_e 406 407 { 407 SC_SUCCESS =0x00000000,408 SC_FAIL =0x00000001408 SC_SUCCESS = 0x00000000, 409 SC_FAIL = 0x00000001 409 410 }; 410 411 411 412 // debug variables 412 bool 413 size_t 414 size_t 415 bool 416 data_t * 417 data_t * 413 bool m_debug; 414 size_t m_debug_previous_valid; 415 size_t m_debug_previous_count; 416 bool m_debug_previous_dirty; 417 data_t * m_debug_previous_data; 418 data_t * m_debug_data; 418 419 419 420 // instrumentation counters 420 uint32_t m_cpt_cycles; // Counter of cycles 421 422 // Counters accessible in software (not yet but eventually) 423 uint32_t m_cpt_reset_count; // Last cycle at which counters have been reset 424 uint32_t m_cpt_read_miss_local; // Number of local READ transactions 425 uint32_t m_cpt_read_miss_remote; // number of remote READ transactions 426 uint32_t m_cpt_read_miss_cost; // Number of (flits * distance) for READs 427 428 uint32_t m_cpt_getm_miss_local; // Number of local getm miss transactions 429 uint32_t m_cpt_getm_miss_remote; // number of remote getm miss transactions 430 431 uint32_t m_cpt_getm_hit_local; // Number of local getm hit transactions 432 uint32_t m_cpt_getm_hit_remote; // number of remote getm hit transactions 433 uint32_t m_cpt_getm_cost; // Number of (flits * distance) for getm 434 435 uint32_t m_cpt_write_local; // Number of local WRITE transactions 436 uint32_t m_cpt_write_remote; // number of remote WRITE transactions 437 uint32_t m_cpt_write_flits_local; // number of flits for local WRITEs 438 uint32_t m_cpt_write_flits_remote; // number of flits for remote WRITEs 439 uint32_t m_cpt_write_cost; // Number of (flits * distance) for WRITEs 440 441 uint32_t m_cpt_ll_local; // Number of local LL transactions 442 uint32_t m_cpt_ll_remote; // number of remote LL transactions 443 uint32_t m_cpt_ll_cost; // Number of (flits * distance) for LLs 444 445 uint32_t m_cpt_sc_local; // Number of local SC transactions 446 uint32_t m_cpt_sc_remote; // number of remote SC transactions 447 uint32_t m_cpt_sc_cost; // Number of (flits * distance) for SCs 448 449 uint32_t m_cpt_cas_local; // Number of local SC transactions 450 uint32_t m_cpt_cas_remote; // number of remote SC transactions 451 uint32_t m_cpt_cas_cost; // Number of (flits * distance) for SCs 452 453 uint32_t m_cpt_update; // Number of requests causing an UPDATE 454 uint32_t m_cpt_update_local; // Number of local UPDATE transactions 455 uint32_t m_cpt_update_remote; // Number of remote UPDATE transactions 456 uint32_t m_cpt_update_cost; // Number of (flits * distance) for UPDT 457 458 uint32_t m_cpt_minval; // Number of requests causing M_INV 459 uint32_t m_cpt_minval_local; // Number of local M_INV transactions 460 uint32_t m_cpt_minval_remote; // Number of remote M_INV transactions 461 uint32_t m_cpt_minval_cost; // Number of (flits * distance) for M_INV 462 463 uint32_t m_cpt_binval; // Number of BROADCAST INVAL 464 465 uint32_t m_cpt_cleanup_local; // Number of local CLEANUP transactions 466 uint32_t m_cpt_cleanup_remote; // Number of remote CLEANUP transactions 467 uint32_t m_cpt_cleanup_with_data; 468 uint32_t m_cpt_cleanup_cost; // Number of (flits * distance) for CLEANUPs 469 470 uint32_t m_cpt_multi_ack_miss; // Number of local CLEANUP transactions 471 uint32_t m_cpt_multi_ack_hit; // Number of local CLEANUP transactions 472 uint32_t m_cpt_multi_ack_hit_with_data; // Number of remote CLEANUP transactions 421 uint32_t m_cpt_cycles; // Counter of cycles 422 423 // Counters 424 // (*) = Counters accessible in software 425 uint32_t m_cpt_reset_count; // Last cycle at which counters have been reset 426 427 uint32_t m_cpt_read_local; // Number of local READ transactions (*) 428 uint32_t m_cpt_read_remote; // number of remote READ transactions (*) 429 uint32_t m_cpt_read_cost; // Number of (flits * distance) for READs (*) 430 431 uint32_t m_cpt_write_local; // Number of local WRITE transactions 432 uint32_t m_cpt_write_remote; // number of remote WRITE transactions 433 uint32_t m_cpt_write_flits_local; // number of flits for local WRITEs (*) 434 uint32_t m_cpt_write_flits_remote; // number of flits for remote WRITEs (*) 435 uint32_t m_cpt_write_cost; // Number of (flits * distance) for WRITEs (*) 436 437 uint32_t m_cpt_ll_local; // Number of local LL transactions (*) 438 uint32_t m_cpt_ll_remote; // number of remote LL transactions (*) 439 uint32_t m_cpt_ll_cost; // Number of (flits * distance) for LLs (*) 440 441 uint32_t m_cpt_sc_local; // Number of local SC transactions (*) 442 uint32_t m_cpt_sc_remote; // number of remote SC transactions (*) 443 uint32_t m_cpt_sc_cost; // Number of (flits * distance) for SCs (*) 444 445 uint32_t m_cpt_cas_local; // Number of local SC transactions (*) 446 uint32_t m_cpt_cas_remote; // number of remote SC transactions (*) 447 uint32_t m_cpt_cas_cost; // Number of (flits * distance) for SCs (*) 448 449 uint32_t m_cpt_minval; // Number of requests causing M_INV (*) 450 uint32_t m_cpt_minval_local; // Number of local M_INV transactions (*) 451 uint32_t m_cpt_minval_remote; // Number of remote M_INV transactions (*) 452 uint32_t m_cpt_minval_cost; // Number of (flits * distance) for M_INV (*) 453 454 uint32_t m_cpt_binval; // Number of BROADCAST INVAL (*) 455 uint32_t m_cpt_write_broadcast;// Number of BROADCAST INVAL caused by write 456 uint32_t m_cpt_getm_broadcast; // Number of BROADCAST INVAL caused by getm 457 458 uint32_t m_cpt_cleanup_local; // Number of local CLEANUP transactions (*) 459 uint32_t m_cpt_cleanup_remote; // Number of remote CLEANUP transactions (*) 460 uint32_t m_cpt_cleanup_cost; // Number of (flits * distance) for CLEANUPs (*) 461 uint32_t m_cpt_cleanup_data_local; // 462 uint32_t m_cpt_cleanup_data_remote; // 463 uint32_t m_cpt_cleanup_data_cost; // 464 465 uint32_t m_cpt_read_miss; // Number of MISS READ 466 uint32_t m_cpt_write_miss; // Number of MISS WRITE 467 uint32_t m_cpt_write_dirty; // Cumulated length for WRITE transactions 468 uint32_t m_cpt_getm_miss; // Number of getm miss 469 470 uint32_t m_cpt_getm_local; // Number of local getm miss transactions 471 uint32_t m_cpt_getm_remote; // number of remote getm miss transactions 472 uint32_t m_cpt_getm_cost; // Number of (flits * distance) for getm 473 474 uint32_t m_cpt_inval_ro_local; // Number of local INVAL RO (*) 475 uint32_t m_cpt_inval_ro_remote; // Number of local INVAL RO (*) 476 uint32_t m_cpt_inval_ro_cost; // Cost for INVAL RO (*) 473 477 474 // Counters not accessible by software 475 uint32_t m_cpt_read_miss; // Number of MISS READ 476 uint32_t m_cpt_getm_miss; // Number of getm miss 477 uint32_t m_cpt_getm_broadcast; // Number of BROADCAST INVAL because getm 478 uint32_t m_cpt_getm_minval; // Number of MULTI INVAL because getm 479 uint32_t m_cpt_write_miss; // Number of MISS WRITE 480 uint32_t m_cpt_write_dirty; // Cumulated length for WRITE transactions 481 uint32_t m_cpt_write_broadcast;// Number of BROADCAST INVAL because write 482 uint32_t m_cpt_write_minval; // Number of MULTI INVAL because write 483 uint32_t m_cpt_cas_broadcast; // Number of BROADCAST INVAL because cas 484 uint32_t m_cpt_cas_minval; // Number of MULTI INVAL because cas 485 uint32_t m_cpt_cas_miss; 486 487 uint32_t m_cpt_read_locked_rb; // Read blocked by a locked ligne 488 uint32_t m_cpt_cas_locked_rb; // cas blocked by a locked ligne 489 uint32_t m_cpt_write_locked_rb; // wt blocked by a locked ligne 490 491 uint32_t m_cpt_trt_rb; // Read blocked by a hit in trt 492 uint32_t m_cpt_trt_full; // Transaction blocked due to a full trt 493 uint32_t m_cpt_put; 494 uint32_t m_cpt_get; 495 496 uint32_t m_cpt_read_fsm_dir_lock; // wait DIR LOCK 497 uint32_t m_cpt_read_fsm_n_dir_lock; // NB DIR LOCK 498 uint32_t m_cpt_write_fsm_dir_lock; // wait DIR LOCK 499 uint32_t m_cpt_write_fsm_n_dir_lock; // NB DIR LOCK 500 uint32_t m_cpt_xram_rsp_fsm_dir_lock; // wait DIR LOCK 501 uint32_t m_cpt_xram_rsp_fsm_n_dir_lock; // NB DIR LOCK 502 uint32_t m_cpt_cas_fsm_dir_lock; // wait DIR LOCK 503 uint32_t m_cpt_cas_fsm_n_dir_lock; // NB DIR LOCK 504 uint32_t m_cpt_cleanup_fsm_dir_lock; // wait DIR LOCK 505 uint32_t m_cpt_cleanup_fsm_n_dir_lock; // NB DIR LOCK 506 uint32_t m_cpt_multi_ack_fsm_dir_lock; // wait DIR LOCK 507 uint32_t m_cpt_multi_ack_fsm_n_dir_lock; // NB DIR LOCK 508 509 uint32_t m_cpt_dir_unused; // NB cycles DIR LOCK unused 510 uint32_t m_cpt_read_fsm_dir_used; // NB cycles DIR LOCK used 511 uint32_t m_cpt_write_fsm_dir_used; // NB cycles DIR LOCK used 512 uint32_t m_cpt_cas_fsm_dir_used; // NB cycles DIR LOCK used 513 uint32_t m_cpt_xram_rsp_fsm_dir_used; // NB cycles DIR LOCK used 514 uint32_t m_cpt_cleanup_fsm_dir_used; // NB cycles DIR LOCK used 515 uint32_t m_cpt_multi_ack_fsm_dir_used; // NB cycles DIR LOCK used 516 517 uint32_t m_cpt_read_fsm_trt_lock; // wait TRT LOCK 518 uint32_t m_cpt_write_fsm_trt_lock; // wait TRT LOCK 519 uint32_t m_cpt_cas_fsm_trt_lock; // wait TRT LOCK 520 uint32_t m_cpt_xram_rsp_fsm_trt_lock; // wait TRT LOCK 521 uint32_t m_cpt_ixr_fsm_trt_lock; // wait TRT LOCK 522 523 uint32_t m_cpt_read_fsm_n_trt_lock; // NB TRT LOCK 524 uint32_t m_cpt_write_fsm_n_trt_lock; // NB TRT LOCK 525 uint32_t m_cpt_cas_fsm_n_trt_lock; // NB TRT LOCK 526 uint32_t m_cpt_xram_rsp_fsm_n_trt_lock; // NB TRT LOCK 527 uint32_t m_cpt_ixr_cmd_fsm_n_trt_lock; // NB TRT LOCK 528 uint32_t m_cpt_ixr_rsp_fsm_n_trt_lock; // NB TRT LOCK 529 530 uint32_t m_cpt_read_fsm_trt_used; // NB cycles TRT LOCK used 531 uint32_t m_cpt_write_fsm_trt_used; // NB cycles TRT LOCK used 532 uint32_t m_cpt_cas_fsm_trt_used; // NB cycles TRT LOCK used 533 uint32_t m_cpt_xram_rsp_fsm_trt_used; // NB cycles TRT LOCK used 534 uint32_t m_cpt_ixr_cmd_fsm_trt_used; // NB cycles TRT LOCK used 535 uint32_t m_cpt_ixr_rsp_fsm_trt_used; // NB cycles TRT LOCK used 536 uint32_t m_cpt_cleanup_fsm_trt_used; // NB cycles TRT LOCK used 537 538 uint32_t m_cpt_trt_unused; // NB cycles TRT LOCK unused 539 540 uint32_t m_cpt_cleanup_fsm_ivt_lock; // wait ivt LOCK 541 uint32_t m_cpt_cleanup_fsm_n_ivt_lock; // NB cycles UPT LOCK used 542 543 uint32_t m_cpt_multi_ack_fsm_ivt_lock; // wait ivt LOCK 544 uint32_t m_cpt_multi_ack_fsm_n_ivt_lock; // NB cycles UPT LOCK used 545 546 uint32_t m_cpt_ivt_unused; // NB cycles UPT LOCK unused 547 548 uint32_t m_cpt_read_fsm_heap_lock; // wait HEAP LOCK 549 uint32_t m_cpt_write_fsm_heap_lock; // wait HEAP LOCK 550 uint32_t m_cpt_cas_fsm_heap_lock; // wait HEAP LOCK 551 uint32_t m_cpt_cleanup_fsm_heap_lock; // wait HEAP LOCK 552 uint32_t m_cpt_xram_rsp_fsm_heap_lock; // wait HEAP LOCK 553 uint32_t m_cpt_multi_ack_fsm_heap_lock; // wait HEAP LOCK 554 555 uint32_t m_cpt_read_fsm_n_heap_lock; // NB HEAP LOCK 556 uint32_t m_cpt_write_fsm_n_heap_lock; // NB HEAP LOCK 557 uint32_t m_cpt_cas_fsm_n_heap_lock; // NB HEAP LOCK 558 uint32_t m_cpt_cleanup_fsm_n_heap_lock; // NB HEAP LOCK 559 uint32_t m_cpt_xram_rsp_fsm_n_heap_lock; // NB HEAP LOCK 560 uint32_t m_cpt_multi_ack_fsm_n_heap_lock; // NB HEAP LOCK 561 562 uint32_t m_cpt_read_fsm_heap_used; // NB cycles HEAP LOCK used 563 uint32_t m_cpt_write_fsm_heap_used; // NB cycles HEAP LOCK used 564 uint32_t m_cpt_cas_fsm_heap_used; // NB cycles HEAP LOCK used 565 uint32_t m_cpt_cleanup_fsm_heap_used; // NB cycles HEAP LOCK used 566 uint32_t m_cpt_xram_rsp_fsm_heap_used; // NB cycles HEAP LOCK used 567 uint32_t m_cpt_multi_ack_fsm_heap_used; // NB cycles HEAP LOCK used 568 569 uint32_t m_cpt_heap_unused; // NB cycles HEAP LOCK unused 570 uint32_t m_cpt_slot_inval; 478 uint32_t m_cpt_trt_rb; // Read blocked by a hit in trt 479 uint32_t m_cpt_trt_full; // Transaction blocked due to a full trt 480 uint32_t m_cpt_put; 481 uint32_t m_cpt_get; 482 483 uint32_t m_cpt_heap_unused; // NB cycles HEAP LOCK unused 484 uint32_t m_cpt_slot_inval; 571 485 572 486 protected: … … 602 516 sc_out<int> p_cc_send_fsm; 603 517 sc_out<int> p_cc_receive_fsm; 604 sc_out<int> p_multi_ack_fsm; 518 sc_out<int> p_multi_ack_fsm; 605 519 #endif 606 520 … … 611 525 const soclib::common::IntTab &srcid_x, // global index RAM network 612 526 const soclib::common::IntTab &tgtid_d, // global index INT network 613 const size_t cc_global_id, // global index CC network614 527 const size_t x_width, // X width in platform 615 528 const size_t y_width, // Y width in platform … … 654 567 const size_t m_sets; // Number of cache sets 655 568 const size_t m_words; // Number of words in a line 656 const size_t m_cc_global_id; // global_index on cc network 657 const size_t m_xwidth; // number of x bits in platform 658 const size_t m_ywidth; // number of y bits in platform 569 size_t m_x_self; // X self coordinate 570 size_t m_y_self; // Y self coordinate 571 const size_t m_x_width; // number of x bits in platform 572 const size_t m_y_width; // number of y bits in platform 659 573 size_t m_debug_start_cycle; 660 574 bool m_debug_ok;
Note: See TracChangeset
for help on using the changeset viewer.