Changeset 32 for trunk/modules
- Timestamp:
- Apr 23, 2010, 4:41:46 PM (15 years ago)
- Location:
- trunk/modules/vci_mem_cache_v1/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache_v1/caba/source/include/vci_mem_cache_v1.h
r2 r32 489 489 sc_signal<int> r_llsc_fsm; // FSM state 490 490 sc_signal<data_t> r_llsc_data; // read data word 491 sc_signal<uint32_t> r_llsc_lfsr; // lfsr for random introducing 491 492 sc_signal<copy_t> r_llsc_i_copies; // bit_vector of copies 492 493 sc_signal<copy_t> r_llsc_d_copies; // bit_vector of copies -
trunk/modules/vci_mem_cache_v1/caba/source/src/vci_mem_cache_v1.cpp
r19 r32 33 33 //#define IDEBUG 34 34 //#define DEBUG_VCI_MEM_CACHE 2 35 #define RANDOMIZE_SC 35 36 36 37 namespace soclib { namespace caba { … … 469 470 r_init_rsp_to_tgt_rsp_req = false; 470 471 472 r_llsc_lfsr = -1; 471 473 r_llsc_to_tgt_rsp_req = false; 472 474 r_llsc_to_ixr_cmd_req = false; … … 2364 2366 r_llsc_i_copies = entry.i_copies; 2365 2367 r_llsc_count = entry.count; 2366 if ( entry.valid ) r_llsc_fsm = SC_DIR_LOCK; 2367 else r_llsc_fsm = LLSC_TRT_LOCK; 2368 /* to avoid livelock, force the atomic access to fail (pseudo-)randomly */ 2369 bool fail = (r_llsc_lfsr % (64) == 0); 2370 r_llsc_lfsr = (r_llsc_lfsr >> 1) ^ ((-(r_llsc_lfsr & 1)) & 0xd0000001); 2371 #ifdef RANDOMIZE_SC 2372 if(fail){ 2373 #else 2374 if(0){ 2375 #endif 2376 r_llsc_fsm = SC_RSP_FALSE; 2377 } else { 2378 if ( entry.valid ) r_llsc_fsm = SC_DIR_LOCK; 2379 else r_llsc_fsm = LLSC_TRT_LOCK; 2380 } 2368 2381 } else { 2369 2382 r_llsc_fsm = SC_RSP_FALSE;
Note: See TracChangeset
for help on using the changeset viewer.