- Timestamp:
- May 1, 2013, 4:13:23 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.