Ignore:
Timestamp:
Apr 14, 2014, 2:15:01 PM (10 years ago)
Author:
haoliu
Message:

MESI bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MESI/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r675 r677  
    22982298        {
    22992299
    2300 //#if 1
    2301 //            // @@@ DO NOT COMMIT: ALMOS KILLING SIMU PURPOSE
    2302 //            if (m_dreq.addr == 0x0 && m_dreq.wdata == 0xDEADDEAD) {
    2303 //                std::cout << "*** Ecriture à l'adresse 0 pour fin de simulation ***" << std::endl;
    2304 //                raise(SIGINT);
    2305 //            }
    2306 //#endif
     2300#if 1
     2301            // @@@ DO NOT COMMIT: ALMOS KILLING SIMU PURPOSE
     2302            if (m_dreq.addr == 0x0 && m_dreq.wdata == 0xDEADDEAD) {
     2303                std::cout << "*** Ecriture à l'adresse 0 pour fin de simulation ***" << std::endl;
     2304                raise(SIGINT);
     2305            }
     2306#endif
    23072307
    23082308            if ( r_mmu_mode.read() & DATA_TLB_MASK )  // DTLB activated
     
    46164616
    46174617        // coherence request (from CC_RECEIVE FSM)
    4618         if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() and not r_dcache_cleanup_victim_req.read() and not r_dcache_miss_updt.read())
     4618        if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() and not r_dcache_cleanup_victim_req.read() )
    46194619        {
    46204620            r_dcache_fsm = DCACHE_CC_CHECK;
     
    47554755
    47564756        // coherence request (from CC_RECEIVE FSM)
    4757         if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() and not r_dcache_cleanup_victim_req.read() and not r_dcache_miss_inval.read() and not r_dcache_miss_updt.read())
     4757        if ( r_cc_receive_dcache_req.read() and not r_dcache_cc_send_req.read() and not r_dcache_cleanup_victim_req.read() )
    47584758        {
    47594759            r_dcache_fsm = DCACHE_CC_CHECK;
     
    47624762        }
    47634763
    4764         if ( not r_dcache_miss_clack.read() and not r_dcache_cc_send_req.read())  // waiting cleanup acknowledge
     4764        if ( not r_dcache_miss_clack.read() )  // waiting cleanup acknowledge
    47654765        {
    47664766            if ( r_dcache_miss_inval.read() ) // switch slot to ZOMBI state, and new cleanup
    47674767            {
    4768                 r_dcache_miss_inval         = false;
    4769                 // request cleanup
    4770                 r_dcache_cc_send_req        = true;
    4771                 r_dcache_cc_send_nline      = r_dcache_save_paddr.read()/(m_dcache_words<<2);
    4772                 r_dcache_cc_send_way        = r_dcache_miss_way.read();
    4773                 r_dcache_cc_send_type       = CC_TYPE_CLEANUP;
    4774                 r_dcache_cc_line_dirty      = false;   // in case of miss inval, the cleanup is not with data.
    4775                 r_dcache_cc_line_no_shared  = r_dcache_rsp_state.read(); // the miss read rsp contents the state of this line
     4768                if(not r_dcache_cc_send_req.read())
     4769                {
     4770                    r_dcache_miss_inval         = false;
     4771                    // request cleanup
     4772                    r_dcache_cc_send_req        = true;
     4773                    r_dcache_cc_send_nline      = r_dcache_save_paddr.read()/(m_dcache_words<<2);
     4774                    r_dcache_cc_send_way        = r_dcache_miss_way.read();
     4775                    r_dcache_cc_send_type       = CC_TYPE_CLEANUP;
     4776                    r_dcache_cc_line_dirty      = false;   // in case of miss inval, the cleanup is not with data.
     4777                    r_dcache_cc_line_no_shared  = r_dcache_rsp_state.read(); // the miss read rsp contents the state of this line
    47764778
    47774779#ifdef INSTRUMENTATION
    47784780m_cpt_dcache_dir_write++;
    47794781#endif
    4780                 r_dcache.write_dir( r_dcache_save_paddr.read(),
    4781                                     r_dcache_miss_way.read(),
    4782                                     r_dcache_miss_set.read(),
    4783                                     CACHE_SLOT_STATE_ZOMBI );
     4782                    r_dcache.write_dir( r_dcache_save_paddr.read(),
     4783                                        r_dcache_miss_way.read(),
     4784                                        r_dcache_miss_set.read(),
     4785                                        CACHE_SLOT_STATE_ZOMBI );
    47844786
    47854787#if DEBUG_DCACHE
     
    47924794#endif
    47934795
    4794                 if( not r_dcache_miss_updt.read())
    4795                 {
    47964796                    r_dcache_fsm                = DCACHE_MISS_BACKOFF;
    47974797                    r_dcache_count_backoff      = r_dcache_count_backoff.read() + 1;
    47984798                    r_dcache_count_begin        = 0;                   
    47994799                }
    4800                 break;
    4801             }
    4802             else if( r_dcache_miss_updt.read())
    4803             {
    4804                 r_dcache_miss_updt              = false;
    4805                 r_cc_receive_dcache_req         = false;
    4806                 r_dcache_cc_send_req            = true;
    4807                 r_dcache_cc_send_multi_ack_miss = true;
    4808                 r_dcache_cc_send_nline          = r_cc_receive_dcache_nline.read();
    4809                 r_dcache_cc_send_updt_tab_idx   = r_cc_receive_dcache_updt_tab_idx.read();
    4810                 r_dcache_cc_send_type           = CC_TYPE_MULTI_ACK;
    4811 
    4812                 r_dcache_fsm                    = DCACHE_MISS_BACKOFF;
    4813                 r_dcache_count_backoff          = r_dcache_count_backoff.read() + 1;
    4814                 r_dcache_count_begin            = 0;   
     4800                else
     4801                {
     4802                    break;
     4803                }
    48154804            }
    48164805            else                              // switch slot to VALID state
     
    52935282            if(r_dcache_read_for_modify.read() and(r_dcache_miss_type.read() == PROC_MISS) and (r_cc_receive_dcache_type.read() != CC_TYPE_UPDT) and (state == CACHE_SLOT_STATE_SHARED))
    52945283            {
    5295                 r_dcache_fsm = DCACHE_CC_INVAL;
     5284                r_dcache_miss_clack = true;
     5285                r_dcache_fsm        = DCACHE_CC_INVAL;
    52965286            }
    52975287            else if(r_cc_receive_dcache_type.read() == CC_TYPE_UPDT)
    52985288            {
    5299                 r_dcache_fsm                    = r_dcache_fsm_cc_save.read();
    5300                 r_dcache_miss_updt              = true;
     5289                assert((state == CACHE_SLOT_STATE_INVALID) or (state == CACHE_SLOT_STATE_ZOMBI) && " CC_UPDT WITH A NO INVALID STATE");
     5290               
     5291                r_dcache_cc_send_multi_ack_miss = true;
    53015292                r_dcache_miss_inval             = true;
     5293                r_dcache_fsm                    = DCACHE_CC_UPDT;
    53025294            }
    53035295            else
     
    53895381                r_dcache_cc_send_multi_ack_miss = false;
    53905382            }
    5391             else if ( r_cc_receive_dcache_type.read() == CC_TYPE_INVAL or r_cc_receive_dcache_type.read() == CC_TYPE_BRDCAST) // hit inval
     5383            else if ( r_cc_receive_dcache_type.read() == CC_TYPE_INVAL ) // hit inval
    53925384            {
    53935385                r_dcache_fsm           = DCACHE_CC_INVAL;
     
    63276319                r_cc_receive_dcache_nline  = DspinDhccpParam::dspin_get(receive_data,
    63286320                                             DspinDhccpParam::BROADCAST_NLINE);
    6329                 r_cc_receive_dcache_type = CC_TYPE_BRDCAST;
     6321                r_cc_receive_dcache_type = CC_TYPE_INVAL;
    63306322                // request icache to handle the BROADCAST
    63316323                r_cc_receive_icache_req = true;
Note: See TracChangeset for help on using the changeset viewer.