Changeset 385
- Timestamp:
- May 1, 2013, 4:13:23 PM (12 years ago)
- Location:
- trunk/modules/vci_mem_cache/caba
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache/caba/metadata/vci_mem_cache.sd
r351 r385 9 9 10 10 tmpl_parameters = [ 11 parameter.Module('vci_param' , default = 'caba:vci_param') 11 parameter.Module('vci_param_int'), 12 parameter.Module('vci_param_ext'), 13 parameter.Int('dspin_in_width'), 14 parameter.Int('dspin_out_width'), 12 15 ], 13 16 … … 32 35 ports = [ 33 36 Port( 'caba:vci_target' , 'p_vci_tgt' ), 34 Port( 35 'caba:dspin_input', 36 'p_dspin_in', 37 dspin_data_size = 33, 38 ), 39 Port( 40 'caba:dspin_output', 41 'p_dspin_out', 42 dspin_data_size = 40, 43 ), 37 Port( 'caba:dspin_input' , 'p_dspin_in', dspin_data_size = 33 ), 38 Port( 'caba:dspin_output' , 'p_dspin_out', dspin_data_size = 40 ), 44 39 Port( 'caba:vci_initiator', 'p_vci_ixr' ), 45 40 Port( 'caba:bit_in' , 'p_resetn' , auto = 'resetn' ), -
trunk/modules/vci_mem_cache/caba/source/include/mem_cache_directory.h
r307 r385 40 40 //////////////////////////////////////////////////////////////////////// 41 41 class Owner{ 42 typedef uint32_t size_t;43 42 44 43 public: … … 92 91 93 92 typedef uint32_t tag_t; 94 typedef uint32_t size_t;95 93 96 94 public: … … 165 163 void print() 166 164 { 167 std::cout << "Valid = " << valid << " ; IS COUNT = " << is_cnt << " ; Dirty = " << dirty << " ; Lock = " 168 << lock 165 std::cout << "Valid = " << valid 166 << " ; IS COUNT = " << is_cnt 167 << " ; Dirty = " << dirty 168 << " ; Lock = " << lock 169 169 << " ; Tag = " << std::hex << tag << std::dec 170 170 << " ; Count = " << count … … 187 187 typedef uint32_t data_t; 188 188 typedef uint32_t tag_t; 189 typedef uint32_t size_t;190 189 191 190 private: … … 408 407 /////////////////////////////////////////////////////////////////////// 409 408 class HeapEntry{ 410 typedef uint32_t size_t;411 409 412 410 public: … … 472 470 //////////////////////////////////////////////////////////////////////// 473 471 class HeapDirectory{ 474 typedef uint32_t size_t;475 472 476 473 private: -
trunk/modules/vci_mem_cache/caba/source/include/update_tab.h
r307 r385 126 126 class UpdateTab{ 127 127 128 typedef uint32_t size_t;129 128 typedef sc_dt::sc_uint<40> addr_t; 130 129 -
trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r362 r385 58 58 using namespace sc_core; 59 59 60 template<typename vci_param> 60 template<typename vci_param_int, 61 typename vci_param_ext, 62 size_t dspin_in_width, 63 size_t dspin_out_width> 61 64 class VciMemCache 62 65 : public soclib::caba::BaseModule 63 66 { 64 typedef sc_dt::sc_uint<40> addr_t; 65 typedef typename vci_param::fast_addr_t vci_addr_t; 67 typedef typename vci_param_int::fast_addr_t addr_t; 68 69 typedef typename sc_dt::sc_uint<64> wide_data_t; 70 66 71 typedef uint32_t data_t; 67 72 typedef uint32_t tag_t; 68 typedef uint32_t size_t;69 73 typedef uint32_t be_t; 70 74 typedef uint32_t copy_t; … … 343 347 344 348 bool m_monitor_ok; 345 vci_addr_tm_monitor_base;346 vci_addr_tm_monitor_length;349 addr_t m_monitor_base; 350 addr_t m_monitor_length; 347 351 348 352 // instrumentation counters … … 373 377 374 378 public: 375 sc_in<bool> p_clk;376 sc_in<bool> p_resetn;377 soclib::caba::VciTarget<vci_param >p_vci_tgt;378 soclib::caba::VciInitiator<vci_param >p_vci_ixr;379 soclib::caba::DspinInput< 33>p_dspin_in;380 soclib::caba::DspinOutput< 40>p_dspin_out;379 sc_in<bool> p_clk; 380 sc_in<bool> p_resetn; 381 soclib::caba::VciTarget<vci_param_int> p_vci_tgt; 382 soclib::caba::VciInitiator<vci_param_ext> p_vci_ixr; 383 soclib::caba::DspinInput<dspin_in_width> p_dspin_in; 384 soclib::caba::DspinOutput<dspin_out_width> p_dspin_out; 381 385 382 386 VciMemCache( … … 401 405 void print_stats(); 402 406 void print_trace(); 403 void copies_monitor( vci_addr_t addr);404 void start_monitor( vci_addr_t addr, vci_addr_t length);407 void copies_monitor(addr_t addr); 408 void start_monitor(addr_t addr, addr_t length); 405 409 void stop_monitor(); 406 410 … … 409 413 void transition(); 410 414 void genMoore(); 411 void check_monitor( const char *buf, vci_addr_t addr, data_t data); 412 void check_monitor_read( const char *buf, vci_addr_t addr); 415 void check_monitor( const char *buf, addr_t addr, data_t data, bool read); 413 416 414 417 // Component attributes … … 436 439 < 32 , // number of slots 437 440 4096, // number of processors in the system 438 8000, // registratioçn life span (in # of LL operations) 439 typename vci_param::fast_addr_t > // address type 440 m_llsc_table; // ll/sc global registration table 441 8000, // registration life (# of LL operations) 442 addr_t > m_llsc_table; // ll/sc global registration table 441 443 442 444 // adress masks 443 const soclib::common::AddressMaskingTable< vci_addr_t> m_x;444 const soclib::common::AddressMaskingTable< vci_addr_t> m_y;445 const soclib::common::AddressMaskingTable< vci_addr_t> m_z;446 const soclib::common::AddressMaskingTable< vci_addr_t> m_nline;445 const soclib::common::AddressMaskingTable<addr_t> m_x; 446 const soclib::common::AddressMaskingTable<addr_t> m_y; 447 const soclib::common::AddressMaskingTable<addr_t> m_z; 448 const soclib::common::AddressMaskingTable<addr_t> m_nline; 447 449 448 450 // broadcast address … … 454 456 455 457 // Fifo between TGT_CMD fsm and READ fsm 456 GenericFifo< uint64_t>m_cmd_read_addr_fifo;458 GenericFifo<addr_t> m_cmd_read_addr_fifo; 457 459 GenericFifo<size_t> m_cmd_read_length_fifo; 458 460 GenericFifo<size_t> m_cmd_read_srcid_fifo; … … 461 463 462 464 // Fifo between TGT_CMD fsm and WRITE fsm 463 GenericFifo< uint64_t>m_cmd_write_addr_fifo;465 GenericFifo<addr_t> m_cmd_write_addr_fifo; 464 466 GenericFifo<bool> m_cmd_write_eop_fifo; 465 467 GenericFifo<size_t> m_cmd_write_srcid_fifo; … … 470 472 471 473 // Fifo between TGT_CMD fsm and CAS fsm 472 GenericFifo< uint64_t>m_cmd_cas_addr_fifo;474 GenericFifo<addr_t> m_cmd_cas_addr_fifo; 473 475 GenericFifo<bool> m_cmd_cas_eop_fifo; 474 476 GenericFifo<size_t> m_cmd_cas_srcid_fifo; … … 504 506 sc_signal<size_t> r_read_next_ptr; // Next entry to point to 505 507 sc_signal<bool> r_read_last_free; // Last free entry 506 sc_signal<typename vci_param::fast_addr_t> 507 r_read_ll_key; // LL key returned by the llsc_global_table 508 sc_signal<addr_t> r_read_ll_key; // LL key from the llsc_global_table 508 509 509 510 // Buffer between READ fsm and IXR_CMD fsm (ask a missing cache line to XRAM) … … 520 521 sc_signal<size_t> r_read_to_tgt_rsp_word; // first word of the response 521 522 sc_signal<size_t> r_read_to_tgt_rsp_length; // length of the response 522 sc_signal<typename vci_param::fast_addr_t> 523 r_read_to_tgt_rsp_ll_key; // LL key returned by the llsc_global_table 523 sc_signal<addr_t> r_read_to_tgt_rsp_ll_key; // LL key from the llsc_global_table 524 524 525 525 /////////////////////////////////////////////////////////////// … … 578 578 GenericFifo<bool> m_write_to_cc_send_inst_fifo; // fifo for the L1 type 579 579 GenericFifo<size_t> m_write_to_cc_send_srcid_fifo; // fifo for srcids 580 580 581 #if L1_MULTI_CACHE 581 582 GenericFifo<size_t> m_write_to_cc_send_cache_id_fifo; // fifo for srcids … … 703 704 GenericFifo<bool> m_cas_to_cc_send_inst_fifo; // fifo for the L1 type 704 705 GenericFifo<size_t> m_cas_to_cc_send_srcid_fifo; // fifo for srcids 706 705 707 #if L1_MULTI_CACHE 706 708 GenericFifo<size_t> m_cas_to_cc_send_cache_id_fifo; // fifo for srcids … … 749 751 sc_signal<size_t> r_xram_rsp_to_tgt_rsp_length; // length of the response 750 752 sc_signal<bool> r_xram_rsp_to_tgt_rsp_rerror; // send error to requester 751 sc_signal<typename vci_param::fast_addr_t> 752 r_xram_rsp_to_tgt_rsp_ll_key; // LL key returned by the llsc_global_table 753 sc_signal<addr_t> r_xram_rsp_to_tgt_rsp_ll_key; // LL key from llsc_global_table 753 754 754 755 // Buffer between XRAM_RSP fsm and CC_SEND fsm (Inval L1 Caches) … … 759 760 GenericFifo<bool> m_xram_rsp_to_cc_send_inst_fifo; // fifo for the L1 type 760 761 GenericFifo<size_t> m_xram_rsp_to_cc_send_srcid_fifo; // fifo for srcids 762 761 763 #if L1_MULTI_CACHE 762 764 GenericFifo<size_t> m_xram_rsp_to_cc_send_cache_id_fifo; // fifo for srcids -
trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h
r362 r385 14 14 15 15 class TransactionTabEntry { 16 typedef uint32_t size_t; 16 typedef sc_dt::sc_uint<64> wide_data_t; 17 typedef sc_dt::sc_uint<40> addr_t; 17 18 typedef uint32_t data_t; 18 typedef sc_dt::sc_uint<40> addr_t;19 19 typedef uint32_t be_t; 20 20 … … 138 138 //////////////////////////////////////////////////////////////////////// 139 139 class TransactionTab{ 140 typedef uint32_t size_t;141 typedef uint32_t data_t;142 typedef sc_dt::sc_uint<40> addr_t;143 typedef uint32_t be_t;140 typedef sc_dt::sc_uint<64> wide_data_t; 141 typedef sc_dt::sc_uint<40> addr_t; 142 typedef uint32_t data_t; 143 typedef uint32_t be_t; 144 144 145 145 private: … … 368 368 369 369 ///////////////////////////////////////////////////////////////////// 370 // The write_rsp() function writes a word of the response to an371 // XRAM read transaction.370 // The write_rsp() function writes two 32 bits words of the response 371 // to a XRAM read transaction. 372 372 // The BE field in TRT is taken into account. 373 373 // Arguments : 374 374 // - index : the index of the transaction in the transaction tab 375 375 // - word_index : the index of the data in the line 376 // - data : the data to write376 // - data : a 64 bits value 377 377 // - error : invalid data 378 378 ///////////////////////////////////////////////////////////////////// 379 void write_rsp(const size_t index, 380 const size_t word, 381 const data_t data, 382 const bool rerror) 383 { 379 void write_rsp(const size_t index, 380 const size_t word, 381 const wide_data_t data, 382 const bool rerror) 383 { 384 data_t value; 385 data_t mask; 386 384 387 assert( (index < size_tab) 385 388 && "Selected entry out of range in write_rsp() Transaction Tab"); … … 391 394 && "Selected entry is not an XRAM read transaction in write_rsp()"); 392 395 393 data_t mask = be_to_mask(tab[index].wdata_be[word]); 394 tab[index].wdata[word] = (tab[index].wdata[word] & mask) | (data & ~mask); 396 // first 32 bits word 397 value = (data_t)data; 398 mask = be_to_mask(tab[index].wdata_be[word]); 399 tab[index].wdata[word] = (tab[index].wdata[word] & mask) | (value & ~mask); 400 401 // second 32 bits word 402 value = (data_t)(data>>32); 403 mask = be_to_mask(tab[index].wdata_be[word+1]); 404 tab[index].wdata[word+1] = (tab[index].wdata[word+1] & mask) | (value & ~mask); 405 406 // error update 395 407 tab[index].rerror |= rerror; 396 408 } -
trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r367 r385 40 40 ///////////////////////////////////////////////////////////////////////////////// 41 41 42 #define DEBUG_MEMC_GLOBAL 0 // synthetic trace of all FSMs43 #define DEBUG_MEMC_READ 1 // detailed trace of READ FSM44 #define DEBUG_MEMC_WRITE 1 // detailed trace of WRITE FSM45 #define DEBUG_MEMC_CAS 1 // detailed trace of CAS FSM46 #define DEBUG_MEMC_IXR_CMD 1 // detailed trace of IXR_RSP FSM47 #define DEBUG_MEMC_IXR_RSP 1 // detailed trace of IXR_RSP FSM48 #define DEBUG_MEMC_XRAM_RSP 1 // detailed trace of XRAM_RSP FSM49 #define DEBUG_MEMC_CC_SEND 1 // detailed trace of CC_SEND FSM42 #define DEBUG_MEMC_GLOBAL 0 // synthetic trace of all FSMs 43 #define DEBUG_MEMC_READ 1 // detailed trace of READ FSM 44 #define DEBUG_MEMC_WRITE 1 // detailed trace of WRITE FSM 45 #define DEBUG_MEMC_CAS 1 // detailed trace of CAS FSM 46 #define DEBUG_MEMC_IXR_CMD 1 // detailed trace of IXR_RSP FSM 47 #define DEBUG_MEMC_IXR_RSP 1 // detailed trace of IXR_RSP FSM 48 #define DEBUG_MEMC_XRAM_RSP 1 // detailed trace of XRAM_RSP FSM 49 #define DEBUG_MEMC_CC_SEND 1 // detailed trace of CC_SEND FSM 50 50 #define DEBUG_MEMC_MULTI_ACK 1 // detailed trace of MULTI_ACK FSM 51 #define DEBUG_MEMC_TGT_CMD 1 // detailed trace of TGT_CMD FSM52 #define DEBUG_MEMC_TGT_RSP 1 // detailed trace of TGT_RSP FSM53 #define DEBUG_MEMC_CLEANUP 1 // detailed trace of CLEANUP FSM54 55 #define RANDOMIZE_CAS 151 #define DEBUG_MEMC_TGT_CMD 1 // detailed trace of TGT_CMD FSM 52 #define DEBUG_MEMC_TGT_RSP 1 // detailed trace of TGT_RSP FSM 53 #define DEBUG_MEMC_CLEANUP 1 // detailed trace of CLEANUP FSM 54 55 #define RANDOMIZE_CAS 1 56 56 57 57 namespace soclib … … 273 273 274 274 #define tmpl(x) \ 275 template<typename vci_param> x \ 276 VciMemCache<vci_param> 275 template<typename vci_param_int, \ 276 typename vci_param_ext, \ 277 size_t dspin_in_width, \ 278 size_t dspin_out_width> x \ 279 VciMemCache<vci_param_int, vci_param_ext, dspin_in_width, dspin_out_width> 277 280 278 281 using namespace soclib::common; … … 311 314 m_nseg( 0 ), 312 315 m_srcid_x( mtx.indexForId(srcid_x) ), 313 m_initiators( 1 << vci_param ::S ),316 m_initiators( 1 << vci_param_int::S ), 314 317 m_heap_size( heap_size ), 315 318 m_ways( nways ), … … 323 326 m_upt_lines(upt_lines), 324 327 m_upt(upt_lines), 325 m_cache_directory(nways, nsets, nwords, vci_param ::N),328 m_cache_directory(nways, nsets, nwords, vci_param_int::N), 326 329 m_cache_data(nways, nsets, nwords), 327 330 m_heap(m_heap_size), … … 332 335 m_x(L2(m_words), 2), 333 336 m_y(L2(m_sets), L2(m_words) + 2), 334 m_z(vci_param ::N - L2(m_sets) - L2(m_words) - 2, L2(m_sets) + L2(m_words) + 2),335 m_nline(vci_param ::N - L2(m_words) - 2, L2(m_words) + 2),337 m_z(vci_param_int::N - L2(m_sets) - L2(m_words) - 2, L2(m_sets) + L2(m_words) + 2), 338 m_nline(vci_param_int::N - L2(m_words) - 2, L2(m_words) + 2), 336 339 #undef L2 337 340 … … 420 423 421 424 // check Transaction table size 422 assert((uint32_log2(trt_lines) <= vci_param::T) and 423 "Need more bits for VCI TRDID field"); 424 425 assert((uint32_log2(trt_lines) <= vci_param_ext::T) and 426 "MEMC ERROR : Need more bits for VCI TRDID field"); 427 428 // check internal and external data width 429 assert( (vci_param_int::B == 4 ) and 430 "MEMC ERROR : VCI internal data width must be 32 bits"); 431 432 assert( (vci_param_ext::B == 8 ) and 433 "MEMC ERROR : VCI external data width must be 32 or 64 bits"); 434 435 // Check coherence between internal & external addresses 436 assert( (vci_param_int::N == vci_param_ext::N) and 437 "MEMC ERROR : VCI internal & external addresses must have the same width"); 438 425 439 // Get the segments associated to the MemCache 426 440 std::list<soclib::common::Segment>::iterator seg; … … 475 489 476 490 /////////////////////////////////////////////////////////////////////// 477 tmpl(void) ::start_monitor( vci_addr_t addr, vci_addr_t length)491 tmpl(void) ::start_monitor(addr_t addr, addr_t length) 478 492 /////////////////////////////////////////////////////////////////////// 479 493 { … … 490 504 } 491 505 492 /////////////////////////////////////////////////////////////////////// 493 tmpl(void) ::check_monitor(const char *buf, vci_addr_t addr, data_t data) 494 /////////////////////////////////////////////////////////////////////// 506 //////////////////////////////////////////////// 507 tmpl(void) ::check_monitor( const char *buf, 508 addr_t addr, 509 data_t data, 510 bool read ) 511 //////////////////////////////////////////////// 495 512 { 496 513 if((addr >= m_monitor_base) and 497 514 (addr < m_monitor_base + m_monitor_length)) 498 515 { 499 std::cout << " MEMC Write Monitor : " << buf << " Address = " << std::hex << addr 500 << " / Data = " << data << " at cycle " << std::dec << m_cpt_cycles << std::endl; 516 if ( read ) std::cout << " MEMC Read Monitor "; 517 else std::cout << " MEMC Write Monitor "; 518 std::cout << buf 519 << " Address = " << std::hex << addr 520 << " / Data = " << data 521 << " at cycle " << std::dec << m_cpt_cycles << std::endl; 501 522 } 502 523 } 503 524 504 ///////////////////////////////////////////////////////////////////////505 tmpl(void) ::check_monitor_read(const char *buf, vci_addr_t addr)506 ///////////////////////////////////////////////////////////////////////507 {508 if((addr >= m_monitor_base) and509 (addr < m_monitor_base + m_monitor_length))510 {511 std::cout << " MEMC Read Monitor : " << buf << " Address = " << std::hex << addr512 << std::endl;513 }514 }515 516 525 ///////////////////////////////////////////////////// 517 tmpl(void) ::copies_monitor( vci_addr_t addr)526 tmpl(void) ::copies_monitor(addr_t addr) 518 527 ///////////////////////////////////////////////////// 519 528 { … … 632 641 m_debug_tgt_cmd_fsm = false; 633 642 m_debug_tgt_rsp_fsm = false; 634 m_debug_cc_send_fsm = false;635 m_debug_cc_receive_fsm 643 m_debug_cc_send_fsm = false; 644 m_debug_cc_receive_fsm = false; 636 645 m_debug_multi_ack_fsm = false; 637 646 m_debug_read_fsm = false; … … 864 873 std::cout 865 874 << " <MEMC " << name() 866 << " .TGT_CMD_IDLE> Receive command from srcid "875 << " TGT_CMD_IDLE> Receive command from srcid " 867 876 << std::dec << p_vci_tgt.srcid.read() 868 877 << " / for address " … … 872 881 #endif 873 882 // checking segmentation violation 874 vci_addr_t address = p_vci_tgt.address.read();883 addr_t address = p_vci_tgt.address.read(); 875 884 uint32_t plen = p_vci_tgt.plen.read(); 876 885 bool found = false; … … 878 887 { 879 888 if(m_seg[seg_id]->contains(address) && 880 m_seg[seg_id]->contains(address + plen - vci_param ::B))889 m_seg[seg_id]->contains(address + plen - vci_param_int::B)) 881 890 { 882 891 found = true; … … 893 902 } 894 903 895 if(p_vci_tgt.cmd.read() == vci_param ::CMD_READ)904 if(p_vci_tgt.cmd.read() == vci_param_int::CMD_READ) 896 905 { 897 906 // check that the pktid is either : … … 906 915 r_tgt_cmd_fsm = TGT_CMD_READ; 907 916 } 908 else if(p_vci_tgt.cmd.read() == vci_param ::CMD_WRITE)917 else if(p_vci_tgt.cmd.read() == vci_param_int::CMD_WRITE) 909 918 { 910 919 // check that the pktid is TYPE_WRITE … … 915 924 r_tgt_cmd_fsm = TGT_CMD_WRITE; 916 925 } 917 else if(p_vci_tgt.cmd.read() == vci_param ::CMD_LOCKED_READ)926 else if(p_vci_tgt.cmd.read() == vci_param_int::CMD_LOCKED_READ) 918 927 { 919 928 // check that the pktid is TYPE_LL … … 924 933 r_tgt_cmd_fsm = TGT_CMD_READ; 925 934 } 926 else if(p_vci_tgt.cmd.read() == vci_param ::CMD_NOP)935 else if(p_vci_tgt.cmd.read() == vci_param_int::CMD_NOP) 927 936 { 928 937 // check that the pktid is either : … … 954 963 // This test checks that the read does not cross a cache line limit. 955 964 // It must not be taken into account when dealing with an LL CMD. 956 if(((m_x[(vci_addr_t) p_vci_tgt.address.read()]+ (p_vci_tgt.plen.read() >>2)) > 16) && (p_vci_tgt.cmd.read() != vci_param::CMD_LOCKED_READ)) 965 if(((m_x[(addr_t) p_vci_tgt.address.read()]+ (p_vci_tgt.plen.read() >>2)) > 16) && 966 (p_vci_tgt.cmd.read() != vci_param_int::CMD_LOCKED_READ)) 957 967 { 958 968 std::cout … … 973 983 exit(0); 974 984 } 975 if((p_vci_tgt.cmd.read() == vci_param ::CMD_LOCKED_READ) && (p_vci_tgt.plen.read() != 8))985 if((p_vci_tgt.cmd.read() == vci_param_int::CMD_LOCKED_READ) && (p_vci_tgt.plen.read() != 8)) 976 986 { 977 987 std::cout … … 990 1000 if(m_debug_tgt_cmd_fsm) 991 1001 { 992 std::cout << " <MEMC " << name() << " .TGT_CMD_READ> Push into read_fifo:"1002 std::cout << " <MEMC " << name() << " TGT_CMD_READ> Push into read_fifo:" 993 1003 << " address = " << std::hex << p_vci_tgt.address.read() 994 1004 << " srcid = " << std::dec << p_vci_tgt.srcid.read() … … 999 1009 #endif 1000 1010 cmd_read_fifo_put = true; 1001 if(p_vci_tgt.cmd.read() == vci_param ::CMD_LOCKED_READ)1011 if(p_vci_tgt.cmd.read() == vci_param_int::CMD_LOCKED_READ) 1002 1012 m_cpt_ll++; 1003 1013 else … … 1015 1025 if(m_debug_tgt_cmd_fsm) 1016 1026 { 1017 std::cout << " <MEMC " << name() << " .TGT_CMD_WRITE> Push into write_fifo:"1027 std::cout << " <MEMC " << name() << " TGT_CMD_WRITE> Push into write_fifo:" 1018 1028 << " address = " << std::hex << p_vci_tgt.address.read() 1019 1029 << " srcid = " << std::dec << p_vci_tgt.srcid.read() … … 1048 1058 if(m_debug_tgt_cmd_fsm) 1049 1059 { 1050 std::cout << " <MEMC " << name() << " .TGT_CMD_CAS> Pushing command into cmd_cas_fifo:"1060 std::cout << " <MEMC " << name() << " TGT_CMD_CAS> Pushing command into cmd_cas_fifo:" 1051 1061 << " address = " << std::hex << p_vci_tgt.address.read() 1052 1062 << " srcid = " << std::dec << p_vci_tgt.srcid.read() … … 1153 1163 std::cout 1154 1164 << " <MEMC " << name() 1155 << " .MULTI_ACK_IDLE> Response for UPT entry "1165 << " MULTI_ACK_IDLE> Response for UPT entry " 1156 1166 << updt_index 1157 1167 << std::endl; … … 1195 1205 std::cout 1196 1206 << " <MEMC " << name() 1197 << " .MULTI_ACK_UPT_LOCK> Decrement the responses counter for UPT:"1207 << " MULTI_ACK_UPT_LOCK> Decrement the responses counter for UPT:" 1198 1208 << " entry = " << r_multi_ack_upt_index.read() 1199 1209 << " / rsp_count = " << std::dec << count … … 1240 1250 std::cout 1241 1251 << " <MEMC " << name() 1242 << " .MULTI_ACK_UPT_CLEAR> Clear UPT entry "1252 << " MULTI_ACK_UPT_CLEAR> Clear UPT entry " 1243 1253 << r_multi_ack_upt_index.read() 1244 1254 << std::endl; … … 1265 1275 std::cout 1266 1276 << " <MEMC " << name() 1267 << " .MULTI_ACK_WRITE_RSP> Request TGT_RSP FSM to send a response to srcid "1277 << " MULTI_ACK_WRITE_RSP> Request TGT_RSP FSM to send a response to srcid " 1268 1278 << r_multi_ack_srcid.read() 1269 1279 << std::endl; … … 1309 1319 if(m_debug_read_fsm) 1310 1320 { 1311 std::cout << " <MEMC " << name() << " .READ_IDLE> Read request:"1321 std::cout << " <MEMC " << name() << " READ_IDLE> Read request:" 1312 1322 << " srcid = " << std::dec << m_cmd_read_srcid_fifo.read() 1313 1323 << " / address = " << std::hex << m_cmd_read_addr_fifo.read() … … 1334 1344 { 1335 1345 std::cout 1336 << " <MEMC " << name() << " .READ_DIR_REQ> Requesting DIR lock "1346 << " <MEMC " << name() << " READ_DIR_REQ> Requesting DIR lock " 1337 1347 << std::endl; 1338 1348 } … … 1393 1403 { 1394 1404 std::cout 1395 << " <MEMC " << name() << " .READ_DIR_LOCK> Accessing directory: "1405 << " <MEMC " << name() << " READ_DIR_LOCK> Accessing directory: " 1396 1406 << " address = " << std::hex << m_cmd_read_addr_fifo.read() 1397 1407 << " / hit = " << std::dec << entry.valid … … 1401 1411 { 1402 1412 std::cout 1403 << " <MEMC " << name() << " .READ_DIR_LOCK> global_llsc_table LL access" << std::endl;1413 << " <MEMC " << name() << " READ_DIR_LOCK> global_llsc_table LL access" << std::endl; 1404 1414 } 1405 1415 } … … 1441 1451 1442 1452 // read data in the cache 1443 size_t set = m_y[( vci_addr_t)(m_cmd_read_addr_fifo.read())];1453 size_t set = m_y[(addr_t)(m_cmd_read_addr_fifo.read())]; 1444 1454 size_t way = r_read_way.read(); 1445 1455 … … 1451 1461 entry.is_cnt = is_cnt; 1452 1462 entry.dirty = r_read_dirty.read(); 1453 entry.tag = r_read_tag.read();1463 entry.tag = r_read_tag.read(); 1454 1464 entry.lock = r_read_lock.read(); 1455 1465 entry.ptr = r_read_ptr.read(); … … 1489 1499 { 1490 1500 std::cout 1491 << " <MEMC " << name() << " .READ_DIR_HIT> Update directory entry:"1501 << " <MEMC " << name() << " READ_DIR_HIT> Update directory entry:" 1492 1502 << " addr = " << std::hex << m_cmd_read_addr_fifo.read() 1493 1503 << " / set = " << std::dec << set … … 1499 1509 } 1500 1510 #endif 1501 /**/ 1511 1502 1512 if(m_monitor_ok) 1503 1513 { 1504 1514 char buf[80]; 1505 snprintf(buf, 80, "READ_DIR_HIT srcid %d, ins %d", m_cmd_read_srcid_fifo.read(), ((m_cmd_read_pktid_fifo.read()&0x2)!=0)); 1506 check_monitor_read(buf, m_cmd_read_addr_fifo.read()); 1515 snprintf(buf, 80, "READ_DIR_HIT srcid %d, ins %d", 1516 (int)m_cmd_read_srcid_fifo.read(), 1517 (int)((m_cmd_read_pktid_fifo.read()&0x2)!=0)); 1518 check_monitor(buf, m_cmd_read_addr_fifo.read(), r_read_data[0], true); 1507 1519 } 1508 /**/ 1520 1509 1521 1510 1522 m_cache_directory.write(set, way, entry); … … 1518 1530 // Get the lock to the HEAP directory 1519 1531 { 1520 /**/1521 if(m_monitor_ok)1522 {1523 char buf[80];1524 snprintf(buf, 80, "READ_HEAP_REQ srcid %d, ins %d", m_cmd_read_srcid_fifo.read(), ((m_cmd_read_pktid_fifo.read()&0x2)!=0));1525 check_monitor_read(buf, m_cmd_read_addr_fifo.read());1526 }1527 /**/1528 1532 if(r_alloc_heap_fsm.read() == ALLOC_HEAP_READ) 1529 1533 { … … 1535 1539 { 1536 1540 std::cout 1537 << " <MEMC " << name() << " .READ_HEAP_REQ> Requesting HEAP lock "1541 << " <MEMC " << name() << " READ_HEAP_REQ> Requesting HEAP lock " 1538 1542 << std::endl; 1539 1543 } … … 1553 1557 1554 1558 // read data in the cache 1555 size_t set = m_y[( vci_addr_t)(m_cmd_read_addr_fifo.read())];1559 size_t set = m_y[(addr_t)(m_cmd_read_addr_fifo.read())]; 1556 1560 size_t way = r_read_way.read(); 1557 1561 … … 1625 1629 if(m_debug_read_fsm) 1626 1630 { 1627 std::cout << " <MEMC " << name() << " .READ_HEAP_LOCK> Update directory:"1631 std::cout << " <MEMC " << name() << " READ_HEAP_LOCK> Update directory:" 1628 1632 << " tag = " << std::hex << entry.tag 1629 1633 << " set = " << std::dec << set … … 1677 1681 { 1678 1682 std::cout 1679 << " <MEMC " << name() << " .READ_HEAP_WRITE> Add an entry in the heap:"1683 << " <MEMC " << name() << " READ_HEAP_WRITE> Add an entry in the heap:" 1680 1684 << " owner_id = " << heap_entry.owner.srcid 1681 1685 << " owner_ins = " << heap_entry.owner.inst << std::endl; … … 1763 1767 { 1764 1768 for(size_t i=0 ; i<m_words ; i++) r_read_to_tgt_rsp_data[i] = r_read_data[i]; 1765 r_read_to_tgt_rsp_word = m_x[( vci_addr_t) m_cmd_read_addr_fifo.read()];1769 r_read_to_tgt_rsp_word = m_x[(addr_t) m_cmd_read_addr_fifo.read()]; 1766 1770 r_read_to_tgt_rsp_length = m_cmd_read_length_fifo.read(); 1767 1771 r_read_to_tgt_rsp_srcid = m_cmd_read_srcid_fifo.read(); … … 1776 1780 if(m_debug_read_fsm) 1777 1781 { 1778 std::cout << " <MEMC " << name() << " .READ_RSP> Request the TGT_RSP FSM to return data:"1782 std::cout << " <MEMC " << name() << " READ_RSP> Request the TGT_RSP FSM to return data:" 1779 1783 << " rsrcid = " << std::dec << m_cmd_read_srcid_fifo.read() 1780 1784 << " / address = " << std::hex << m_cmd_read_addr_fifo.read() … … 1792 1796 { 1793 1797 size_t index = 0; 1794 vci_addr_t addr = (vci_addr_t) m_cmd_read_addr_fifo.read();1798 addr_t addr = (addr_t) m_cmd_read_addr_fifo.read(); 1795 1799 bool hit_read = m_trt.hit_read(m_nline[addr], index); 1796 1800 bool hit_write = m_trt.hit_write(m_nline[addr]); … … 1813 1817 if(m_debug_read_fsm) 1814 1818 { 1815 std::cout << " <MEMC " << name() << " .READ_TRT_LOCK> Check TRT:"1819 std::cout << " <MEMC " << name() << " READ_TRT_LOCK> Check TRT:" 1816 1820 << " hit_read = " << hit_read 1817 1821 << " / hit_write = " << hit_write … … 1830 1834 m_trt.set(r_read_trt_index.read(), 1831 1835 true, 1832 m_nline[( vci_addr_t)(m_cmd_read_addr_fifo.read())],1836 m_nline[(addr_t)(m_cmd_read_addr_fifo.read())], 1833 1837 m_cmd_read_srcid_fifo.read(), 1834 1838 m_cmd_read_trdid_fifo.read(), … … 1836 1840 true, 1837 1841 m_cmd_read_length_fifo.read(), 1838 m_x[( vci_addr_t)(m_cmd_read_addr_fifo.read())],1842 m_x[(addr_t)(m_cmd_read_addr_fifo.read())], 1839 1843 std::vector<be_t> (m_words,0), 1840 1844 std::vector<data_t> (m_words,0), … … 1843 1847 if(m_debug_read_fsm) 1844 1848 { 1845 std::cout << " <MEMC " << name() << " .READ_TRT_SET> Write in Transaction Table: " << std::hex1849 std::cout << " <MEMC " << name() << " READ_TRT_SET> Write in Transaction Table: " << std::hex 1846 1850 << " address = " << std::hex << m_cmd_read_addr_fifo.read() 1847 1851 << " / srcid = " << std::dec << m_cmd_read_srcid_fifo.read() … … 1864 1868 cmd_read_fifo_get = true; 1865 1869 r_read_to_ixr_cmd_req = true; 1866 r_read_to_ixr_cmd_nline = m_nline[( vci_addr_t)(m_cmd_read_addr_fifo.read())];1870 r_read_to_ixr_cmd_nline = m_nline[(addr_t)(m_cmd_read_addr_fifo.read())]; 1867 1871 r_read_to_ixr_cmd_trdid = r_read_trt_index.read(); 1868 1872 r_read_fsm = READ_IDLE; … … 1872 1876 { 1873 1877 std::cout 1874 << " <MEMC " << name() << " .READ_TRT_REQ> Request GET transaction for address "1878 << " <MEMC " << name() << " READ_TRT_REQ> Request GET transaction for address " 1875 1879 << std::hex << m_cmd_read_addr_fifo.read() << std::endl; 1876 1880 } … … 1929 1933 // consume a word in the FIFO & write it in the local buffer 1930 1934 cmd_write_fifo_get = true; 1931 size_t index = m_x[( vci_addr_t)(m_cmd_write_addr_fifo.read())];1935 size_t index = m_x[(addr_t)(m_cmd_write_addr_fifo.read())]; 1932 1936 1933 1937 r_write_address = (addr_t)(m_cmd_write_addr_fifo.read()); … … 1959 1963 if(m_debug_write_fsm) 1960 1964 { 1961 std::cout << " <MEMC " << name() << " .WRITE_IDLE> Write request "1965 std::cout << " <MEMC " << name() << " WRITE_IDLE> Write request " 1962 1966 << " srcid = " << std::dec << m_cmd_write_srcid_fifo.read() 1963 1967 << " / address = " << std::hex << m_cmd_write_addr_fifo.read() … … 1979 1983 { 1980 1984 std::cout << " <MEMC " << name() 1981 << " .WRITE_NEXT> Write another word in local buffer"1985 << " WRITE_NEXT> Write another word in local buffer" 1982 1986 << std::endl; 1983 1987 } … … 1986 1990 1987 1991 // check that the next word is in the same cache line 1988 if((m_nline[( vci_addr_t)(r_write_address.read())] !=1989 m_nline[( vci_addr_t)(m_cmd_write_addr_fifo.read())]))1992 if((m_nline[(addr_t)(r_write_address.read())] != 1993 m_nline[(addr_t)(m_cmd_write_addr_fifo.read())])) 1990 1994 { 1991 1995 std::cout << "VCI_MEM_CACHE ERROR " << name() << " WRITE_NEXT state" << std::endl … … 2063 2067 { 2064 2068 std::cout 2065 << " <MEMC " << name() << " .WRITE_DIR_REQ> Requesting DIR lock "2069 << " <MEMC " << name() << " WRITE_DIR_REQ> Requesting DIR lock " 2066 2070 << std::endl; 2067 2071 } … … 2112 2116 if(m_debug_write_fsm) 2113 2117 { 2114 std::cout << " <MEMC " << name() << " .WRITE_DIR_LOCK> Check the directory: "2118 std::cout << " <MEMC " << name() << " WRITE_DIR_LOCK> Check the directory: " 2115 2119 << " address = " << std::hex << r_write_address.read() 2116 2120 << " hit = " << std::dec << entry.valid … … 2118 2122 << " is_cnt = " << entry.is_cnt << std::endl; 2119 2123 if((r_write_pktid.read() & 0x7) == TYPE_SC) 2120 std::cout << " <MEMC " << name() << " .WRITE_DIR_LOCK> global_llsc_table SC access" << std::endl;2124 std::cout << " <MEMC " << name() << " WRITE_DIR_LOCK> global_llsc_table SC access" << std::endl; 2121 2125 else 2122 std::cout << " <MEMC " << name() << " .WRITE_DIR_LOCK> global_llsc_table SW access" << std::endl;2126 std::cout << " <MEMC " << name() << " WRITE_DIR_LOCK> global_llsc_table SW access" << std::endl; 2123 2127 } 2124 2128 #endif … … 2140 2144 { 2141 2145 // update local buffer 2142 size_t set = m_y[( vci_addr_t)(r_write_address.read())];2146 size_t set = m_y[(addr_t)(r_write_address.read())]; 2143 2147 size_t way = r_write_way.read(); 2144 2148 for(size_t word=0 ; word<m_words ; word++) … … 2162 2166 if(m_debug_write_fsm) 2163 2167 { 2164 std::cout << " <MEMC " << name() << " .WRITE_DIR_READ> Read the cache to complete local buffer" << std::endl;2168 std::cout << " <MEMC " << name() << " WRITE_DIR_READ> Read the cache to complete local buffer" << std::endl; 2165 2169 } 2166 2170 #endif … … 2187 2191 entry.ptr = r_write_ptr.read(); 2188 2192 2189 size_t set = m_y[( vci_addr_t)(r_write_address.read())];2193 size_t set = m_y[(addr_t)(r_write_address.read())]; 2190 2194 size_t way = r_write_way.read(); 2191 2195 … … 2213 2217 if(m_monitor_ok) 2214 2218 { 2215 vci_addr_t address = (r_write_address.read() & ~(vci_addr_t) 0x3F) | word<<2;2219 addr_t address = (r_write_address.read() & ~(addr_t) 0x3F) | word<<2; 2216 2220 char buf[80]; 2217 snprintf(buf, 80, "WRITE_DIR_HIT srcid %d", r_write_srcid.read()); 2218 check_monitor(buf, address, r_write_data[word].read()); 2221 snprintf(buf, 80, "WRITE_DIR_HIT srcid %d", 2222 (int)r_write_srcid.read()); 2223 check_monitor(buf, address, r_write_data[word].read(), false); 2219 2224 } 2220 2225 } … … 2250 2255 if(no_update) 2251 2256 { 2252 std::cout << " <MEMC " << name() << " .WRITE_DIR_HIT> Write into cache / No coherence transaction"2257 std::cout << " <MEMC " << name() << " WRITE_DIR_HIT> Write into cache / No coherence transaction" 2253 2258 << std::endl; 2254 2259 } 2255 2260 else 2256 2261 { 2257 std::cout << " <MEMC " << name() << " .WRITE_DIR_HIT> Coherence update required:"2262 std::cout << " <MEMC " << name() << " WRITE_DIR_HIT> Coherence update required:" 2258 2263 << " is_cnt = " << r_write_is_cnt.read() 2259 2264 << " nb_copies = " << std::dec << r_write_count.read() << std::endl; … … 2276 2281 size_t trdid = r_write_trdid.read(); 2277 2282 size_t pktid = r_write_pktid.read(); 2278 addr_t nline = m_nline[( vci_addr_t)(r_write_address.read())];2283 addr_t nline = m_nline[(addr_t)(r_write_address.read())]; 2279 2284 size_t nb_copies = r_write_count.read(); 2280 size_t set = m_y[( vci_addr_t)(r_write_address.read())];2285 size_t set = m_y[(addr_t)(r_write_address.read())]; 2281 2286 size_t way = r_write_way.read(); 2282 2287 … … 2294 2299 for(size_t word=0 ; word<m_words ; word++) 2295 2300 { 2296 m_cache_data.write(way, set, word, r_write_data[word].read(), r_write_be[word].read()); 2301 m_cache_data.write(way, 2302 set, 2303 word, 2304 r_write_data[word].read(), 2305 r_write_be[word].read()); 2297 2306 2298 2307 if(m_monitor_ok) 2299 2308 { 2300 vci_addr_t address = (r_write_address.read() & ~(vci_addr_t) 0x3F) | word<<2;2309 addr_t address = (r_write_address.read() & ~(addr_t) 0x3F) | word<<2; 2301 2310 char buf[80]; 2302 snprintf(buf, 80, "WRITE_UPT_LOCK srcid %d", srcid);2303 check_monitor(buf, address, r_write_data[word].read() );2311 snprintf(buf, 80, "WRITE_UPT_LOCK srcid %d", (int)srcid); 2312 check_monitor(buf, address, r_write_data[word].read(), false); 2304 2313 } 2305 2314 } … … 2311 2320 if(wok) 2312 2321 { 2313 std::cout << " <MEMC " << name() << " .WRITE_UPT_LOCK> Register the multicast update in UPT / "2322 std::cout << " <MEMC " << name() << " WRITE_UPT_LOCK> Register the multicast update in UPT / " 2314 2323 << " nb_copies = " << r_write_count.read() << std::endl; 2315 2324 } … … 2333 2342 if(m_debug_write_fsm) 2334 2343 { 2335 std::cout << " <MEMC " << name() << " .WRITE_UPT_HEAP_LOCK> Get acces to the HEAP" << std::endl;2344 std::cout << " <MEMC " << name() << " WRITE_UPT_HEAP_LOCK> Get acces to the HEAP" << std::endl; 2336 2345 } 2337 2346 #endif … … 2353 2362 r_write_to_cc_send_brdcast_req = false; 2354 2363 r_write_to_cc_send_trdid = r_write_upt_index.read(); 2355 r_write_to_cc_send_nline = m_nline[( vci_addr_t)(r_write_address.read())];2364 r_write_to_cc_send_nline = m_nline[(addr_t)(r_write_address.read())]; 2356 2365 r_write_to_cc_send_index = r_write_word_index.read(); 2357 2366 r_write_to_cc_send_count = r_write_word_count.read(); … … 2397 2406 if(m_debug_write_fsm) 2398 2407 { 2399 std::cout << " <MEMC " << name() << " .WRITE_UPT_REQ> Post first request to CC_SEND FSM"2408 std::cout << " <MEMC " << name() << " WRITE_UPT_REQ> Post first request to CC_SEND FSM" 2400 2409 << " / srcid = " << std::dec << r_write_copy.read() 2401 2410 << " / inst = " << std::dec << r_write_copy_inst.read() << std::endl; … … 2441 2450 if(m_debug_write_fsm) 2442 2451 { 2443 std::cout << " <MEMC " << name() << " .WRITE_UPT_NEXT> Post another request to CC_SEND FSM"2452 std::cout << " <MEMC " << name() << " WRITE_UPT_NEXT> Post another request to CC_SEND FSM" 2444 2453 << " / heap_index = " << std::dec << r_write_ptr.read() 2445 2454 << " / srcid = " << std::dec << r_write_copy.read() … … 2457 2466 if(m_debug_write_fsm) 2458 2467 { 2459 std::cout << " <MEMC " << name() << " .WRITE_UPT_NEXT> Skip one entry in heap matching the writer"2468 std::cout << " <MEMC " << name() << " WRITE_UPT_NEXT> Skip one entry in heap matching the writer" 2460 2469 << " / heap_index = " << std::dec << r_write_ptr.read() 2461 2470 << " / srcid = " << std::dec << r_write_copy.read() … … 2535 2544 // consume a word in the FIFO & write it in the local buffer 2536 2545 cmd_write_fifo_get = true; 2537 size_t index = m_x[( vci_addr_t)(m_cmd_write_addr_fifo.read())];2546 size_t index = m_x[(addr_t)(m_cmd_write_addr_fifo.read())]; 2538 2547 2539 2548 r_write_address = (addr_t)(m_cmd_write_addr_fifo.read()); … … 2570 2579 if(m_debug_write_fsm) 2571 2580 { 2572 std::cout << " <MEMC " << name() << " .WRITE_RSP> Post a request to TGT_RSP FSM: rsrcid = "2581 std::cout << " <MEMC " << name() << " WRITE_RSP> Post a request to TGT_RSP FSM: rsrcid = " 2573 2582 << std::dec << r_write_srcid.read() << std::endl; 2574 2583 if(m_cmd_write_addr_fifo.rok()) … … 2594 2603 if(m_debug_write_fsm) 2595 2604 { 2596 std::cout << " <MEMC " << name() << " .WRITE_MISS_TRT_LOCK> Check the TRT" << std::endl;2605 std::cout << " <MEMC " << name() << " WRITE_MISS_TRT_LOCK> Check the TRT" << std::endl; 2597 2606 } 2598 2607 #endif 2599 2608 size_t hit_index = 0; 2600 2609 size_t wok_index = 0; 2601 vci_addr_t addr = (vci_addr_t) r_write_address.read();2610 addr_t addr = (addr_t) r_write_address.read(); 2602 2611 bool hit_read = m_trt.hit_read(m_nline[addr], hit_index); 2603 2612 bool hit_write = m_trt.hit_write(m_nline[addr]); … … 2631 2640 if(m_debug_write_fsm) 2632 2641 { 2633 std::cout << " <MEMC " << name() << " .WRITE_WAIT> Releases the locks before retry" << std::endl;2642 std::cout << " <MEMC " << name() << " WRITE_WAIT> Releases the locks before retry" << std::endl; 2634 2643 } 2635 2644 #endif … … 2654 2663 m_trt.set(r_write_trt_index.read(), 2655 2664 true, // read request to XRAM 2656 m_nline[( vci_addr_t)(r_write_address.read())],2665 m_nline[(addr_t)(r_write_address.read())], 2657 2666 r_write_srcid.read(), 2658 2667 r_write_trdid.read(), … … 2668 2677 if(m_debug_write_fsm) 2669 2678 { 2670 std::cout << " <MEMC " << name() << " .WRITE_MISS_TRT_SET> Set a new entry in TRT" << std::endl;2679 std::cout << " <MEMC " << name() << " WRITE_MISS_TRT_SET> Set a new entry in TRT" << std::endl; 2671 2680 } 2672 2681 #endif … … 2697 2706 if(m_debug_write_fsm) 2698 2707 { 2699 std::cout << " <MEMC " << name() << " .WRITE_MISS_TRT_DATA> Modify an existing entry in TRT" << std::endl;2708 std::cout << " <MEMC " << name() << " WRITE_MISS_TRT_DATA> Modify an existing entry in TRT" << std::endl; 2700 2709 m_trt.print(r_write_trt_index.read()); 2701 2710 } … … 2712 2721 r_write_to_ixr_cmd_req = true; 2713 2722 r_write_to_ixr_cmd_write = false; 2714 r_write_to_ixr_cmd_nline = m_nline[( vci_addr_t)(r_write_address.read())];2723 r_write_to_ixr_cmd_nline = m_nline[(addr_t)(r_write_address.read())]; 2715 2724 r_write_to_ixr_cmd_trdid = r_write_trt_index.read(); 2716 2725 r_write_fsm = WRITE_RSP; … … 2719 2728 if(m_debug_write_fsm) 2720 2729 { 2721 std::cout << " <MEMC " << name() << " .WRITE_MISS_XRAM_REQ> Post a GET request to the IXR_CMD FSM" << std::endl;2730 std::cout << " <MEMC " << name() << " WRITE_MISS_XRAM_REQ> Post a GET request to the IXR_CMD FSM" << std::endl; 2722 2731 } 2723 2732 #endif … … 2746 2755 if(m_debug_write_fsm) 2747 2756 { 2748 std::cout << " <MEMC " << name() << " .WRITE_BC_TRT_LOCK> Check TRT : wok = "2757 std::cout << " <MEMC " << name() << " WRITE_BC_TRT_LOCK> Check TRT : wok = " 2749 2758 << wok << " / index = " << wok_index << std::endl; 2750 2759 } … … 2764 2773 size_t trdid = r_write_trdid.read(); 2765 2774 size_t pktid = r_write_pktid.read(); 2766 addr_t nline = m_nline[( vci_addr_t)(r_write_address.read())];2775 addr_t nline = m_nline[(addr_t)(r_write_address.read())]; 2767 2776 size_t nb_copies = r_write_count.read(); 2768 2777 … … 2782 2791 if(wok) 2783 2792 { 2784 std::cout << " <MEMC " << name() << " .WRITE_BC_UPT_LOCK> Register the broadcast inval in UPT / "2793 std::cout << " <MEMC " << name() << " WRITE_BC_UPT_LOCK> Register the broadcast inval in UPT / " 2785 2794 << " nb_copies = " << r_write_count.read() << std::endl; 2786 2795 } … … 2812 2821 m_trt.set(r_write_trt_index.read(), 2813 2822 false, // write request to XRAM 2814 m_nline[( vci_addr_t)(r_write_address.read())],2823 m_nline[(addr_t)(r_write_address.read())], 2815 2824 0, 2816 2825 0, … … 2836 2845 entry.ptr = 0; 2837 2846 entry.count = 0; 2838 size_t set = m_y[( vci_addr_t)(r_write_address.read())];2847 size_t set = m_y[(addr_t)(r_write_address.read())]; 2839 2848 size_t way = r_write_way.read(); 2840 2849 … … 2844 2853 if(m_debug_write_fsm) 2845 2854 { 2846 std::cout << " <MEMC " << name() << " .WRITE_BC_DIR_INVAL> Invalidate the directory entry: @ = "2855 std::cout << " <MEMC " << name() << " WRITE_BC_DIR_INVAL> Invalidate the directory entry: @ = " 2847 2856 << r_write_address.read() << " / register the put transaction in TRT:" << std::endl; 2848 2857 } … … 2860 2869 r_write_to_cc_send_brdcast_req = true; 2861 2870 r_write_to_cc_send_trdid = r_write_upt_index.read(); 2862 r_write_to_cc_send_nline = m_nline[( vci_addr_t)(r_write_address.read())];2871 r_write_to_cc_send_nline = m_nline[(addr_t)(r_write_address.read())]; 2863 2872 r_write_to_cc_send_index = 0; 2864 2873 r_write_to_cc_send_count = 0; … … 2872 2881 2873 2882 #if DEBUG_MEMC_WRITE 2874 if(m_debug_write_fsm) 2875 { 2876 std::cout << " <MEMC " << name() << ".WRITE_BC_CC_SEND> Post a broadcast request to CC_SEND FSM" << std::endl; 2877 } 2883 if(m_debug_write_fsm) 2884 { 2885 std::cout << " <MEMC " << name() 2886 << " WRITE_BC_CC_SEND> Post a broadcast request to CC_SEND FSM" << std::endl; 2887 } 2878 2888 #endif 2879 2889 } … … 2888 2898 r_write_to_ixr_cmd_req = true; 2889 2899 r_write_to_ixr_cmd_write = true; 2890 r_write_to_ixr_cmd_nline = m_nline[( vci_addr_t)(r_write_address.read())];2900 r_write_to_ixr_cmd_nline = m_nline[(addr_t)(r_write_address.read())]; 2891 2901 r_write_to_ixr_cmd_trdid = r_write_trt_index.read(); 2892 2902 … … 2896 2906 2897 2907 #if DEBUG_MEMC_WRITE 2898 if(m_debug_write_fsm) 2899 { 2900 std::cout << " <MEMC " << name() << ".WRITE_BC_XRAM_REQ> Post a put request to IXR_CMD FSM" << std::endl; 2901 } 2908 if(m_debug_write_fsm) 2909 { 2910 std::cout << " <MEMC " << name() 2911 << " WRITE_BC_XRAM_REQ> Post a put request to IXR_CMD FSM" << std::endl; 2912 } 2902 2913 #endif 2903 2914 } … … 2910 2921 /////////////////////////////////////////////////////////////////////// 2911 2922 // The IXR_CMD fsm controls the command packets to the XRAM : 2923 // It handles requests from the READ, WRITE, CAS & XRAM_RSP FSMs 2924 // with a round-robin priority. 2925 // 2912 2926 // - It sends a single cell VCI read request to the XRAM in case of MISS 2913 2927 // posted by the READ, WRITE or CAS FSMs : the TRDID field contains … … 2915 2929 // The VCI response is a multi-cell packet : the N cells contain 2916 2930 // the N data words. 2931 // 2917 2932 // - It sends a multi-cell VCI write when the XRAM_RSP FSM, WRITE FSM 2918 2933 // or CAS FSM request to save a dirty line to the XRAM. 2919 2934 // The VCI response is a single cell packet. 2920 // This FSM handles requests from the READ, WRITE, CAS & XRAM_RSP FSMs2921 // with a round-robin priority.2922 2935 //////////////////////////////////////////////////////////////////////// 2923 2936 … … 2926 2939 //////////////////////// 2927 2940 case IXR_CMD_READ_IDLE: 2928 if (r_write_to_ixr_cmd_req)r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE;2941 if (r_write_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE; 2929 2942 else if(r_cas_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE; 2930 2943 else if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA; … … 2933 2946 //////////////////////// 2934 2947 case IXR_CMD_WRITE_IDLE: 2935 if(r_cas_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE;2948 if(r_cas_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE; 2936 2949 else if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA; 2937 2950 else if(r_read_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_READ_NLINE; 2938 else if(r_write_to_ixr_cmd_req) 2951 else if(r_write_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE; 2939 2952 break; 2940 2953 //////////////////////// 2941 2954 case IXR_CMD_CAS_IDLE: 2942 if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA;2955 if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA; 2943 2956 else if(r_read_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_READ_NLINE; 2944 else if(r_write_to_ixr_cmd_req) 2957 else if(r_write_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE; 2945 2958 else if(r_cas_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE; 2946 2959 break; 2947 2960 //////////////////////// 2948 2961 case IXR_CMD_XRAM_IDLE: 2949 if(r_read_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_READ_NLINE;2950 else if(r_write_to_ixr_cmd_req) 2962 if(r_read_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_READ_NLINE; 2963 else if(r_write_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_WRITE_NLINE; 2951 2964 else if(r_cas_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_CAS_NLINE; 2952 2965 else if(r_xram_rsp_to_ixr_cmd_req) r_ixr_cmd_fsm = IXR_CMD_XRAM_DATA; … … 2960 2973 2961 2974 #if DEBUG_MEMC_IXR_CMD 2962 if(m_debug_ixr_cmd_fsm) 2963 { 2964 std::cout << " <MEMC " << name() << ".IXR_CMD_READ_NLINE> Send a get request to xram" << std::endl; 2965 } 2975 if(m_debug_ixr_cmd_fsm) 2976 { 2977 std::cout << " <MEMC " << name() 2978 << " IXR_CMD_READ_NLINE> Send a get request to xram" << std::endl; 2979 } 2966 2980 #endif 2967 2981 } … … 2971 2985 if(p_vci_ixr.cmdack) 2972 2986 { 2973 if(r_write_to_ixr_cmd_write.read()) 2974 { 2975 if(r_ixr_cmd_cpt.read() == (m_words - 1))2987 if(r_write_to_ixr_cmd_write.read()) // PUT 2988 { 2989 if(r_ixr_cmd_cpt.read() == (m_words - 2)) 2976 2990 { 2977 2991 r_ixr_cmd_cpt = 0; … … 2981 2995 else 2982 2996 { 2983 r_ixr_cmd_cpt = r_ixr_cmd_cpt + 1;2997 r_ixr_cmd_cpt = r_ixr_cmd_cpt + 2; 2984 2998 } 2985 2999 2986 3000 #if DEBUG_MEMC_IXR_CMD 2987 if(m_debug_ixr_cmd_fsm) 2988 { 2989 std::cout << " <MEMC " << name() << ".IXR_CMD_WRITE_NLINE> Send a put request to xram" << std::endl; 2990 } 2991 #endif 2992 } 2993 else 3001 if(m_debug_ixr_cmd_fsm) 3002 { 3003 std::cout << " <MEMC " << name() 3004 << " IXR_CMD_WRITE_NLINE> Send a put request to xram" << std::endl; 3005 } 3006 #endif 3007 } 3008 else // GET 2994 3009 { 2995 3010 r_ixr_cmd_fsm = IXR_CMD_WRITE_IDLE; … … 2997 3012 2998 3013 #if DEBUG_MEMC_IXR_CMD 2999 if(m_debug_ixr_cmd_fsm) 3000 { 3001 std::cout << " <MEMC " << name() << ".IXR_CMD_WRITE_NLINE> Send a get request to xram" << std::endl; 3002 } 3014 if(m_debug_ixr_cmd_fsm) 3015 { 3016 std::cout << " <MEMC " << name() 3017 << " IXR_CMD_WRITE_NLINE> Send a get request to xram" << std::endl; 3018 } 3003 3019 #endif 3004 3020 } … … 3009 3025 if(p_vci_ixr.cmdack) 3010 3026 { 3011 if(r_cas_to_ixr_cmd_write.read()) 3012 { 3013 if(r_ixr_cmd_cpt.read() == (m_words - 1))3027 if(r_cas_to_ixr_cmd_write.read()) // PUT 3028 { 3029 if(r_ixr_cmd_cpt.read() == (m_words - 2)) 3014 3030 { 3015 3031 r_ixr_cmd_cpt = 0; … … 3019 3035 else 3020 3036 { 3021 r_ixr_cmd_cpt = r_ixr_cmd_cpt + 1;3037 r_ixr_cmd_cpt = r_ixr_cmd_cpt + 2; 3022 3038 } 3023 3039 3024 3040 #if DEBUG_MEMC_IXR_CMD 3025 if(m_debug_ixr_cmd_fsm) 3026 { 3027 std::cout << " <MEMC " << name() << ".IXR_CMD_CAS_NLINE> Send a put request to xram" << std::endl; 3028 } 3029 #endif 3030 } 3031 else 3041 if(m_debug_ixr_cmd_fsm) 3042 { 3043 std::cout << " <MEMC " << name() 3044 << " IXR_CMD_CAS_NLINE> Send a put request to xram" << std::endl; 3045 } 3046 #endif 3047 } 3048 else // GET 3032 3049 { 3033 3050 r_ixr_cmd_fsm = IXR_CMD_CAS_IDLE; … … 3035 3052 3036 3053 #if DEBUG_MEMC_IXR_CMD 3037 if(m_debug_ixr_cmd_fsm) 3038 { 3039 std::cout << " <MEMC " << name() << ".IXR_CMD_CAS_NLINE> Send a get request to xram" << std::endl; 3040 } 3054 if(m_debug_ixr_cmd_fsm) 3055 { 3056 std::cout << " <MEMC " << name() 3057 << " IXR_CMD_CAS_NLINE> Send a get request to xram" << std::endl; 3058 } 3041 3059 #endif 3042 3060 } … … 3047 3065 if(p_vci_ixr.cmdack) 3048 3066 { 3049 if(r_ixr_cmd_cpt.read() == (m_words - 1))3067 if(r_ixr_cmd_cpt.read() == (m_words - 2)) 3050 3068 { 3051 3069 r_ixr_cmd_cpt = 0; … … 3055 3073 else 3056 3074 { 3057 r_ixr_cmd_cpt = r_ixr_cmd_cpt + 1;3075 r_ixr_cmd_cpt = r_ixr_cmd_cpt + 2; 3058 3076 } 3059 3077 3060 3078 #if DEBUG_MEMC_IXR_CMD 3061 if(m_debug_ixr_cmd_fsm) 3062 { 3063 std::cout << " <MEMC " << name() << ".IXR_CMD_XRAM_DATA> Send a put request to xram" << std::endl; 3064 } 3079 if(m_debug_ixr_cmd_fsm) 3080 { 3081 std::cout << " <MEMC " << name() 3082 << " IXR_CMD_XRAM_DATA> Send a put request to xram" << std::endl; 3083 } 3065 3084 #endif 3066 3085 } … … 3090 3109 switch(r_ixr_rsp_fsm.read()) 3091 3110 { 3092 3093 case IXR_RSP_IDLE: // test if it's a get or a put transaction3111 ////////////////// 3112 case IXR_RSP_IDLE: // test transaction type: PUT/GET 3094 3113 { 3095 3114 if(p_vci_ixr.rspval.read()) … … 3097 3116 r_ixr_rsp_cpt = 0; 3098 3117 r_ixr_rsp_trt_index = p_vci_ixr.rtrdid.read(); 3099 if(p_vci_ixr.reop.read() && !(p_vci_ixr.rerror.read() &0x1)) // puttransaction3118 if(p_vci_ixr.reop.read() && !(p_vci_ixr.rerror.read() &0x1)) // PUT transaction 3100 3119 { 3101 3120 r_ixr_rsp_fsm = IXR_RSP_ACK; 3102 3121 3103 3122 #if DEBUG_MEMC_IXR_RSP 3104 if(m_debug_ixr_rsp_fsm) 3105 { 3106 std::cout << " <MEMC " << name() << ".IXR_RSP_IDLE> Response from XRAM to a put transaction" << std::endl; 3107 } 3108 #endif 3109 } 3110 else // get transaction 3123 if(m_debug_ixr_rsp_fsm) 3124 { 3125 std::cout << " <MEMC " << name() 3126 << " IXR_RSP_IDLE> Response from XRAM to a put transaction" << std::endl; 3127 } 3128 #endif 3129 } 3130 else // GET transaction 3111 3131 { 3112 3132 r_ixr_rsp_fsm = IXR_RSP_TRT_READ; 3113 3133 3114 3134 #if DEBUG_MEMC_IXR_RSP 3115 if(m_debug_ixr_rsp_fsm) 3116 { 3117 std::cout << " <MEMC " << name() << ".IXR_RSP_IDLE> Response from XRAM to a get transaction" << std::endl; 3118 } 3119 #endif 3120 } 3121 } 3122 break; 3123 } 3124 //////////////////////// 3125 case IXR_RSP_ACK: // Aknowledge the VCI response 3135 if(m_debug_ixr_rsp_fsm) 3136 { 3137 std::cout << " <MEMC " << name() 3138 << " IXR_RSP_IDLE> Response from XRAM to a get transaction" << std::endl; 3139 } 3140 #endif 3141 } 3142 } 3143 break; 3144 } 3145 ///////////////// 3146 case IXR_RSP_ACK: // Aknowledge the VCI response for a PUT 3126 3147 { 3127 3148 if(p_vci_ixr.rspval.read()) r_ixr_rsp_fsm = IXR_RSP_TRT_ERASE; 3128 3149 3129 3150 #if DEBUG_MEMC_IXR_RSP 3130 3131 3132 std::cout << " <MEMC " << name() << ".IXR_RSP_ACK>" << std::endl;3133 3151 if(m_debug_ixr_rsp_fsm) 3152 { 3153 std::cout << " <MEMC " << name() << " IXR_RSP_ACK>" << std::endl; 3154 } 3134 3155 #endif 3135 3156 break; … … 3144 3165 3145 3166 #if DEBUG_MEMC_IXR_RSP 3146 3147 3148 std::cout << " <MEMC " << name() << " .IXR_RSP_TRT_ERASE> Erase TRT entry "3167 if(m_debug_ixr_rsp_fsm) 3168 { 3169 std::cout << " <MEMC " << name() << " IXR_RSP_TRT_ERASE> Erase TRT entry " 3149 3170 << r_ixr_rsp_trt_index.read() << std::endl; 3150 3171 } … … 3153 3174 break; 3154 3175 } 3155 ////////////////////// /3156 case IXR_RSP_TRT_READ: // write data in the TRT3176 ////////////////////// 3177 case IXR_RSP_TRT_READ: // write a 64 bits data in the TRT 3157 3178 { 3158 3179 if((r_alloc_trt_fsm.read() == ALLOC_TRT_IXR_RSP) && p_vci_ixr.rspval) 3159 3180 { 3160 size_t index = r_ixr_rsp_trt_index.read(); 3161 bool eop = p_vci_ixr.reop.read(); 3162 data_t data = p_vci_ixr.rdata.read(); 3163 bool error = ((p_vci_ixr.rerror.read() & 0x1) == 1); 3164 assert(((eop == (r_ixr_rsp_cpt.read() == (m_words-1))) || p_vci_ixr.rerror.read()) 3181 size_t index = r_ixr_rsp_trt_index.read(); 3182 bool eop = p_vci_ixr.reop.read(); 3183 wide_data_t data = p_vci_ixr.rdata.read(); 3184 bool error = ((p_vci_ixr.rerror.read() & 0x1) == 1); 3185 3186 assert(((eop == (r_ixr_rsp_cpt.read() == (m_words-2))) || p_vci_ixr.rerror.read()) 3165 3187 and "Error in VCI_MEM_CACHE : invalid length for a response from XRAM"); 3166 m_trt.write_rsp(index, 3167 r_ixr_rsp_cpt.read(), 3168 data, 3169 error); 3170 r_ixr_rsp_cpt = r_ixr_rsp_cpt.read() + 1; 3188 3189 m_trt.write_rsp( index, 3190 r_ixr_rsp_cpt.read(), 3191 data, 3192 error); 3193 3194 r_ixr_rsp_cpt = r_ixr_rsp_cpt.read() + 2; 3195 3171 3196 if(eop) 3172 3197 { … … 3176 3201 3177 3202 #if DEBUG_MEMC_IXR_RSP 3178 3179 3180 std::cout << " <MEMC " << name() << ".IXR_RSP_TRT_READ> Writing a word in TRT : "3181 3182 3183 3184 3203 if(m_debug_ixr_rsp_fsm) 3204 { 3205 std::cout << " <MEMC " << name() << " IXR_RSP_TRT_READ> Writing a word in TRT : " 3206 << " index = " << std::dec << index 3207 << " / word = " << r_ixr_rsp_cpt.read() 3208 << " / data = " << std::hex << data << std::endl; 3209 } 3185 3210 #endif 3186 3211 } … … 3231 3256 if(m_debug_xram_rsp_fsm) 3232 3257 { 3233 std::cout << " <MEMC " << name() << " .XRAM_RSP_IDLE> Available cache line in TRT:"3258 std::cout << " <MEMC " << name() << " XRAM_RSP_IDLE> Available cache line in TRT:" 3234 3259 << " index = " << std::dec << index << std::endl; 3235 3260 } … … 3258 3283 3259 3284 #if DEBUG_MEMC_XRAM_RSP 3260 if(m_debug_xram_rsp_fsm) 3261 { 3262 std::cout << " <MEMC " << name() << ".XRAM_RSP_DIR_LOCK> Get access to directory" << std::endl; 3263 } 3285 if(m_debug_xram_rsp_fsm) 3286 { 3287 std::cout << " <MEMC " << name() 3288 << " XRAM_RSP_DIR_LOCK> Get access to directory" << std::endl; 3289 } 3264 3290 #endif 3265 3291 } … … 3274 3300 // selects & extracts a victim line from cache 3275 3301 size_t way = 0; 3276 size_t set = m_y[( vci_addr_t)(r_xram_rsp_trt_buf.nline * m_words * 4)];3302 size_t set = m_y[(addr_t)(r_xram_rsp_trt_buf.nline * m_words * 4)]; 3277 3303 3278 3304 DirectoryEntry victim(m_cache_directory.select(set, way)); … … 3309 3335 if(m_debug_xram_rsp_fsm) 3310 3336 { 3311 std::cout << " <MEMC " << name() << " .XRAM_RSP_TRT_COPY> Select a slot: "3337 std::cout << " <MEMC " << name() << " XRAM_RSP_TRT_COPY> Select a slot: " 3312 3338 << " way = " << std::dec << way 3313 3339 << " / set = " << set … … 3339 3365 if(m_debug_xram_rsp_fsm) 3340 3366 { 3341 std::cout << " <MEMC " << name() << " .XRAM_RSP_INVAL_LOCK> Get acces to UPT,"3367 std::cout << " <MEMC " << name() << " XRAM_RSP_INVAL_LOCK> Get acces to UPT," 3342 3368 << " but an invalidation is already registered at this address" << std::endl; 3343 3369 m_upt.print(); … … 3353 3379 if(m_debug_xram_rsp_fsm) 3354 3380 { 3355 std::cout << " <MEMC " << name() << " .XRAM_RSP_INVAL_LOCK> Get acces to UPT,"3381 std::cout << " <MEMC " << name() << " XRAM_RSP_INVAL_LOCK> Get acces to UPT," 3356 3382 << " but the table is full" << std::endl; 3357 3383 m_upt.print(); … … 3366 3392 if(m_debug_xram_rsp_fsm) 3367 3393 { 3368 std::cout << " <MEMC " << name() << " .XRAM_RSP_INVAL_LOCK> Get acces to UPT" << std::endl;3394 std::cout << " <MEMC " << name() << " XRAM_RSP_INVAL_LOCK> Get acces to UPT" << std::endl; 3369 3395 } 3370 3396 #endif … … 3402 3428 if(m_monitor_ok) 3403 3429 { 3404 vci_addr_t address = r_xram_rsp_trt_buf.nline<<6 | word<<2;3405 check_monitor("XRAM_RSP_DIR_UPDT", address, r_xram_rsp_trt_buf.wdata[word] );3430 addr_t address = r_xram_rsp_trt_buf.nline<<6 | word<<2; 3431 check_monitor("XRAM_RSP_DIR_UPDT", address, r_xram_rsp_trt_buf.wdata[word], false); 3406 3432 } 3407 3433 } … … 3465 3491 if(m_debug_xram_rsp_fsm) 3466 3492 { 3467 std::cout << " <MEMC " << name() << " .XRAM_RSP_DIR_UPDT> Directory update: "3493 std::cout << " <MEMC " << name() << " XRAM_RSP_DIR_UPDT> Directory update: " 3468 3494 << " way = " << std::dec << way 3469 3495 << " / set = " << set … … 3510 3536 if(m_debug_xram_rsp_fsm) 3511 3537 { 3512 std::cout << " <MEMC " << name() << " .XRAM_RSP_TRT_DIRTY> Set TRT entry for the put transaction:"3538 std::cout << " <MEMC " << name() << " XRAM_RSP_TRT_DIRTY> Set TRT entry for the put transaction:" 3513 3539 << " dirty victim line = " << r_xram_rsp_victim_nline.read() << std::endl; 3514 3540 } … … 3543 3569 if(m_debug_xram_rsp_fsm) 3544 3570 { 3545 std::cout << " <MEMC " << name() << " .XRAM_RSP_DIR_RSP> Request the TGT_RSP FSM to return data:"3571 std::cout << " <MEMC " << name() << " XRAM_RSP_DIR_RSP> Request the TGT_RSP FSM to return data:" 3546 3572 << " rsrcid = " << std::dec << r_xram_rsp_trt_buf.srcid 3547 3573 << " / address = " << std::hex << r_xram_rsp_trt_buf.nline*m_words*4 … … 3581 3607 if(m_debug_xram_rsp_fsm) 3582 3608 { 3583 std::cout << " <MEMC " << name() << " .XRAM_RSP_INVAL> Send an inval request to CC_SEND FSM:"3609 std::cout << " <MEMC " << name() << " XRAM_RSP_INVAL> Send an inval request to CC_SEND FSM:" 3584 3610 << " victim line = " << r_xram_rsp_victim_nline.read() << std::endl; 3585 3611 } … … 3607 3633 if(m_debug_xram_rsp_fsm) 3608 3634 { 3609 std::cout << " <MEMC " << name() << " .XRAM_RSP_WRITE_DIRTY> Send the put request to IXR_CMD FSM:"3635 std::cout << " <MEMC " << name() << " XRAM_RSP_WRITE_DIRTY> Send the put request to IXR_CMD FSM:" 3610 3636 << " victim line = " << r_xram_rsp_victim_nline.read() << std::endl; 3611 3637 } … … 3628 3654 { 3629 3655 std::cout 3630 << " <MEMC " << name() << " .XRAM_RSP_HEAP_REQ> Requesting HEAP lock "3656 << " <MEMC " << name() << " XRAM_RSP_HEAP_REQ> Requesting HEAP lock " 3631 3657 << std::endl; 3632 3658 } … … 3669 3695 if(m_debug_xram_rsp_fsm) 3670 3696 { 3671 std::cout << " <MEMC " << name() << " .XRAM_RSP_HEAP_ERASE> Erase the list of copies:"3697 std::cout << " <MEMC " << name() << " XRAM_RSP_HEAP_ERASE> Erase the list of copies:" 3672 3698 << " srcid = " << std::dec << entry.owner.srcid 3673 3699 << " / inst = " << std::dec << entry.owner.inst << std::endl; … … 3712 3738 if(m_debug_xram_rsp_fsm) 3713 3739 { 3714 std::cout << " <MEMC " << name() << " .XRAM_RSP_HEAP_LAST> Heap housekeeping" << std::endl;3740 std::cout << " <MEMC " << name() << " XRAM_RSP_HEAP_LAST> Heap housekeeping" << std::endl; 3715 3741 } 3716 3742 #endif … … 3729 3755 if(m_debug_xram_rsp_fsm) 3730 3756 { 3731 std::cout << " <MEMC " << name() << " .XRAM_RSP_ERROR_ERASE> Error reported by XRAM / erase the TRT entry" << std::endl;3757 std::cout << " <MEMC " << name() << " XRAM_RSP_ERROR_ERASE> Error reported by XRAM / erase the TRT entry" << std::endl; 3732 3758 } 3733 3759 #endif … … 3753 3779 if(m_debug_xram_rsp_fsm) 3754 3780 { 3755 std::cout << " <MEMC " << name() << " .XRAM_RSP_ERROR_RSP> Request a response error to TGT_RSP FSM:"3781 std::cout << " <MEMC " << name() << " XRAM_RSP_ERROR_RSP> Request a response error to TGT_RSP FSM:" 3756 3782 << " srcid = " << std::dec << r_xram_rsp_trt_buf.srcid << std::endl; 3757 3783 } … … 3821 3847 std::cout 3822 3848 << " <MEMC " << name() 3823 << " .CLEANUP_IDLE> Cleanup request:" << std::hex3849 << " CLEANUP_IDLE> Cleanup request:" << std::hex 3824 3850 << " / owner_id = " << srcid 3825 3851 << " / owner_ins = " << (type == DspinDhccpParam::TYPE_CLEANUP_INST) … … 3858 3884 std::cout 3859 3885 << " <MEMC " << name() 3860 << " .CLEANUP_GET_NLINE> Cleanup request:"3886 << " CLEANUP_GET_NLINE> Cleanup request:" 3861 3887 << std::hex 3862 3888 << " / address = " << nline * m_words * 4 … … 3878 3904 { 3879 3905 std::cout 3880 << " <MEMC " << name() << " .CLEANUP_DIR_REQ> Requesting DIR lock "3906 << " <MEMC " << name() << " CLEANUP_DIR_REQ> Requesting DIR lock " 3881 3907 << std::endl; 3882 3908 } … … 3950 3976 std::cout 3951 3977 << " <MEMC " << name() 3952 << " .CLEANUP_DIR_LOCK> Test directory status: "3978 << " CLEANUP_DIR_LOCK> Test directory status: " 3953 3979 << std::hex 3954 3980 << " line = " << cleanup_address … … 3980 4006 3981 4007 size_t way = r_cleanup_way.read(); 3982 size_t set = m_y[( vci_addr_t)(r_cleanup_nline.read()*m_words*4)];4008 size_t set = m_y[(addr_t)(r_cleanup_nline.read()*m_words*4)]; 3983 4009 bool match_srcid = (r_cleanup_copy.read() == r_cleanup_srcid.read()); 3984 4010 … … 4026 4052 std::cout 4027 4053 << " <MEMC " << name() 4028 << " .CLEANUP_DIR_WRITE> Update directory:"4054 << " CLEANUP_DIR_WRITE> Update directory:" 4029 4055 << std::hex 4030 4056 << " address = " << r_cleanup_nline.read() * m_words * 4 … … 4052 4078 std::cout 4053 4079 << " <MEMC " << name() 4054 << " .CLEANUP_HEAP_REQ> HEAP lock acquired "4080 << " CLEANUP_HEAP_REQ> HEAP lock acquired " 4055 4081 << std::endl; 4056 4082 } … … 4075 4101 4076 4102 size_t way = r_cleanup_way.read(); 4077 size_t set = m_y[( vci_addr_t)(r_cleanup_nline.read() *m_words*4)];4103 size_t set = m_y[(addr_t)(r_cleanup_nline.read() *m_words*4)]; 4078 4104 4079 4105 HeapEntry heap_entry = m_heap.read(r_cleanup_ptr.read()); … … 4204 4230 std::cout 4205 4231 << " <MEMC " << name() 4206 << " .CLEANUP_HEAP_LOCK> Checks matching:"4232 << " CLEANUP_HEAP_LOCK> Checks matching:" 4207 4233 << " address = " << r_cleanup_nline.read() * m_words * 4 4208 4234 << " / dir_id = " << r_cleanup_copy.read() … … 4283 4309 std::cout 4284 4310 << " <MEMC " << name() 4285 << " .CLEANUP_HEAP_SEARCH> Matching copy not found, search next:"4311 << " CLEANUP_HEAP_SEARCH> Matching copy not found, search next:" 4286 4312 << std::endl; 4287 4313 } … … 4290 4316 std::cout 4291 4317 << " <MEMC " << name() 4292 << " .CLEANUP_HEAP_SEARCH> Matching copy found:"4318 << " CLEANUP_HEAP_SEARCH> Matching copy found:" 4293 4319 << std::endl; 4294 4320 } … … 4350 4376 std::cout 4351 4377 << " <MEMC " << name() 4352 << " .CLEANUP_HEAP_SEARCH> Remove the copy in the linked list"4378 << " CLEANUP_HEAP_SEARCH> Remove the copy in the linked list" 4353 4379 << std::endl; 4354 4380 } … … 4399 4425 std::cout 4400 4426 << " <MEMC " << name() 4401 << " .CLEANUP_HEAP_SEARCH> Update the list of free entries"4427 << " CLEANUP_HEAP_SEARCH> Update the list of free entries" 4402 4428 << std::endl; 4403 4429 } … … 4427 4453 std::cout 4428 4454 << " <MEMC " << name() 4429 << " .CLEANUP_UPT_LOCK> Unexpected cleanup"4455 << " CLEANUP_UPT_LOCK> Unexpected cleanup" 4430 4456 << " with no corresponding UPT entry:" 4431 4457 << " address = " << std::hex … … 4451 4477 std::cout 4452 4478 << " <MEMC " << name() 4453 << " .CLEANUP_UPT_LOCK> Cleanup matching pending"4479 << " CLEANUP_UPT_LOCK> Cleanup matching pending" 4454 4480 << " invalidate transaction on UPT:" 4455 4481 << std::hex … … 4496 4522 std::cout 4497 4523 << " <MEMC " << name() 4498 << " .CLEANUP_UPT_DECREMENT> Decrement response counter in UPT:"4524 << " CLEANUP_UPT_DECREMENT> Decrement response counter in UPT:" 4499 4525 << " UPT_index = " << r_cleanup_index.read() 4500 4526 << " rsp_count = " << count … … 4535 4561 std::cout 4536 4562 << " <MEMC " << name() 4537 << " .CLEANUP_UPT_CLEAR> Clear entry in UPT:"4563 << " CLEANUP_UPT_CLEAR> Clear entry in UPT:" 4538 4564 << " UPT_index = " << r_cleanup_index.read() 4539 4565 << std::endl; … … 4562 4588 std::cout 4563 4589 << " <MEMC " << name() 4564 << " .CLEANUP_WRITE_RSP> Send a response to a previous"4590 << " CLEANUP_WRITE_RSP> Send a response to a previous" 4565 4591 << " write request waiting for coherence transaction completion: " 4566 4592 << " rsrcid = " << std::dec << r_cleanup_write_srcid.read() … … 4592 4618 std::cout 4593 4619 << " <MEMC " << name() 4594 << " .CLEANUP_SEND_ACK> Send the response to a cleanup request:"4620 << " CLEANUP_SEND_ACK> Send the response to a cleanup request:" 4595 4621 << " srcid = " << std::dec << r_cleanup_srcid.read() 4596 4622 << std::endl; … … 4637 4663 if(m_debug_cas_fsm) 4638 4664 { 4639 std::cout << " <MEMC " << name() << " .CAS_IDLE> CAS command: " << std::hex4665 std::cout << " <MEMC " << name() << " CAS_IDLE> CAS command: " << std::hex 4640 4666 << " srcid = " << std::dec << m_cmd_cas_srcid_fifo.read() 4641 4667 << " addr = " << std::hex << m_cmd_cas_addr_fifo.read() … … 4688 4714 { 4689 4715 std::cout 4690 << " <MEMC " << name() << " .CAS_DIR_REQ> Requesting DIR lock "4716 << " <MEMC " << name() << " CAS_DIR_REQ> Requesting DIR lock " 4691 4717 << std::endl; 4692 4718 } … … 4721 4747 if(m_debug_cas_fsm) 4722 4748 { 4723 std::cout << " <MEMC " << name() << " .CAS_DIR_LOCK> Directory acces"4749 std::cout << " <MEMC " << name() << " CAS_DIR_LOCK> Directory acces" 4724 4750 << " / address = " << std::hex << m_cmd_cas_addr_fifo.read() 4725 4751 << " / hit = " << std::dec << entry.valid … … 4746 4772 { 4747 4773 size_t way = r_cas_way.read(); 4748 size_t set = m_y[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4774 size_t set = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4749 4775 4750 4776 // update directory (lock & dirty bits) … … 4774 4800 { 4775 4801 std::cout 4776 << " <MEMC " << name() << " .CAS_DIR_HIT_READ> Read data from "4802 << " <MEMC " << name() << " CAS_DIR_HIT_READ> Read data from " 4777 4803 << " cache and store it in buffer" 4778 4804 << std::endl; … … 4784 4810 case CAS_DIR_HIT_COMPARE: 4785 4811 { 4786 size_t word = m_x[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4812 size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4787 4813 4788 4814 // Read data in buffer & check data change … … 4810 4836 if(m_debug_cas_fsm) 4811 4837 { 4812 std::cout << " <MEMC " << name() << " .CAS_DIR_HIT_COMPARE> Compare the old"4838 std::cout << " <MEMC " << name() << " CAS_DIR_HIT_COMPARE> Compare the old" 4813 4839 << " and the new data" 4814 4840 << " / expected value = " << r_cas_rdata[0].read() … … 4846 4872 { 4847 4873 size_t way = r_cas_way.read(); 4848 size_t set = m_y[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4849 size_t word = m_x[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4874 size_t set = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4875 size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4850 4876 4851 4877 // cache update … … 4859 4885 if(m_monitor_ok) 4860 4886 { 4861 vci_addr_t address = m_cmd_cas_addr_fifo.read();4887 addr_t address = m_cmd_cas_addr_fifo.read(); 4862 4888 char buf[80]; 4863 snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", m_cmd_cas_srcid_fifo.read()); 4864 check_monitor(buf, address, r_cas_wdata.read()); 4889 snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", 4890 (int)m_cmd_cas_srcid_fifo.read()); 4891 check_monitor(buf, address, r_cas_wdata.read(), false); 4865 4892 4866 4893 if(r_cas_cpt.read() == 4) 4867 check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read() );4894 check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read(), false); 4868 4895 } 4869 4896 … … 4871 4898 if(m_debug_cas_fsm) 4872 4899 { 4873 std::cout << " <MEMC " << name() << " .CAS_DIR_HIT_WRITE> Update cache:"4900 std::cout << " <MEMC " << name() << " CAS_DIR_HIT_WRITE> Update cache:" 4874 4901 << " way = " << std::dec << way 4875 4902 << " / set = " << set … … 4878 4905 << " / count = " << r_cas_count.read() << std::endl; 4879 4906 std::cout << " <MEMC " 4880 << name() << " .CAS_DIR_HIT_WRITE> global_llsc_table SW access" << std::endl;4907 << name() << " CAS_DIR_HIT_WRITE> global_llsc_table SW access" << std::endl; 4881 4908 } 4882 4909 #endif … … 4896 4923 size_t trdid = m_cmd_cas_trdid_fifo.read(); 4897 4924 size_t pktid = m_cmd_cas_pktid_fifo.read(); 4898 addr_t nline = m_nline[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4925 addr_t nline = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4899 4926 size_t nb_copies = r_cas_count.read(); 4900 4927 … … 4912 4939 // cache update 4913 4940 size_t way = r_cas_way.read(); 4914 size_t set = m_y[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4915 size_t word = m_x[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4941 size_t set = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4942 size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4916 4943 4917 4944 m_cache_data.write(way, set, word, r_cas_wdata.read()); … … 4925 4952 if(m_monitor_ok) 4926 4953 { 4927 vci_addr_t address = m_cmd_cas_addr_fifo.read();4954 addr_t address = m_cmd_cas_addr_fifo.read(); 4928 4955 char buf[80]; 4929 snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", m_cmd_cas_srcid_fifo.read()); 4930 check_monitor(buf, address, r_cas_wdata.read()); 4956 snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", 4957 (int)m_cmd_cas_srcid_fifo.read()); 4958 check_monitor(buf, address, r_cas_wdata.read(), false); 4931 4959 4932 4960 if(r_cas_cpt.read() ==4) 4933 check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read() );4961 check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read(), false); 4934 4962 } 4935 4963 } … … 4943 4971 { 4944 4972 std::cout << " <MEMC " << name() 4945 << " .CAS_UPT_LOCK> Register multi-update transaction in UPT"4973 << " CAS_UPT_LOCK> Register multi-update transaction in UPT" 4946 4974 << " / wok = " << wok 4947 4975 << " / nline = " << std::hex << nline … … 4960 4988 { 4961 4989 std::cout << " <MEMC " << name() 4962 << " .CAS_WAIT> Release all locks" << std::endl;4990 << " CAS_WAIT> Release all locks" << std::endl; 4963 4991 } 4964 4992 #endif … … 4976 5004 { 4977 5005 std::cout << " <MEMC " << name() 4978 << " .CAS_UPT_HEAP_LOCK> Get access to the heap" << std::endl;5006 << " CAS_UPT_HEAP_LOCK> Get access to the heap" << std::endl; 4979 5007 } 4980 5008 #endif … … 4993 5021 r_cas_to_cc_send_brdcast_req = false; 4994 5022 r_cas_to_cc_send_trdid = r_cas_upt_index.read(); 4995 r_cas_to_cc_send_nline = m_nline[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];4996 r_cas_to_cc_send_index = m_x[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5023 r_cas_to_cc_send_nline = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5024 r_cas_to_cc_send_index = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())]; 4997 5025 r_cas_to_cc_send_wdata = r_cas_wdata.read(); 4998 5026 … … 5031 5059 if(m_debug_cas_fsm) 5032 5060 { 5033 std::cout << " <MEMC " << name() << " .CAS_UPT_REQ> Send the first update request to CC_SEND FSM "5061 std::cout << " <MEMC " << name() << " CAS_UPT_REQ> Send the first update request to CC_SEND FSM " 5034 5062 << " / address = " << std::hex << m_cmd_cas_addr_fifo.read() 5035 5063 << " / wdata = " << std::hex << r_cas_wdata.read() … … 5071 5099 if(m_debug_cas_fsm) 5072 5100 { 5073 std::cout << " <MEMC " << name() << " .CAS_UPT_NEXT> Send the next update request to CC_SEND FSM "5101 std::cout << " <MEMC " << name() << " CAS_UPT_NEXT> Send the next update request to CC_SEND FSM " 5074 5102 << " / address = " << std::hex << m_cmd_cas_addr_fifo.read() 5075 5103 << " / wdata = " << std::hex << r_cas_wdata.read() … … 5088 5116 { 5089 5117 // fill the data buffer 5090 size_t word = m_x[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5118 size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5091 5119 for(size_t i = 0; i<m_words; i++) 5092 5120 { … … 5134 5162 size_t trdid = m_cmd_cas_trdid_fifo.read(); 5135 5163 size_t pktid = m_cmd_cas_pktid_fifo.read(); 5136 addr_t nline = m_nline[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5164 addr_t nline = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5137 5165 size_t nb_copies = r_cas_count.read(); 5138 5166 … … 5152 5180 // cache update 5153 5181 size_t way = r_cas_way.read(); 5154 size_t set = m_y[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5155 size_t word = m_x[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5182 size_t set = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5183 size_t word = m_x[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5156 5184 5157 5185 m_cache_data.write(way, set, word, r_cas_wdata.read()); … … 5162 5190 if(m_monitor_ok) 5163 5191 { 5164 vci_addr_t address = m_cmd_cas_addr_fifo.read();5192 addr_t address = m_cmd_cas_addr_fifo.read(); 5165 5193 char buf[80]; 5166 snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", m_cmd_cas_srcid_fifo.read()); 5167 check_monitor(buf, address, r_cas_wdata.read()); 5194 snprintf(buf, 80, "CAS_DIR_HIT_WRITE srcid %d", 5195 (int)m_cmd_cas_srcid_fifo.read()); 5196 check_monitor(buf, address, r_cas_wdata.read(), false); 5168 5197 if(r_cas_cpt.read() ==4) 5169 check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read() );5198 check_monitor(buf, address+4, m_cmd_cas_wdata_fifo.read(), false); 5170 5199 } 5171 5200 r_cas_upt_index = index; … … 5174 5203 if(m_debug_cas_fsm) 5175 5204 { 5176 std::cout << " <MEMC " << name() << " .CAS_BC_UPT_LOCK> Register a broadcast inval transaction in UPT"5205 std::cout << " <MEMC " << name() << " CAS_BC_UPT_LOCK> Register a broadcast inval transaction in UPT" 5177 5206 << " / nline = " << nline 5178 5207 << " / count = " << nb_copies … … 5198 5227 m_trt.set(r_cas_trt_index.read(), 5199 5228 false, // PUT request to XRAM 5200 m_nline[( vci_addr_t)(m_cmd_cas_addr_fifo.read())],5229 m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())], 5201 5230 0, 5202 5231 0, … … 5222 5251 entry.owner.inst = false; 5223 5252 entry.ptr = 0; 5224 size_t set = m_y[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5253 size_t set = m_y[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5225 5254 size_t way = r_cas_way.read(); 5226 5255 m_cache_directory.write(set, way, entry); … … 5231 5260 if(m_debug_cas_fsm) 5232 5261 { 5233 std::cout << " <MEMC " << name() << " .CAS_BC_DIR_INVAL> Register the PUT in TRT and invalidate DIR entry"5234 << " / nline = " << std::hex << m_nline[( vci_addr_t)(m_cmd_cas_addr_fifo.read())]5262 std::cout << " <MEMC " << name() << " CAS_BC_DIR_INVAL> Register the PUT in TRT and invalidate DIR entry" 5263 << " / nline = " << std::hex << m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())] 5235 5264 << " / set = " << std::dec << set << " / way = " << way << std::endl; 5236 5265 } … … 5252 5281 r_cas_to_cc_send_brdcast_req = true; 5253 5282 r_cas_to_cc_send_trdid = r_cas_upt_index.read(); 5254 r_cas_to_cc_send_nline = m_nline[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5283 r_cas_to_cc_send_nline = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5255 5284 r_cas_to_cc_send_index = 0; 5256 5285 r_cas_to_cc_send_wdata = 0; … … 5267 5296 r_cas_to_ixr_cmd_req = true; 5268 5297 r_cas_to_ixr_cmd_write = true; 5269 r_cas_to_ixr_cmd_nline = m_nline[( vci_addr_t)(m_cmd_cas_addr_fifo.read())];5298 r_cas_to_ixr_cmd_nline = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())]; 5270 5299 r_cas_to_ixr_cmd_trdid = r_cas_trt_index.read(); 5271 5300 r_cas_fsm = CAS_IDLE; … … 5276 5305 if(m_debug_cas_fsm) 5277 5306 { 5278 std::cout << " <MEMC " << name() << " .CAS_BC_XRAM_REQ> Request a PUT transaction to IXR_CMD FSM" << std::hex5279 << " / nline = " << m_nline[( vci_addr_t) m_cmd_cas_addr_fifo.read()]5307 std::cout << " <MEMC " << name() << " CAS_BC_XRAM_REQ> Request a PUT transaction to IXR_CMD FSM" << std::hex 5308 << " / nline = " << m_nline[(addr_t) m_cmd_cas_addr_fifo.read()] 5280 5309 << " / trt_index = " << r_cas_trt_index.read() << std::endl; 5281 5310 } … … 5306 5335 if(m_debug_cas_fsm) 5307 5336 { 5308 std::cout << " <MEMC " << name() << " .CAS_RSP_FAIL> Request TGT_RSP to send a failure response" << std::endl;5337 std::cout << " <MEMC " << name() << " CAS_RSP_FAIL> Request TGT_RSP to send a failure response" << std::endl; 5309 5338 } 5310 5339 #endif … … 5329 5358 if(m_debug_cas_fsm) 5330 5359 { 5331 std::cout << " <MEMC " << name() << " .CAS_RSP_SUCCESS> Request TGT_RSP to send a success response" << std::endl;5360 std::cout << " <MEMC " << name() << " CAS_RSP_SUCCESS> Request TGT_RSP to send a success response" << std::endl; 5332 5361 } 5333 5362 #endif … … 5342 5371 size_t index = 0; 5343 5372 bool hit_read = m_trt.hit_read( 5344 m_nline[( vci_addr_t) m_cmd_cas_addr_fifo.read()],index);5373 m_nline[(addr_t) m_cmd_cas_addr_fifo.read()],index); 5345 5374 bool hit_write = m_trt.hit_write( 5346 m_nline[( vci_addr_t) m_cmd_cas_addr_fifo.read()]);5375 m_nline[(addr_t) m_cmd_cas_addr_fifo.read()]); 5347 5376 bool wok = !m_trt.full(index); 5348 5377 … … 5350 5379 if(m_debug_cas_fsm) 5351 5380 { 5352 std::cout << " <MEMC " << name() << " .CAS_MISS_TRT_LOCK> Check TRT state"5381 std::cout << " <MEMC " << name() << " CAS_MISS_TRT_LOCK> Check TRT state" 5353 5382 << " / hit_read = " << hit_read 5354 5383 << " / hit_write = " << hit_write … … 5387 5416 m_trt.set(r_cas_trt_index.read(), 5388 5417 true, // read request 5389 m_nline[( vci_addr_t) m_cmd_cas_addr_fifo.read()],5418 m_nline[(addr_t) m_cmd_cas_addr_fifo.read()], 5390 5419 m_cmd_cas_srcid_fifo.read(), 5391 5420 m_cmd_cas_trdid_fifo.read(), … … 5401 5430 if(m_debug_cas_fsm) 5402 5431 { 5403 std::cout << " <MEMC " << name() << " .CAS_MISS_TRT_SET> Register a GET transaction in TRT" << std::hex5404 << " / nline = " << m_nline[( vci_addr_t) m_cmd_cas_addr_fifo.read()]5432 std::cout << " <MEMC " << name() << " CAS_MISS_TRT_SET> Register a GET transaction in TRT" << std::hex 5433 << " / nline = " << m_nline[(addr_t) m_cmd_cas_addr_fifo.read()] 5405 5434 << " / trt_index = " << r_cas_trt_index.read() << std::endl; 5406 5435 } … … 5417 5446 r_cas_to_ixr_cmd_write = false; 5418 5447 r_cas_to_ixr_cmd_trdid = r_cas_trt_index.read(); 5419 r_cas_to_ixr_cmd_nline = m_nline[( vci_addr_t) m_cmd_cas_addr_fifo.read()];5448 r_cas_to_ixr_cmd_nline = m_nline[(addr_t) m_cmd_cas_addr_fifo.read()]; 5420 5449 r_cas_fsm = CAS_WAIT; 5421 5450 … … 5423 5452 if(m_debug_cas_fsm) 5424 5453 { 5425 std::cout << " <MEMC " << name() << " .CAS_MISS_XRAM_REQ> Request a GET transaction to IXR_CMD FSM" << std::hex5426 << " / nline = " << m_nline[( vci_addr_t) m_cmd_cas_addr_fifo.read()]5454 std::cout << " <MEMC " << name() << " CAS_MISS_XRAM_REQ> Request a GET transaction to IXR_CMD FSM" << std::hex 5455 << " / nline = " << m_nline[(addr_t) m_cmd_cas_addr_fifo.read()] 5427 5456 << " / trt_index = " << r_cas_trt_index.read() << std::endl; 5428 5457 } … … 5699 5728 std::cout 5700 5729 << " <MEMC " << name() 5701 << " .CC_SEND_CLEANUP_ACK> Cleanup Acknowledgement for srcid "5730 << " CC_SEND_CLEANUP_ACK> Cleanup Acknowledgement for srcid " 5702 5731 << r_cleanup_to_cc_send_srcid.read() 5703 5732 << std::endl; … … 5742 5771 std::cout 5743 5772 << " <MEMC " << name() 5744 << " .CC_SEND_XRAM_RSP_INVAL_NLINE> Broadcast-Inval for line "5773 << " CC_SEND_XRAM_RSP_INVAL_NLINE> Broadcast-Inval for line " 5745 5774 << r_xram_rsp_to_cc_send_nline.read() 5746 5775 << std::endl; … … 5774 5803 std::cout 5775 5804 << " <MEMC " << name() 5776 << " .CC_SEND_XRAM_RSP_BRDCAST_NLINE> Broadcast-Inval for line "5805 << " CC_SEND_XRAM_RSP_BRDCAST_NLINE> Broadcast-Inval for line " 5777 5806 << r_xram_rsp_to_cc_send_nline.read() 5778 5807 << std::endl; … … 5806 5835 std::cout 5807 5836 << " <MEMC " << name() 5808 << " .CC_SEND_WRITE_BRDCAST_NLINE> Broadcast-Inval for line "5837 << " CC_SEND_WRITE_BRDCAST_NLINE> Broadcast-Inval for line " 5809 5838 << r_write_to_cc_send_nline.read() 5810 5839 << std::endl; … … 5849 5878 std::cout 5850 5879 << " <MEMC " << name() 5851 << " .CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line "5880 << " CC_SEND_WRITE_UPDT_NLINE> Multicast-Update for line " 5852 5881 << r_write_to_cc_send_nline.read() 5853 5882 << std::endl; … … 5897 5926 std::cout 5898 5927 << " <MEMC " << name() 5899 << " .CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line "5928 << " CC_SEND_CAS_BRDCAST_NLINE> Broadcast-Inval for line " 5900 5929 << r_cas_to_cc_send_nline.read() 5901 5930 << std::endl; … … 5941 5970 std::cout 5942 5971 << " <MEMC " << name() 5943 << " .CC_SEND_CAS_UPDT_NLINE> Multicast-Update for line "5972 << " CC_SEND_CAS_UPDT_NLINE> Multicast-Update for line " 5944 5973 << r_cas_to_cc_send_nline.read() 5945 5974 << std::endl; … … 6204 6233 { 6205 6234 std::cout 6206 << " <MEMC " << name() << " .TGT_RSP_READ> Read response"6235 << " <MEMC " << name() << " TGT_RSP_READ> Read response" 6207 6236 << " / rsrcid = " << std::dec << r_read_to_tgt_rsp_srcid.read() 6208 6237 << " / rtrdid = " << r_read_to_tgt_rsp_trdid.read() … … 6247 6276 if(m_debug_tgt_rsp_fsm) 6248 6277 { 6249 std::cout << " <MEMC " << name() << " .TGT_RSP_WRITE> Write response"6278 std::cout << " <MEMC " << name() << " TGT_RSP_WRITE> Write response" 6250 6279 << " / rsrcid = " << std::dec << r_write_to_tgt_rsp_srcid.read() 6251 6280 << " / rtrdid = " << r_write_to_tgt_rsp_trdid.read() … … 6267 6296 if(m_debug_tgt_rsp_fsm) 6268 6297 { 6269 std::cout << " <MEMC " << name() << " .TGT_RSP_CLEANUP> Cleanup response"6298 std::cout << " <MEMC " << name() << " TGT_RSP_CLEANUP> Cleanup response" 6270 6299 << " / rsrcid = " << std::dec << r_cleanup_to_tgt_rsp_srcid.read() 6271 6300 << " / rtrdid = " << r_cleanup_to_tgt_rsp_trdid.read() … … 6287 6316 if(m_debug_tgt_rsp_fsm) 6288 6317 { 6289 std::cout << " <MEMC " << name() << " .TGT_RSP_CAS> CAS response"6318 std::cout << " <MEMC " << name() << " TGT_RSP_CAS> CAS response" 6290 6319 << " / rsrcid = " << std::dec << r_cas_to_tgt_rsp_srcid.read() 6291 6320 << " / rtrdid = " << r_cas_to_tgt_rsp_trdid.read() … … 6309 6338 { 6310 6339 std::cout 6311 << " <MEMC " << name() << " .TGT_RSP_XRAM> Response following XRAM access"6340 << " <MEMC " << name() << " TGT_RSP_XRAM> Response following XRAM access" 6312 6341 << " / rsrcid = " << std::dec << r_xram_rsp_to_tgt_rsp_srcid.read() 6313 6342 << " / rtrdid = " << r_xram_rsp_to_tgt_rsp_trdid.read() … … 6353 6382 if(m_debug_tgt_rsp_fsm) 6354 6383 { 6355 std::cout << " <MEMC " << name() << " .TGT_RSP_INIT> Write response after coherence transaction"6384 std::cout << " <MEMC " << name() << " TGT_RSP_INIT> Write response after coherence transaction" 6356 6385 << " / rsrcid = " << std::dec << r_multi_ack_to_tgt_rsp_srcid.read() 6357 6386 << " / rtrdid = " << r_multi_ack_to_tgt_rsp_trdid.read() … … 7171 7200 //////////////////////////////////////////////////////////// 7172 7201 7173 p_vci_ixr.be = 0xF ;7202 p_vci_ixr.be = 0xFF; // nor transmited to external ram 7174 7203 p_vci_ixr.pktid = 0; 7175 7204 p_vci_ixr.srcid = m_srcid_x; … … 7179 7208 p_vci_ixr.clen = 0; 7180 7209 p_vci_ixr.cfixed = false; 7210 p_vci_ixr.plen = 64; 7181 7211 7182 7212 if(r_ixr_cmd_fsm.read() == IXR_CMD_READ_NLINE) 7183 7213 { 7184 p_vci_ixr.cmd = vci_param::CMD_READ; 7185 p_vci_ixr.cmdval = true; 7186 p_vci_ixr.address = (addr_t)(r_read_to_ixr_cmd_nline.read() *m_words*4); 7187 p_vci_ixr.plen = m_words*4; 7188 p_vci_ixr.wdata = 0x00000000; 7189 p_vci_ixr.trdid = r_read_to_ixr_cmd_trdid.read(); 7190 p_vci_ixr.eop = true; 7214 p_vci_ixr.cmd = vci_param_ext::CMD_READ; 7215 p_vci_ixr.cmdval = true; 7216 p_vci_ixr.address = (addr_t)(r_read_to_ixr_cmd_nline.read() * m_words * 4); 7217 p_vci_ixr.wdata = 0; 7218 p_vci_ixr.trdid = r_read_to_ixr_cmd_trdid.read(); 7219 p_vci_ixr.eop = true; 7191 7220 } 7192 7221 else if(r_ixr_cmd_fsm.read() == IXR_CMD_CAS_NLINE) … … 7194 7223 if(r_cas_to_ixr_cmd_write.read()) 7195 7224 { 7196 p_vci_ixr.cmd = vci_param::CMD_WRITE; 7225 size_t word = r_ixr_cmd_cpt.read(); 7226 p_vci_ixr.cmd = vci_param_ext::CMD_WRITE; 7197 7227 p_vci_ixr.cmdval = true; 7198 p_vci_ixr.address = (addr_t)( (r_cas_to_ixr_cmd_nline.read() *m_words+r_ixr_cmd_cpt.read()) *4);7199 p_vci_ixr. plen = m_words*4;7200 p_vci_ixr.wdata = r_cas_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read();7228 p_vci_ixr.address = (addr_t)( (r_cas_to_ixr_cmd_nline.read() * m_words + word) * 4 ); 7229 p_vci_ixr.wdata = ((wide_data_t)(r_cas_to_ixr_cmd_data[word].read())) | 7230 ((wide_data_t)(r_cas_to_ixr_cmd_data[word+1].read()) << 32); 7201 7231 p_vci_ixr.trdid = r_cas_to_ixr_cmd_trdid.read(); 7202 p_vci_ixr.eop = (r_ixr_cmd_cpt == (m_words- 1));7232 p_vci_ixr.eop = (r_ixr_cmd_cpt == (m_words-2)); 7203 7233 } 7204 7234 else 7205 7235 { 7206 p_vci_ixr.cmd = vci_param ::CMD_READ;7236 p_vci_ixr.cmd = vci_param_ext::CMD_READ; 7207 7237 p_vci_ixr.cmdval = true; 7208 7238 p_vci_ixr.address = (addr_t)(r_cas_to_ixr_cmd_nline.read() *m_words*4); 7209 p_vci_ixr.plen = m_words*4; 7210 p_vci_ixr.wdata = 0x00000000; 7239 p_vci_ixr.wdata = 0; 7211 7240 p_vci_ixr.trdid = r_cas_to_ixr_cmd_trdid.read(); 7212 7241 p_vci_ixr.eop = true; … … 7217 7246 if(r_write_to_ixr_cmd_write.read()) 7218 7247 { 7219 p_vci_ixr.cmd = vci_param ::CMD_WRITE;7248 p_vci_ixr.cmd = vci_param_ext::CMD_WRITE; 7220 7249 p_vci_ixr.cmdval = true; 7221 p_vci_ixr.address = (addr_t)((r_write_to_ixr_cmd_nline.read() *m_words+r_ixr_cmd_cpt.read()) *4); 7222 p_vci_ixr.plen = m_words*4; 7223 p_vci_ixr.wdata = r_write_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read(); 7250 p_vci_ixr.address = (addr_t)( (r_write_to_ixr_cmd_nline.read() * m_words + 7251 r_ixr_cmd_cpt.read()) * 4 ); 7252 p_vci_ixr.wdata = (wide_data_t)(r_write_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read() | 7253 r_write_to_ixr_cmd_data[r_ixr_cmd_cpt.read()+1].read()); 7224 7254 p_vci_ixr.trdid = r_write_to_ixr_cmd_trdid.read(); 7225 p_vci_ixr.eop = (r_ixr_cmd_cpt == (m_words- 1));7255 p_vci_ixr.eop = (r_ixr_cmd_cpt == (m_words-2)); 7226 7256 } 7227 7257 else 7228 7258 { 7229 p_vci_ixr.cmd = vci_param ::CMD_READ;7259 p_vci_ixr.cmd = vci_param_ext::CMD_READ; 7230 7260 p_vci_ixr.cmdval = true; 7231 7261 p_vci_ixr.address = (addr_t)(r_write_to_ixr_cmd_nline.read() *m_words*4); 7232 p_vci_ixr.plen = m_words*4; 7233 p_vci_ixr.wdata = 0x00000000; 7262 p_vci_ixr.wdata = 0; 7234 7263 p_vci_ixr.trdid = r_write_to_ixr_cmd_trdid.read(); 7235 7264 p_vci_ixr.eop = true; … … 7238 7267 else if(r_ixr_cmd_fsm.read() == IXR_CMD_XRAM_DATA) 7239 7268 { 7240 p_vci_ixr.cmd = vci_param::CMD_WRITE; 7241 p_vci_ixr.cmdval = true; 7242 p_vci_ixr.address = (addr_t)((r_xram_rsp_to_ixr_cmd_nline.read() *m_words+r_ixr_cmd_cpt.read()) *4); 7243 p_vci_ixr.plen = m_words*4; 7244 p_vci_ixr.wdata = r_xram_rsp_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read(); 7245 p_vci_ixr.trdid = r_xram_rsp_to_ixr_cmd_trdid.read(); 7246 p_vci_ixr.eop = (r_ixr_cmd_cpt == (m_words-1)); 7269 p_vci_ixr.cmd = vci_param_ext::CMD_WRITE; 7270 p_vci_ixr.cmdval = true; 7271 p_vci_ixr.address = (addr_t)( (r_xram_rsp_to_ixr_cmd_nline.read() * m_words + 7272 r_ixr_cmd_cpt.read()) * 4 ); 7273 p_vci_ixr.wdata = (wide_data_t)(r_xram_rsp_to_ixr_cmd_data[r_ixr_cmd_cpt.read()].read() | 7274 r_xram_rsp_to_ixr_cmd_data[r_ixr_cmd_cpt.read()+1].read()); 7275 p_vci_ixr.trdid = r_xram_rsp_to_ixr_cmd_trdid.read(); 7276 p_vci_ixr.eop = (r_ixr_cmd_cpt == (m_words-2)); 7247 7277 } 7248 7278 else 7249 7279 { 7250 p_vci_ixr.cmdval = false;7251 p_vci_ixr. address = 0;7252 p_vci_ixr. plen= 0;7253 p_vci_ixr.wdata = 0;7254 p_vci_ixr.trdid = 0;7255 p_vci_ixr.eop = false;7280 p_vci_ixr.cmdval = false; 7281 p_vci_ixr.cmd = vci_param_ext::CMD_READ; 7282 p_vci_ixr.address = 0; 7283 p_vci_ixr.wdata = 0; 7284 p_vci_ixr.trdid = 0; 7285 p_vci_ixr.eop = false; 7256 7286 } 7257 7287 … … 7446 7476 uint64_t dest = 7447 7477 r_cleanup_to_cc_send_srcid.read() << 7448 (DspinDhccpParam::SRCID_WIDTH - vci_param ::S);7478 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 7449 7479 7450 7480 DspinDhccpParam::dspin_set( … … 7496 7526 uint64_t dest = 7497 7527 m_xram_rsp_to_cc_send_srcid_fifo.read() << 7498 (DspinDhccpParam::SRCID_WIDTH - vci_param ::S);7528 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 7499 7529 7500 7530 DspinDhccpParam::dspin_set( … … 7649 7679 uint64_t dest = 7650 7680 m_write_to_cc_send_srcid_fifo.read() << 7651 (DspinDhccpParam::SRCID_WIDTH - vci_param ::S);7681 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 7652 7682 7653 7683 DspinDhccpParam::dspin_set( … … 7756 7786 uint64_t dest = 7757 7787 m_cas_to_cc_send_srcid_fifo.read() << 7758 (DspinDhccpParam::SRCID_WIDTH - vci_param ::S);7788 (DspinDhccpParam::SRCID_WIDTH - vci_param_int::S); 7759 7789 7760 7790 DspinDhccpParam::dspin_set(
Note: See TracChangeset
for help on using the changeset viewer.