Ignore:
Timestamp:
Mar 30, 2010, 10:23:25 AM (14 years ago)
Author:
guthmull
Message:

Fix the deadlock also for SC requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp

    r5 r6  
    3434//#define DEBUG_VCI_MEM_CACHE 1
    3535#define RANDOMIZE_SC
     36#define NCYCLES -1
    3637namespace soclib { namespace caba {
    3738
     
    579580
    580581#if DEBUG_VCI_MEM_CACHE
     582if(m_cpt_cycles > NCYCLES){
    581583    std::cout << "---------------------------------------------" << std::dec << std::endl;
    582584    std::cout << "MEM_CACHE " << m_srcid_ini << " ; Time = " << m_cpt_cycles << std::endl
     
    596598      << " - ALLOC_UPT FSM  = " << alloc_upt_fsm_str[r_alloc_upt_fsm] << std::endl
    597599      << " - ALLOC_HEAP FSM = " << alloc_heap_fsm_str[r_alloc_heap_fsm] << std::endl;
     600}
    598601#endif
    599602
     
    25092512            if(!hit_inval) {
    25102513#ifdef DEBUG_VCI_MEM_CACHE
     2514if(m_cpt_total_cycles > NCYCLES)
    25112515              std::cout << "MEM_CACHE WARNING: cleanup with no corresponding entry at address : " << std::hex << (r_cleanup_nline.read()*4*m_words) << std::dec << std::endl;
    25122516#endif
     
    27042708                        r_llsc_fsm = SC_TRT_LOCK;
    27052709                    } else {
    2706                         r_llsc_fsm = SC_UPT_LOCK;
     2710                        if( !r_llsc_to_init_cmd_multi_req.read() &&
     2711                            !r_llsc_to_init_cmd_brdcast_req.read()  )
     2712                            r_llsc_fsm = SC_UPT_LOCK;
     2713                        else
     2714                            r_llsc_fsm = SC_WAIT;
    27072715                    }
    27082716                } else {
     
    27222730          size_t word   = m_x[(vci_addr_t)(m_cmd_llsc_addr_fifo.read())];
    27232731
    2724           if(!r_llsc_count.read()){ // no update
    2725             // write data in cache
    2726             m_cache_data[way][set][word] = r_llsc_wdata.read();
    2727             if(r_llsc_cpt.read()==4)
    2728                 m_cache_data[way][set][word+1] = m_cmd_llsc_wdata_fifo.read();
    2729           }
     2732          m_cache_data[way][set][word] = r_llsc_wdata.read();
     2733          if(r_llsc_cpt.read()==4)
     2734              m_cache_data[way][set][word+1] = m_cmd_llsc_wdata_fifo.read();
    27302735         
    2731           if(r_llsc_count.read()) {  // Shared line
    2732 #ifdef LOCK_DEBUG
    2733             std::cout << "SC, shared line" << std::endl;
    2734 #endif
    2735 
    2736             if( !r_llsc_to_init_cmd_multi_req.read() &&
    2737                 !r_llsc_to_init_cmd_brdcast_req.read()  )
    2738                 r_llsc_fsm = SC_UPT_LOCK;
    2739             else
    2740                 r_llsc_fsm = SC_WAIT;
    2741           } else {
    2742             r_llsc_fsm = SC_RSP_TRUE;
    2743           }
     2736          r_llsc_fsm = SC_RSP_TRUE;
    27442737          break;
    27452738        }
Note: See TracChangeset for help on using the changeset viewer.