- Timestamp:
- Jun 27, 2013, 10:11:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache/caba/source/include/xram_transaction.h
r385 r422 13 13 //////////////////////////////////////////////////////////////////////// 14 14 15 class TransactionTabEntry { 15 class TransactionTabEntry 16 { 16 17 typedef sc_dt::sc_uint<64> wide_data_t; 17 18 typedef sc_dt::sc_uint<40> addr_t; … … 84 85 // The print() function prints the entry 85 86 //////////////////////////////////////////////////////////////////// 86 void print(){ 87 void print() 88 { 87 89 std::cout << "valid = " << valid << std::endl; 88 90 std::cout << "xram_read = " << xram_read << std::endl; … … 137 139 // The transaction tab 138 140 //////////////////////////////////////////////////////////////////////// 139 class TransactionTab{ 141 class TransactionTab 142 { 140 143 typedef sc_dt::sc_uint<64> wide_data_t; 141 144 typedef sc_dt::sc_uint<40> addr_t; … … 144 147 145 148 private: 146 size_t size_tab; // The size of the tab 149 const std::string tab_name; // the name for logs 150 size_t size_tab; // the size of the tab 147 151 148 152 data_t be_to_mask(be_t be) … … 176 180 } 177 181 178 TransactionTab(size_t n_entries, size_t n_words) 179 { 180 size_tab = n_entries; 182 TransactionTab(const std::string &name, 183 size_t n_entries, 184 size_t n_words ) 185 : tab_name( name ), 186 size_tab( n_entries ) 187 { 181 188 tab = new TransactionTabEntry[size_tab]; 182 for ( size_t i=0; i<size_tab; i++) { 189 for ( size_t i=0; i<size_tab; i++) 190 { 183 191 tab[i].alloc(n_words); 184 192 } … … 385 393 data_t mask; 386 394 387 assert( (index < size_tab) 388 && "Selected entry out of range in write_rsp() Transaction Tab"); 389 assert( (word <= tab[index].wdata_be.size()) 390 && "Bad word_index in write_rsp() in TransactionTab"); 391 assert( tab[index].valid 392 && "Transaction Tab Entry invalid in write_rsp()"); 393 assert( tab[index].xram_read 394 && "Selected entry is not an XRAM read transaction in write_rsp()"); 395 if ( index >= size_tab ) 396 { 397 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 398 << " TRT entry out of range in write_rsp()" << std::endl; 399 exit(0); 400 } 401 if ( word > tab[index].wdata_be.size() ) 402 { 403 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 404 << " Bad word_index in write_rsp() in TRT" << std::endl; 405 exit(0); 406 } 407 if ( not tab[index].valid ) 408 { 409 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 410 << " TRT Entry invalid in write_rsp()" << std::endl; 411 exit(0); 412 } 413 if ( not tab[index].xram_read ) 414 { 415 std::cout << "VCI_MEM_CACHE ERRROR " << tab_name 416 << " TRT entry is not an XRAM GET in write_rsp()" << std::endl; 417 exit(0); 418 } 395 419 396 420 // first 32 bits word
Note: See TracChangeset
for help on using the changeset viewer.