Changeset 495 for branches/RWT/modules/vci_mem_cache/caba/source/include
- Timestamp:
- Aug 22, 2013, 6:45:38 PM (11 years ago)
- Location:
- branches/RWT/modules/vci_mem_cache/caba/source/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RWT/modules/vci_mem_cache/caba/source/include
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/ODCCP/modules/vci_mem_cache/caba/source/include merged eligible /branches/v5/modules/vci_mem_cache/caba/source/include 441-467
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/RWT/modules/vci_mem_cache/caba/source/include/mem_cache_directory.h
r477 r495 6 6 #include <cassert> 7 7 #include "arithmetics.h" 8 9 // !!!10 // The L1_MULTI_CACHE mechanism does no longer work with the new pktid encoding11 // of TSAR. Turning the define below to a non null value will cause the memcache12 // to behave in an unpredicted way.13 // TODO Either remove the mechanism from the mem cache or update its behaviour.14 15 #define L1_MULTI_CACHE 016 8 17 9 //#define RANDOM_EVICTION … … 46 38 bool inst; // Is the owner an ICache ? 47 39 size_t srcid; // The SRCID of the owner 48 #if L1_MULTI_CACHE49 size_t cache_id; // In multi_cache configuration50 #endif51 40 52 41 //////////////////////// 53 42 // Constructors 54 43 //////////////////////// 55 Owner(bool i_inst 56 ,size_t i_srcid 57 #if L1_MULTI_CACHE 58 ,size_t i_cache_id 59 #endif 60 ){ 44 Owner(bool i_inst, 45 size_t i_srcid) 46 { 61 47 inst = i_inst; 62 48 srcid = i_srcid; 63 #if L1_MULTI_CACHE 64 cache_id= i_cache_id; 65 #endif 66 } 67 68 Owner(const Owner &a){ 49 } 50 51 Owner(const Owner &a) 52 { 69 53 inst = a.inst; 70 54 srcid = a.srcid; 71 #if L1_MULTI_CACHE 72 cache_id= a.cache_id; 73 #endif 74 } 75 76 Owner(){ 55 } 56 57 Owner() 58 { 77 59 inst = false; 78 60 srcid = 0; 79 #if L1_MULTI_CACHE80 cache_id= 0;81 #endif82 61 } 83 62 // end constructors … … 116 95 owner.inst = 0; 117 96 owner.srcid = 0; 118 #if L1_MULTI_CACHE119 owner.cache_id= 0;120 #endif121 97 ptr = 0; 122 98 } … … 177 153 << " ; Count = " << count 178 154 << " ; Owner = " << owner.srcid 179 #if L1_MULTI_CACHE180 << "." << owner.cache_id181 #endif182 155 << " " << owner.inst 183 156 << " ; Pointer = " << ptr << std::endl; … … 328 301 // - entry : the entry value 329 302 ///////////////////////////////////////////////////////////////////// 330 void write(const size_t &set, const size_t &way, const DirectoryEntry &entry) 303 void write( const size_t &set, 304 const size_t &way, 305 const DirectoryEntry &entry) 331 306 { 332 307 assert( (set<m_sets) … … 374 349 DirectoryEntry select(const size_t &set, size_t &way) 375 350 { 376 assert( (set < m_sets)351 assert( (set < m_sets) 377 352 && "Cache Directory : (select) The set index is invalid"); 378 353 379 for(size_t i=0; i<m_ways; i++){ 380 if(!m_dir_tab[set][i].valid){ 381 way=i; 382 return DirectoryEntry(m_dir_tab[set][way]); 354 // looking for an empty slot 355 for(size_t i=0; i<m_ways; i++) 356 { 357 if( not m_dir_tab[set][i].valid ) 358 { 359 way=i; 360 return DirectoryEntry(m_dir_tab[set][way]); 361 } 383 362 } 384 }385 363 386 364 #ifdef RANDOM_EVICTION 387 lfsr = (lfsr >> 1) ^ ((-(lfsr & 1)) & 0xd0000001);388 way = lfsr % m_ways;389 return DirectoryEntry(m_dir_tab[set][way]);365 lfsr = (lfsr >> 1) ^ ((-(lfsr & 1)) & 0xd0000001); 366 way = lfsr % m_ways; 367 return DirectoryEntry(m_dir_tab[set][way]); 390 368 #endif 391 369 392 for(size_t i=0; i<m_ways; i++){ 393 if(!(m_lru_tab[set][i].recent) && !(m_dir_tab[set][i].lock)){ 394 way=i; 395 return DirectoryEntry(m_dir_tab[set][way]); 370 // looking for a not locked and not recently used entry 371 for(size_t i=0; i<m_ways; i++) 372 { 373 if((not m_lru_tab[set][i].recent) && (not m_dir_tab[set][i].lock) ) 374 { 375 way=i; 376 return DirectoryEntry(m_dir_tab[set][way]); 377 } 396 378 } 397 } 398 for(size_t i=0; i<m_ways; i++){ 399 if( !(m_lru_tab[set][i].recent) && (m_dir_tab[set][i].lock)){ 400 way=i; 401 return DirectoryEntry(m_dir_tab[set][way]); 379 380 // looking for a locked not recently used entry 381 for(size_t i=0; i<m_ways; i++) 382 { 383 if( (not m_lru_tab[set][i].recent) && (m_dir_tab[set][i].lock)) 384 { 385 way=i; 386 return DirectoryEntry(m_dir_tab[set][way]); 387 } 402 388 } 403 } 404 for(size_t i=0; i<m_ways; i++){ 405 if( (m_lru_tab[set][i].recent) && !(m_dir_tab[set][i].lock)){ 406 way=i; 407 return DirectoryEntry(m_dir_tab[set][way]); 389 390 // looking for a recently used entry not locked 391 for(size_t i=0; i<m_ways; i++) 392 { 393 if( (m_lru_tab[set][i].recent) && (not m_dir_tab[set][i].lock)) 394 { 395 way=i; 396 return DirectoryEntry(m_dir_tab[set][way]); 397 } 408 398 } 409 } 410 way = 0; 411 return DirectoryEntry(m_dir_tab[set][0]); 399 400 // select way 0 (even if entry is locked and recently used) 401 way = 0; 402 return DirectoryEntry(m_dir_tab[set][0]); 412 403 } // end select() 413 404 … … 443 434 //////////////////////// 444 435 HeapEntry() 445 :owner(false,0 446 #if L1_MULTI_CACHE 447 ,0 448 #endif 449 ) 436 :owner(false,0) 450 437 { 451 438 next = 0; … … 455 442 // Constructor 456 443 //////////////////////// 457 HeapEntry(const HeapEntry &entry){ 444 HeapEntry(const HeapEntry &entry) 445 { 458 446 owner.inst = entry.owner.inst; 459 447 owner.srcid = entry.owner.srcid; 460 #if L1_MULTI_CACHE461 owner.cache_id = entry.owner.cache_id;462 #endif463 448 next = entry.next; 464 449 } // end constructor … … 467 452 // The copy() function copies an existing source entry to a target 468 453 ///////////////////////////////////////////////////////////////////// 469 void copy(const HeapEntry &entry){ 454 void copy(const HeapEntry &entry) 455 { 470 456 owner.inst = entry.owner.inst; 471 457 owner.srcid = entry.owner.srcid; 472 #if L1_MULTI_CACHE473 owner.cache_id = entry.owner.cache_id;474 #endif475 458 next = entry.next; 476 459 } // end copy() … … 483 466 << " -- owner.inst : " << std::dec << owner.inst << std::endl 484 467 << " -- owner.srcid : " << std::dec << owner.srcid << std::endl 485 #if L1_MULTI_CACHE486 << " -- owner.cache_id : " << std::dec << owner.cache_id << std::endl487 #endif488 468 << " -- next : " << std::dec << next << std::endl; 489 469 … … 646 626 // Cache Data 647 627 //////////////////////////////////////////////////////////////////////// 648 class CacheData { 628 class CacheData 629 { 649 630 private: 650 631 const uint32_t m_sets; … … 656 637 public: 657 638 639 /////////////////////////////////////////////////////// 658 640 CacheData(uint32_t ways, uint32_t sets, uint32_t words) 659 : m_sets(sets), m_ways(ways), m_words(words) {660 641 : m_sets(sets), m_ways(ways), m_words(words) 642 { 661 643 m_cache_data = new uint32_t ** [ways]; 662 for ( size_t i=0 ; i < ways ; i++ ) { 663 m_cache_data[i] = new uint32_t * [sets]; 644 for ( size_t i=0 ; i < ways ; i++ ) 645 { 646 m_cache_data[i] = new uint32_t * [sets]; 664 647 } 665 for ( size_t i=0; i<ways; i++ ) { 666 for ( size_t j=0; j<sets; j++ ) { 667 m_cache_data[i][j] = new uint32_t [words]; 668 } 648 for ( size_t i=0; i<ways; i++ ) 649 { 650 for ( size_t j=0; j<sets; j++ ) 651 { 652 m_cache_data[i][j] = new uint32_t [words]; 653 } 669 654 } 670 } 671 672 ~CacheData() { 673 for(size_t i=0; i<m_ways ; i++){ 674 for(size_t j=0; j<m_sets ; j++){ 655 } 656 //////////// 657 ~CacheData() 658 { 659 for(size_t i=0; i<m_ways ; i++) 660 { 661 for(size_t j=0; j<m_sets ; j++) 662 { 675 663 delete [] m_cache_data[i][j]; 676 664 } 677 665 } 678 for(size_t i=0; i<m_ways ; i++){ 666 for(size_t i=0; i<m_ways ; i++) 667 { 679 668 delete [] m_cache_data[i]; 680 669 } 681 670 delete [] m_cache_data; 682 671 } 683 684 uint32_t read ( 685 const uint32_t &way, 686 const uint32_t &set, 687 const uint32_t &word) const { 688 689 assert((set < m_sets ) && "Cache data error: Trying to read a wrong set" ); 690 assert((way < m_ways ) && "Cache data error: Trying to read a wrong way" ); 691 assert((word < m_words) && "Cache data error: Trying to read a wrong word"); 692 693 return m_cache_data[way][set][word]; 694 } 695 696 void read_line( 697 const uint32_t &way, 698 const uint32_t &set, 699 sc_core::sc_signal<uint32_t> * cache_line) 700 { 701 assert((set < m_sets ) && "Cache data error: Trying to read a wrong set" ); 702 assert((way < m_ways ) && "Cache data error: Trying to read a wrong way" ); 703 704 for (uint32_t word=0; word<m_words; word++) 705 cache_line[word].write(m_cache_data[way][set][word]); 706 } 707 708 void write ( 709 const uint32_t &way, 710 const uint32_t &set, 711 const uint32_t &word, 712 const uint32_t &data, 713 const uint32_t &be = 0xF) { 714 715 assert((set < m_sets ) && "Cache data error: Trying to write a wrong set" ); 716 assert((way < m_ways ) && "Cache data error: Trying to write a wrong way" ); 717 assert((word < m_words) && "Cache data error: Trying to write a wrong word"); 718 assert((be <= 0xF ) && "Cache data error: Trying to write a wrong word cell"); 719 720 if (be == 0x0) return; 721 722 if (be == 0xF) { 723 m_cache_data[way][set][word] = data; 724 return; 725 } 726 727 uint32_t mask = 0; 728 if (be & 0x1) mask = mask | 0x000000FF; 729 if (be & 0x2) mask = mask | 0x0000FF00; 730 if (be & 0x4) mask = mask | 0x00FF0000; 731 if (be & 0x8) mask = mask | 0xFF000000; 732 733 m_cache_data[way][set][word] = 734 (data & mask) | (m_cache_data[way][set][word] & ~mask); 672 ////////////////////////////////////////// 673 uint32_t read ( const uint32_t &way, 674 const uint32_t &set, 675 const uint32_t &word) const 676 { 677 assert((set < m_sets ) && "Cache data error: Trying to read a wrong set" ); 678 assert((way < m_ways ) && "Cache data error: Trying to read a wrong way" ); 679 assert((word < m_words) && "Cache data error: Trying to read a wrong word"); 680 681 return m_cache_data[way][set][word]; 682 } 683 ////////////////////////////////////////// 684 void read_line( const uint32_t &way, 685 const uint32_t &set, 686 sc_core::sc_signal<uint32_t> * cache_line) 687 { 688 assert((set < m_sets ) && "Cache data error: Trying to read a wrong set" ); 689 assert((way < m_ways ) && "Cache data error: Trying to read a wrong way" ); 690 691 for (uint32_t word=0; word<m_words; word++) 692 cache_line[word].write(m_cache_data[way][set][word]); 693 } 694 ///////////////////////////////////////// 695 void write ( const uint32_t &way, 696 const uint32_t &set, 697 const uint32_t &word, 698 const uint32_t &data, 699 const uint32_t &be = 0xF) 700 { 701 702 assert((set < m_sets ) && "Cache data error: Trying to write a wrong set" ); 703 assert((way < m_ways ) && "Cache data error: Trying to write a wrong way" ); 704 assert((word < m_words) && "Cache data error: Trying to write a wrong word"); 705 assert((be <= 0xF ) && "Cache data error: Trying to write a wrong be"); 706 707 if (be == 0x0) return; 708 709 if (be == 0xF) 710 { 711 m_cache_data[way][set][word] = data; 712 return; 713 } 714 715 uint32_t mask = 0; 716 if (be & 0x1) mask = mask | 0x000000FF; 717 if (be & 0x2) mask = mask | 0x0000FF00; 718 if (be & 0x4) mask = mask | 0x00FF0000; 719 if (be & 0x8) mask = mask | 0xFF000000; 720 721 m_cache_data[way][set][word] = 722 (data & mask) | (m_cache_data[way][set][word] & ~mask); 735 723 } 736 724 }; // end class CacheData -
branches/RWT/modules/vci_mem_cache/caba/source/include/update_tab.h
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk/modules/vci_mem_cache/caba/source/include/update_tab.h merged eligible /branches/v5/modules/vci_mem_cache/caba/source/include/update_tab.h 441-467
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/ODCCP/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h merged eligible /trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h merged eligible /branches/v5/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h 441-467
r477 r495 25 25 * SOCLIB_LGPL_HEADER_END 26 26 * 27 * Maintainers: alain eric.guthmuller@polytechnique.edu 27 * Maintainers: alain.greiner@lip6.fr 28 * eric.guthmuller@polytechnique.edu 28 29 * cesar.fuguet-tortolero@lip6.fr 29 30 * alexandre.joannou@lip6.fr … … 154 155 MULTI_ACK_UPT_LOCK, 155 156 MULTI_ACK_UPT_CLEAR, 156 MULTI_ACK_WRITE_RSP, 157 MULTI_ACK_CONFIG_ACK 157 MULTI_ACK_WRITE_RSP 158 158 }; 159 159 … … 163 163 CONFIG_IDLE, 164 164 CONFIG_LOOP, 165 CONFIG_WAIT, 165 166 CONFIG_RSP, 166 167 CONFIG_DIR_REQ, 167 168 CONFIG_DIR_ACCESS, 168 CONFIG_ DIR_IVT_LOCK,169 CONFIG_IVT_LOCK, 169 170 CONFIG_BC_SEND, 170 CONFIG_BC_WAIT, 171 CONFIG_INV_SEND, 171 CONFIG_INVAL_SEND, 172 172 CONFIG_HEAP_REQ, 173 173 CONFIG_HEAP_SCAN, 174 174 CONFIG_HEAP_LAST, 175 CONFIG_INV_WAIT 175 CONFIG_TRT_LOCK, 176 CONFIG_TRT_SET, 177 CONFIG_PUT_REQ 176 178 }; 177 179 … … 204 206 WRITE_DIR_LOCK, 205 207 WRITE_IVT_LOCK_HIT_WB, 206 WRITE_DIR_READ,207 208 WRITE_DIR_HIT, 208 209 WRITE_UPT_LOCK, … … 217 218 WRITE_MISS_TRT_SET, 218 219 WRITE_MISS_XRAM_REQ, 220 WRITE_BC_DIR_READ, 219 221 WRITE_BC_TRT_LOCK, 220 222 WRITE_BC_IVT_LOCK, … … 243 245 XRAM_RSP_DIR_UPDT, 244 246 XRAM_RSP_DIR_RSP, 245 XRAM_RSP_I NVAL_LOCK,247 XRAM_RSP_IVT_LOCK, 246 248 XRAM_RSP_INVAL_WAIT, 247 249 XRAM_RSP_INVAL, … … 262 264 IXR_CMD_XRAM_IDLE, 263 265 IXR_CMD_CLEANUP_IDLE, 264 IXR_CMD_READ, 265 IXR_CMD_WRITE, 266 IXR_CMD_CAS, 267 IXR_CMD_XRAM, 268 IXR_CMD_CLEANUP_DATA 266 IXR_CMD_CONFIG_IDLE, 267 IXR_CMD_READ_TRT, 268 IXR_CMD_WRITE_TRT, 269 IXR_CMD_CAS_TRT, 270 IXR_CMD_XRAM_TRT, 271 IXR_CMD_CLEANUP_TRT, 272 IXR_CMD_CONFIG_TRT, 273 IXR_CMD_READ_SEND, 274 IXR_CMD_WRITE_SEND, 275 IXR_CMD_CAS_SEND, 276 IXR_CMD_XRAM_SEND, 277 IXR_CMD_CLEANUP_DATA_SEND, 278 IXR_CMD_CONFIG_SEND 269 279 }; 270 280 … … 318 328 CLEANUP_IXR_REQ, 319 329 CLEANUP_WAIT, 320 CLEANUP_CONFIG_ACK,321 330 CLEANUP_SEND_CLACK 322 331 }; … … 342 351 ALLOC_TRT_XRAM_RSP, 343 352 ALLOC_TRT_IXR_RSP, 344 ALLOC_TRT_CLEANUP 353 ALLOC_TRT_CLEANUP, 354 ALLOC_TRT_IXR_CMD, 355 ALLOC_TRT_CONFIG 345 356 }; 346 357 … … 404 415 }; 405 416 406 /* Configuration commands */ 407 enum cmd_config_type_e 408 { 409 CMD_CONFIG_INVAL = 0, 410 CMD_CONFIG_SYNC = 1 411 }; 412 413 // debug variables (for each FSM) 417 // debug variables 414 418 bool m_debug; 415 419 bool m_debug_previous_valid; 416 420 size_t m_debug_previous_count; 417 421 bool m_debug_previous_dirty; 418 sc_signal<data_t>* m_debug_previous_data; 419 sc_signal<data_t>* m_debug_data; 420 421 bool m_monitor_ok; 422 addr_t m_monitor_base; 423 addr_t m_monitor_length; 422 data_t * m_debug_previous_data; 423 data_t * m_debug_data; 424 424 425 425 // instrumentation counters … … 644 644 uint32_t m_broadcast_boundaries; 645 645 646 //////////////////////////////////////////////////647 // Registers controlled by the TGT_CMD fsm648 //////////////////////////////////////////////////649 650 sc_signal<int> r_tgt_cmd_fsm;651 652 646 // Fifo between TGT_CMD fsm and READ fsm 653 647 GenericFifo<addr_t> m_cmd_read_addr_fifo; … … 693 687 sc_signal<size_t> r_tgt_cmd_config_cmd; 694 688 689 ////////////////////////////////////////////////// 690 // Registers controlled by the TGT_CMD fsm 691 ////////////////////////////////////////////////// 692 693 sc_signal<int> r_tgt_cmd_fsm; 694 sc_signal<size_t> r_tgt_cmd_srcid; // srcid for response to config 695 sc_signal<size_t> r_tgt_cmd_trdid; // trdid for response to config 696 sc_signal<size_t> r_tgt_cmd_pktid; // pktid for response to config 697 695 698 /////////////////////////////////////////////////////// 696 699 // Registers controlled by the CONFIG fsm 697 700 /////////////////////////////////////////////////////// 698 701 699 sc_signal<int> r_config_fsm; // FSM state 700 sc_signal<bool> r_config_lock; // lock protecting exclusive access 701 sc_signal<int> r_config_cmd; // config request status 702 sc_signal<addr_t> r_config_address; // target buffer physical address 703 sc_signal<size_t> r_config_srcid; // config request srcid 704 sc_signal<size_t> r_config_trdid; // config request trdid 705 sc_signal<size_t> r_config_pktid; // config request pktid 706 sc_signal<size_t> r_config_nlines; // number of lines covering the buffer 707 sc_signal<size_t> r_config_dir_way; // DIR: selected way 708 sc_signal<size_t> r_config_dir_count; // DIR: number of copies 709 sc_signal<bool> r_config_dir_is_cnt; // DIR: counter mode (broadcast required) 710 sc_signal<size_t> r_config_dir_copy_srcid; // DIR: first copy SRCID 711 sc_signal<bool> r_config_dir_copy_inst; // DIR: first copy L1 type 712 sc_signal<size_t> r_config_dir_next_ptr; // DIR: index of next copy in HEAP 713 sc_signal<size_t> r_config_heap_next; // current pointer to scan HEAP 714 715 sc_signal<size_t> r_config_ivt_index; // IVT index 702 sc_signal<int> r_config_fsm; // FSM state 703 sc_signal<bool> r_config_lock; // lock protecting exclusive access 704 sc_signal<int> r_config_cmd; // config request type 705 sc_signal<addr_t> r_config_address; // target buffer physical address 706 sc_signal<size_t> r_config_srcid; // config request srcid 707 sc_signal<size_t> r_config_trdid; // config request trdid 708 sc_signal<size_t> r_config_pktid; // config request pktid 709 sc_signal<size_t> r_config_cmd_lines; // number of lines to be handled 710 sc_signal<size_t> r_config_rsp_lines; // number of lines not completed 711 sc_signal<size_t> r_config_dir_way; // DIR: selected way 712 sc_signal<bool> r_config_dir_lock; // DIR: locked entry 713 sc_signal<size_t> r_config_dir_count; // DIR: number of copies 714 sc_signal<bool> r_config_dir_is_cnt; // DIR: counter mode (broadcast) 715 sc_signal<size_t> r_config_dir_copy_srcid; // DIR: first copy SRCID 716 sc_signal<bool> r_config_dir_copy_inst; // DIR: first copy L1 type 717 sc_signal<size_t> r_config_dir_ptr; // DIR: index of next copy in HEAP 718 sc_signal<size_t> r_config_heap_next; // current pointer to scan HEAP 719 sc_signal<size_t> r_config_trt_index; // selected entry in TRT 720 sc_signal<size_t> r_config_ivt_index; // selected entry in IVT 721 722 // Buffer between CONFIG fsm and IXR_CMD fsm 723 sc_signal<bool> r_config_to_ixr_cmd_req; // valid request 724 sc_signal<size_t> r_config_to_ixr_cmd_index; // TRT index 725 716 726 717 727 // Buffer between CONFIG fsm and TGT_RSP fsm (send a done response to L1 cache) … … 730 740 GenericFifo<size_t> m_config_to_cc_send_srcid_fifo; // fifo for owners srcid 731 741 732 #if L1_MULTI_CACHE733 GenericFifo<size_t> m_config_to_cc_send_cache_id_fifo; // fifo for cache_id734 #endif735 736 742 /////////////////////////////////////////////////////// 737 743 // Registers controlled by the READ fsm 738 744 /////////////////////////////////////////////////////// 739 745 740 sc_signal<int> r_read_fsm; // FSM state 741 sc_signal<size_t> r_read_copy; // Srcid of the first copy 742 sc_signal<size_t> r_read_copy_cache; // Srcid of the first copy 743 sc_signal<bool> r_read_copy_inst; // Type of the first copy 744 sc_signal<tag_t> r_read_tag; // cache line tag (in directory) 745 sc_signal<bool> r_read_is_cnt; // is_cnt bit (in directory) 746 sc_signal<bool> r_read_lock; // lock bit (in directory) 747 sc_signal<bool> r_read_dirty; // dirty bit (in directory) 748 sc_signal<size_t> r_read_count; // number of copies 749 sc_signal<size_t> r_read_ptr; // pointer to the heap 750 sc_signal<data_t> * r_read_data; // data (one cache line) 751 sc_signal<size_t> r_read_way; // associative way (in cache) 752 sc_signal<size_t> r_read_trt_index; // Transaction Table index 753 sc_signal<size_t> r_read_next_ptr; // Next entry to point to 754 sc_signal<bool> r_read_last_free; // Last free entry 755 sc_signal<addr_t> r_read_ll_key; // LL key from the llsc_global_table 756 757 // Buffer between READ fsm and IXR_CMD fsm (ask a missing cache line to XRAM) 758 sc_signal<bool> r_read_to_ixr_cmd_req; // valid request 759 sc_signal<addr_t> r_read_to_ixr_cmd_nline; // cache line index 760 sc_signal<size_t> r_read_to_ixr_cmd_trdid; // index in Transaction Table 746 sc_signal<int> r_read_fsm; // FSM state 747 sc_signal<size_t> r_read_copy; // Srcid of the first copy 748 sc_signal<size_t> r_read_copy_cache; // Srcid of the first copy 749 sc_signal<bool> r_read_copy_inst; // Type of the first copy 750 sc_signal<tag_t> r_read_tag; // cache line tag (in directory) 751 sc_signal<bool> r_read_is_cnt; // is_cnt bit (in directory) 752 sc_signal<bool> r_read_lock; // lock bit (in directory) 753 sc_signal<bool> r_read_dirty; // dirty bit (in directory) 754 sc_signal<size_t> r_read_count; // number of copies 755 sc_signal<size_t> r_read_ptr; // pointer to the heap 756 sc_signal<data_t> * r_read_data; // data (one cache line) 757 sc_signal<size_t> r_read_way; // associative way (in cache) 758 sc_signal<size_t> r_read_trt_index; // Transaction Table index 759 sc_signal<size_t> r_read_next_ptr; // Next entry to point to 760 sc_signal<bool> r_read_last_free; // Last free entry 761 sc_signal<addr_t> r_read_ll_key; // LL key from llsc_global_table 762 763 // Buffer between READ fsm and IXR_CMD fsm 764 sc_signal<bool> r_read_to_ixr_cmd_req; // valid request 765 sc_signal<size_t> r_read_to_ixr_cmd_index; // TRT index 761 766 762 767 // Buffer between READ fsm and TGT_RSP fsm (send a hit read response to L1 cache) 763 sc_signal<bool> r_read_to_tgt_rsp_req; // valid request764 sc_signal<size_t> r_read_to_tgt_rsp_srcid; // Transaction srcid765 sc_signal<size_t> r_read_to_tgt_rsp_trdid; // Transaction trdid766 sc_signal<size_t> r_read_to_tgt_rsp_pktid; // Transaction pktid767 sc_signal<data_t> * r_read_to_tgt_rsp_data; // data (one cache line)768 sc_signal<size_t> r_read_to_tgt_rsp_word; // first word of the response769 sc_signal<size_t> r_read_to_tgt_rsp_length; // length of the response770 sc_signal<addr_t> r_read_to_tgt_rsp_ll_key; // LL key from thellsc_global_table768 sc_signal<bool> r_read_to_tgt_rsp_req; // valid request 769 sc_signal<size_t> r_read_to_tgt_rsp_srcid; // Transaction srcid 770 sc_signal<size_t> r_read_to_tgt_rsp_trdid; // Transaction trdid 771 sc_signal<size_t> r_read_to_tgt_rsp_pktid; // Transaction pktid 772 sc_signal<data_t> * r_read_to_tgt_rsp_data; // data (one cache line) 773 sc_signal<size_t> r_read_to_tgt_rsp_word; // first word of the response 774 sc_signal<size_t> r_read_to_tgt_rsp_length; // length of the response 775 sc_signal<addr_t> r_read_to_tgt_rsp_ll_key; // LL key from llsc_global_table 771 776 772 777 //RWT: Buffer between READ fsm and CC_SEND fsm (send inval) … … 795 800 /////////////////////////////////////////////////////////////// 796 801 797 sc_signal<int> r_write_fsm; // FSM state798 sc_signal<addr_t> r_write_address; // first word address799 sc_signal<size_t> r_write_word_index; // first word index in line800 sc_signal<size_t> r_write_word_count; // number of words in line801 sc_signal<size_t> r_write_srcid; // transaction srcid802 sc_signal<size_t> r_write_trdid; // transaction trdid803 sc_signal<size_t> r_write_pktid; // transaction pktid804 sc_signal<data_t> * r_write_data; // data (one cache line)805 sc_signal<be_t> * r_write_be; // one byte enable per word806 sc_signal<bool> r_write_byte; // (BE != 0X0) and (BE != 0xF)807 sc_signal<bool> r_write_is_cnt; // is_cnt bit (in directory)808 sc_signal<bool> r_write_lock; // lock bit (in directory)809 sc_signal<tag_t> r_write_tag; // cache line tag (in directory)810 sc_signal<size_t> r_write_copy; // first owner of the line811 sc_signal<size_t> r_write_copy_cache; // first owner of the line812 sc_signal<bool> r_write_copy_inst; // is this owner a ICache ?813 sc_signal<size_t> r_write_count; // number of copies814 sc_signal<size_t> r_write_ptr; // pointer to the heap815 sc_signal<size_t> r_write_next_ptr; // next pointer to the heap816 sc_signal<bool> r_write_to_dec; // need to decrement update counter817 sc_signal<size_t> r_write_way; // way of the line818 sc_signal<size_t> r_write_trt_index; // index in Transaction Table819 sc_signal<size_t> r_write_upt_index; // index in Update Table820 sc_signal<bool> r_write_sc_fail; // sc command failed821 sc_signal<bool> r_write_pending_sc; // sc command pending802 sc_signal<int> r_write_fsm; // FSM state 803 sc_signal<addr_t> r_write_address; // first word address 804 sc_signal<size_t> r_write_word_index; // first word index in line 805 sc_signal<size_t> r_write_word_count; // number of words in line 806 sc_signal<size_t> r_write_srcid; // transaction srcid 807 sc_signal<size_t> r_write_trdid; // transaction trdid 808 sc_signal<size_t> r_write_pktid; // transaction pktid 809 sc_signal<data_t> * r_write_data; // data (one cache line) 810 sc_signal<be_t> * r_write_be; // one byte enable per word 811 sc_signal<bool> r_write_byte; // (BE != 0X0) and (BE != 0xF) 812 sc_signal<bool> r_write_is_cnt; // is_cnt bit (in directory) 813 sc_signal<bool> r_write_lock; // lock bit (in directory) 814 sc_signal<tag_t> r_write_tag; // cache line tag (in directory) 815 sc_signal<size_t> r_write_copy; // first owner of the line 816 sc_signal<size_t> r_write_copy_cache; // first owner of the line 817 sc_signal<bool> r_write_copy_inst; // is this owner a ICache ? 818 sc_signal<size_t> r_write_count; // number of copies 819 sc_signal<size_t> r_write_ptr; // pointer to the heap 820 sc_signal<size_t> r_write_next_ptr; // next pointer to the heap 821 sc_signal<bool> r_write_to_dec; // need to decrement update counter 822 sc_signal<size_t> r_write_way; // way of the line 823 sc_signal<size_t> r_write_trt_index; // index in Transaction Table 824 sc_signal<size_t> r_write_upt_index; // index in Update Table 825 sc_signal<bool> r_write_sc_fail; // sc command failed 826 sc_signal<bool> r_write_pending_sc; // sc command pending 822 827 823 828 // Buffer between WRITE fsm and TGT_RSP fsm (acknowledge a write command from L1) … … 828 833 sc_signal<bool> r_write_to_tgt_rsp_sc_fail; // sc command failed 829 834 830 // Buffer between WRITE fsm and IXR_CMD fsm (ask a missing cache line to XRAM) 831 sc_signal<bool> r_write_to_ixr_cmd_req; // valid request 832 sc_signal<bool> r_write_to_ixr_cmd_write; // write request 833 sc_signal<addr_t> r_write_to_ixr_cmd_nline; // cache line index 834 sc_signal<data_t> * r_write_to_ixr_cmd_data; // cache line data 835 sc_signal<size_t> r_write_to_ixr_cmd_trdid; // index in Transaction Table 835 // Buffer between WRITE fsm and IXR_CMD fsm 836 sc_signal<bool> r_write_to_ixr_cmd_req; // valid request 837 sc_signal<bool> r_write_to_ixr_cmd_put; // request type (GET/PUT) 838 sc_signal<size_t> r_write_to_ixr_cmd_index; // TRT index 836 839 837 840 // Buffer between WRITE fsm and CC_SEND fsm (Update/Invalidate L1 caches) … … 847 850 GenericFifo<size_t> m_write_to_cc_send_srcid_fifo; // fifo for srcids 848 851 849 #if L1_MULTI_CACHE850 GenericFifo<size_t> m_write_to_cc_send_cache_id_fifo; // fifo for srcids851 #endif852 853 852 // Buffer between WRITE fsm and MULTI_ACK fsm (Decrement UPT entry) 854 853 sc_signal<bool> r_write_to_multi_ack_req; // valid request … … 878 877 sc_signal<addr_t> r_multi_ack_nline; // pending write nline 879 878 880 // signaling completion of multi-inval to CONFIG fsm881 sc_signal<bool> r_multi_ack_to_config_ack;882 883 879 // Buffer between MULTI_ACK fsm and TGT_RSP fsm (complete write/update transaction) 884 880 sc_signal<bool> r_multi_ack_to_tgt_rsp_req; // valid request … … 897 893 sc_signal<addr_t> r_cleanup_nline; // cache line index 898 894 899 #if L1_MULTI_CACHE900 sc_signal<size_t> r_cleanup_pktid; // transaction pktid901 #endif902 895 903 896 sc_signal<copy_t> r_cleanup_copy; // first copy … … 926 919 sc_signal<size_t> r_cleanup_index; // index of the INVAL line (in the UPT) 927 920 928 // signaling completion of broadcast-inval to CONFIG fsm929 sc_signal<bool> r_cleanup_to_config_ack;930 931 921 // Buffer between CLEANUP fsm and TGT_RSP fsm (acknowledge a write command from L1) 932 922 sc_signal<bool> r_cleanup_to_tgt_rsp_req; // valid request … … 950 940 /////////////////////////////////////////////////////// 951 941 952 sc_signal<int> r_cas_fsm; // FSM state953 sc_signal<data_t> r_cas_wdata; // write data word954 sc_signal<data_t> * r_cas_rdata; // read data word955 sc_signal<uint32_t> r_cas_lfsr; // lfsr for random introducing956 sc_signal<size_t> r_cas_cpt; // size of command957 sc_signal<copy_t> r_cas_copy; // Srcid of the first copy958 sc_signal<copy_t> r_cas_copy_cache; // Srcid of the first copy959 sc_signal<bool> r_cas_copy_inst; // Type of the first copy960 sc_signal<size_t> r_cas_count; // number of copies961 sc_signal<size_t> r_cas_ptr; // pointer to the heap962 sc_signal<size_t> r_cas_next_ptr; // next pointer to the heap963 sc_signal<bool> r_cas_is_cnt; // is_cnt bit (in directory)964 sc_signal<bool> r_cas_dirty; // dirty bit (in directory)965 sc_signal<size_t> r_cas_way; // way in directory966 sc_signal<size_t> r_cas_set; // set in directory967 sc_signal<data_t> r_cas_tag; // cache line tag (in directory)968 sc_signal<size_t> r_cas_trt_index; // Transaction Table index969 sc_signal<size_t> r_cas_upt_index; // Update Table index970 sc_signal<data_t> * r_cas_data; // cache line data942 sc_signal<int> r_cas_fsm; // FSM state 943 sc_signal<data_t> r_cas_wdata; // write data word 944 sc_signal<data_t> * r_cas_rdata; // read data word 945 sc_signal<uint32_t> r_cas_lfsr; // lfsr for random introducing 946 sc_signal<size_t> r_cas_cpt; // size of command 947 sc_signal<copy_t> r_cas_copy; // Srcid of the first copy 948 sc_signal<copy_t> r_cas_copy_cache; // Srcid of the first copy 949 sc_signal<bool> r_cas_copy_inst; // Type of the first copy 950 sc_signal<size_t> r_cas_count; // number of copies 951 sc_signal<size_t> r_cas_ptr; // pointer to the heap 952 sc_signal<size_t> r_cas_next_ptr; // next pointer to the heap 953 sc_signal<bool> r_cas_is_cnt; // is_cnt bit (in directory) 954 sc_signal<bool> r_cas_dirty; // dirty bit (in directory) 955 sc_signal<size_t> r_cas_way; // way in directory 956 sc_signal<size_t> r_cas_set; // set in directory 957 sc_signal<data_t> r_cas_tag; // cache line tag (in directory) 958 sc_signal<size_t> r_cas_trt_index; // Transaction Table index 959 sc_signal<size_t> r_cas_upt_index; // Update Table index 960 sc_signal<data_t> * r_cas_data; // cache line data 971 961 972 962 sc_signal<bool> r_cas_coherent; … … 974 964 // Buffer between CAS fsm and IXR_CMD fsm (XRAM write) 975 965 sc_signal<bool> r_cas_to_ixr_cmd_req; // valid request 976 sc_signal<addr_t> r_cas_to_ixr_cmd_nline; // cache line index 977 sc_signal<size_t> r_cas_to_ixr_cmd_trdid; // index in Transaction Table 978 sc_signal<bool> r_cas_to_ixr_cmd_write; // write request 979 sc_signal<data_t> * r_cas_to_ixr_cmd_data; // cache line data 980 966 sc_signal<bool> r_cas_to_ixr_cmd_put; // request type (GET/PUT) 967 sc_signal<size_t> r_cas_to_ixr_cmd_index; // TRT index 981 968 982 969 // Buffer between CAS fsm and TGT_RSP fsm … … 999 986 GenericFifo<size_t> m_cas_to_cc_send_srcid_fifo; // fifo for srcids 1000 987 1001 #if L1_MULTI_CACHE1002 GenericFifo<size_t> m_cas_to_cc_send_cache_id_fifo; // fifo for srcids1003 #endif1004 1005 988 //////////////////////////////////////////////////// 1006 989 // Registers controlled by the IXR_RSP fsm 1007 990 //////////////////////////////////////////////////// 1008 991 1009 sc_signal<int> r_ixr_rsp_fsm; // FSM state 1010 sc_signal<size_t> r_ixr_rsp_trt_index; // TRT entry index 1011 sc_signal<size_t> r_ixr_rsp_cpt; // word counter 992 sc_signal<int> r_ixr_rsp_fsm; // FSM state 993 sc_signal<size_t> r_ixr_rsp_trt_index; // TRT entry index 994 sc_signal<size_t> r_ixr_rsp_cpt; // word counter 995 996 // Buffer between IXR_RSP fsm and CONFIG fsm (response from the XRAM) 997 sc_signal<bool> r_ixr_rsp_to_config_ack; // one single bit 1012 998 1013 999 // Buffer between IXR_RSP fsm and XRAM_RSP fsm (response from the XRAM) 1014 sc_signal<bool> * r_ixr_rsp_to_xram_rsp_rok; // A xram response is ready1000 sc_signal<bool> * r_ixr_rsp_to_xram_rsp_rok; // one bit per TRT entry 1015 1001 1016 1002 //////////////////////////////////////////////////// … … 1055 1041 GenericFifo<size_t> m_xram_rsp_to_cc_send_srcid_fifo; // fifo for srcids 1056 1042 1057 #if L1_MULTI_CACHE 1058 GenericFifo<size_t> m_xram_rsp_to_cc_send_cache_id_fifo; // fifo for srcids 1059 #endif 1060 1061 // Buffer between XRAM_RSP fsm and IXR_CMD fsm (XRAM write) 1043 // Buffer between XRAM_RSP fsm and IXR_CMD fsm 1062 1044 sc_signal<bool> r_xram_rsp_to_ixr_cmd_req; // Valid request 1063 sc_signal<addr_t> r_xram_rsp_to_ixr_cmd_nline; // cache line index 1064 sc_signal<data_t> * r_xram_rsp_to_ixr_cmd_data; // cache line data 1065 sc_signal<size_t> r_xram_rsp_to_ixr_cmd_trdid; // index in transaction table 1045 sc_signal<size_t> r_xram_rsp_to_ixr_cmd_index; // TRT index 1066 1046 1067 1047 //RWT … … 1073 1053 1074 1054 sc_signal<int> r_ixr_cmd_fsm; 1075 sc_signal<size_t> r_ixr_cmd_cpt; 1055 sc_signal<size_t> r_ixr_cmd_word; // word index for a put 1056 sc_signal<size_t> r_ixr_cmd_trdid; // TRT index value 1057 sc_signal<addr_t> r_ixr_cmd_address; // address to XRAM 1058 sc_signal<data_t> * r_ixr_cmd_wdata; // cache line buffer 1059 sc_signal<bool> r_ixr_cmd_get; // transaction type (PUT/GET) 1076 1060 1077 1061 //////////////////////////////////////////////////// … … 1149 1133 sc_signal<data_t> *r_cleanup_to_ixr_cmd_data; 1150 1134 sc_signal<uint32_t> r_cleanup_to_ixr_cmd_srcid; 1151 sc_signal<uint32_t> r_cleanup_to_ixr_cmd_ trdid;1135 sc_signal<uint32_t> r_cleanup_to_ixr_cmd_index; 1152 1136 sc_signal<uint32_t> r_cleanup_to_ixr_cmd_pktid; 1153 1137 sc_signal<addr_t> r_cleanup_to_ixr_cmd_nline; -
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/RWT/modules/vci_mem_cache/caba/source/include/xram_transaction.h
r477 r495 34 34 bool rerror; // error returned by xram 35 35 data_t ll_key; // LL key returned by the llsc_global_table 36 bool config; // transaction required by CONFIG FSM 36 37 37 38 ///////////////////////////////////////////////////////////////////// … … 42 43 valid = false; 43 44 rerror = false; 45 config = false; 44 46 } 45 47 … … 80 82 rerror = source.rerror; 81 83 ll_key = source.ll_key; 84 config = source.config; 82 85 } 83 86 … … 87 90 void print() 88 91 { 92 std::cout << "------- TRT entry -------" << std::endl; 89 93 std::cout << "valid = " << valid << std::endl; 90 94 std::cout << "xram_read = " << xram_read << std::endl; … … 96 100 std::cout << "read_length = " << read_length << std::endl; 97 101 std::cout << "word_index = " << word_index << std::endl; 98 for(size_t i=0; i<wdata_be.size() ; i++){ 99 std::cout << "wdata_be [" << i <<"] = " << wdata_be[i] << std::endl; 100 } 101 for(size_t i=0; i<wdata.size() ; i++){ 102 std::cout << "wdata [" << i <<"] = " << wdata[i] << std::endl; 103 } 102 for(size_t i=0; i<wdata_be.size() ; i++) 103 { 104 std::cout << "wdata_be[" << std::dec << i << "] = " 105 << std::hex << wdata_be[i] << std::endl; 106 } 107 for(size_t i=0; i<wdata.size() ; i++) 108 { 109 std::cout << "wdata[" << std::dec << i << "] = " 110 << std::hex << wdata[i] << std::endl; 111 } 112 std::cout << "rerror = " << rerror << std::endl; 113 std::cout << "ll_key = " << ll_key << std::endl; 114 std::cout << "config = " << config << std::endl; 104 115 std::cout << std::endl; 105 std::cout << "rerror = " << rerror << std::endl;106 116 } 107 117 … … 114 124 wdata_be.clear(); 115 125 wdata.clear(); 116 valid=false; 117 rerror=false; 118 } 119 120 TransactionTabEntry(const TransactionTabEntry &source){ 126 valid = false; 127 rerror = false; 128 config = false; 129 } 130 131 TransactionTabEntry(const TransactionTabEntry &source) 132 { 121 133 valid = source.valid; 122 134 xram_read = source.xram_read; … … 132 144 rerror = source.rerror; 133 145 ll_key = source.ll_key; 146 config = source.config; 134 147 } 135 148 … … 197 210 delete [] tab; 198 211 } 199 200 212 ///////////////////////////////////////////////////////////////////// 201 213 // The size() function returns the size of the tab … … 205 217 return size_tab; 206 218 } 207 208 219 ///////////////////////////////////////////////////////////////////// 209 220 // The init() function initializes the transaction tab entries … … 211 222 void init() 212 223 { 213 for ( size_t i=0; i<size_tab; i++) { 224 for ( size_t i=0; i<size_tab; i++) 225 { 214 226 tab[i].init(); 215 227 } 216 228 } 217 218 229 ///////////////////////////////////////////////////////////////////// 219 230 // The print() function prints a transaction tab entry … … 223 234 void print(const size_t index) 224 235 { 225 assert( (index < size_tab) 226 && "Invalid Transaction Tab Entry"); 236 assert( (index < size_tab) and 237 "MEMC ERROR: The selected entry is out of range in TRT write_data_mask()"); 238 227 239 tab[index].print(); 228 240 return; 229 241 } 230 231 242 ///////////////////////////////////////////////////////////////////// 232 243 // The read() function returns a transaction tab entry. … … 236 247 TransactionTabEntry read(const size_t index) 237 248 { 238 assert( (index < size_tab) 239 && "Invalid Transaction Tab Entry"); 249 assert( (index < size_tab) and 250 "MEMC ERROR: Invalid Transaction Tab Entry"); 251 240 252 return tab[index]; 241 253 } 242 243 254 ///////////////////////////////////////////////////////////////////// 244 255 // The full() function returns the state of the transaction tab … … 249 260 bool full(size_t &index) 250 261 { 251 for(size_t i=0; i<size_tab; i++){ 252 if(!tab[i].valid){ 262 for(size_t i=0; i<size_tab; i++) 263 { 264 if(!tab[i].valid) 265 { 253 266 index=i; 254 267 return false; … … 257 270 return true; 258 271 } 259 260 272 ///////////////////////////////////////////////////////////////////// 261 273 // The hit_read() function checks if an XRAM read transaction exists … … 268 280 bool hit_read(const addr_t nline,size_t &index) 269 281 { 270 for(size_t i=0; i<size_tab; i++){ 271 if((tab[i].valid && (nline==tab[i].nline)) && (tab[i].xram_read)) { 282 for(size_t i=0; i<size_tab; i++) 283 { 284 if((tab[i].valid && (nline==tab[i].nline)) && (tab[i].xram_read)) 285 { 272 286 index=i; 273 287 return true; … … 276 290 return false; 277 291 } 278 279 292 /////////////////////////////////////////////////////////////////////// 280 293 // The hit_write() function looks if an XRAM write transaction exists … … 286 299 bool hit_write(const addr_t nline) 287 300 { 288 for(size_t i=0; i<size_tab; i++){ 289 if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read)) { 301 for(size_t i=0; i<size_tab; i++) 302 { 303 if(tab[i].valid && (nline==tab[i].nline) && !(tab[i].xram_read)) 304 { 290 305 return true; 291 306 } … … 325 340 const std::vector<data_t> &data) 326 341 { 327 assert( (index < size_tab) 328 && "Invalid Transaction Tab Entry"); 329 assert(be.size()==tab[index].wdata_be.size() 330 && "Bad data mask in write_data_mask in TransactionTab"); 331 assert(data.size()==tab[index].wdata.size() 332 && "Bad data in write_data_mask in TransactionTab"); 333 334 for(size_t i=0; i<tab[index].wdata_be.size() ; i++) { 342 assert( (index < size_tab) and 343 "MEMC ERROR: The selected entry is out of range in TRT write_data_mask()"); 344 345 assert( (be.size()==tab[index].wdata_be.size()) and 346 "MEMC ERROR: Bad be size in TRT write_data_mask()"); 347 348 assert( (data.size()==tab[index].wdata.size()) and 349 "MEMC ERROR: Bad data size in TRT write_data_mask()"); 350 351 for(size_t i=0; i<tab[index].wdata_be.size() ; i++) 352 { 335 353 tab[index].wdata_be[i] = tab[index].wdata_be[i] | be[i]; 336 354 data_t mask = be_to_mask(be[i]); … … 338 356 } 339 357 } 340 341 358 ///////////////////////////////////////////////////////////////////// 342 359 // The set() function registers a transaction (read or write) … … 355 372 // - data_be : the mask of the data to write (in case of write) 356 373 // - ll_key : the ll key (if any) returned by the llsc_global_table 374 // - config : transaction required by config FSM 357 375 ///////////////////////////////////////////////////////////////////// 358 376 void set(const size_t index, … … 367 385 const std::vector<be_t> &data_be, 368 386 const std::vector<data_t> &data, 369 const data_t ll_key = 0) 370 { 371 assert( (index < size_tab) 372 && "The selected entry is out of range in set() Transaction Tab"); 373 assert(data_be.size()==tab[index].wdata_be.size() 374 && "Bad data_be argument in set() TransactionTab"); 375 assert(data.size()==tab[index].wdata.size() 376 && "Bad data argument in set() TransactionTab"); 387 const data_t ll_key = 0, 388 const bool config = false) 389 { 390 assert( (index < size_tab) and 391 "MEMC ERROR: The selected entry is out of range in TRT set()"); 392 393 assert( (data_be.size()==tab[index].wdata_be.size()) and 394 "MEMC ERROR: Bad data_be argument in TRT set()"); 395 396 assert( (data.size()==tab[index].wdata.size()) and 397 "MEMC ERROR: Bad data argument in TRT set()"); 377 398 378 399 tab[index].valid = true; … … 386 407 tab[index].word_index = word_index; 387 408 tab[index].ll_key = ll_key; 409 tab[index].config = config; 388 410 for(size_t i=0; i<tab[index].wdata.size(); i++) 389 411 { … … 398 420 // The BE field in TRT is taken into account. 399 421 // Arguments : 400 // - index : the index of the transaction in the transaction tab 401 // - word_index : the index of the data in the line 402 // - data : a 64 bits value 403 // - error : invalid data 422 // - index : index of the entry in TRT 423 // - word : index of the 32 bits word in the line 424 // - data : 64 bits value (first data right) 404 425 ///////////////////////////////////////////////////////////////////// 405 426 void write_rsp(const size_t index, 406 427 const size_t word, 407 const wide_data_t data, 408 const bool rerror) 428 const wide_data_t data) 409 429 { 410 430 data_t value; 411 431 data_t mask; 412 432 413 if ( index >= size_tab ) 414 { 415 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 416 << " TRT entry out of range in write_rsp()" << std::endl; 417 exit(0); 418 } 419 if ( word > tab[index].wdata_be.size() ) 420 { 421 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 422 << " Bad word_index in write_rsp() in TRT" << std::endl; 423 exit(0); 424 } 425 if ( not tab[index].valid ) 426 { 427 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 428 << " TRT Entry invalid in write_rsp()" << std::endl; 429 exit(0); 430 } 431 if ( not tab[index].xram_read ) 432 { 433 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 434 << " TRT entry is not an XRAM GET in write_rsp()" << std::endl; 435 exit(0); 436 } 433 assert( (index < size_tab) and 434 "MEMC ERROR: The selected entry is out of range in TRT write_rsp()"); 435 436 assert( (word < tab[index].wdata_be.size()) and 437 "MEMC ERROR: Bad word index in TRT write_rsp()"); 438 439 assert( (tab[index].valid) and 440 "MEMC ERROR: TRT entry not valid in TRT write_rsp()"); 441 442 assert( (tab[index].xram_read ) and 443 "MEMC ERROR: TRT entry is not a GET in TRT write_rsp()"); 437 444 438 445 // first 32 bits word … … 445 452 mask = be_to_mask(tab[index].wdata_be[word+1]); 446 453 tab[index].wdata[word+1] = (tab[index].wdata[word+1] & mask) | (value & ~mask); 447 448 // error update 449 tab[index].rerror |= rerror; 450 } 451 454 } 452 455 ///////////////////////////////////////////////////////////////////// 453 456 // The erase() function erases an entry in the transaction tab. … … 457 460 void erase(const size_t index) 458 461 { 459 assert( (index < size_tab) 460 && "The selected entry is out of range in erase() Transaction Tab"); 462 assert( (index < size_tab) and 463 "MEMC ERROR: The selected entry is out of range in TRT erase()"); 464 461 465 tab[index].valid = false; 462 466 tab[index].rerror = false; 467 } 468 ///////////////////////////////////////////////////////////////////// 469 // The is_config() function returns the config flag value. 470 // Arguments : 471 // - index : the index of the entry in the transaction tab 472 ///////////////////////////////////////////////////////////////////// 473 bool is_config(const size_t index) 474 { 475 assert( (index < size_tab) and 476 "MEMC ERROR: The selected entry is out of range in TRT is_config()"); 477 478 return tab[index].config; 463 479 } 464 480 }; // end class TransactionTab
Note: See TracChangeset
for help on using the changeset viewer.