Ignore:
Timestamp:
Apr 8, 2014, 11:36:22 PM (10 years ago)
Author:
haoliu
Message:

MESI Bug fixed in vci_cc_vcache_wrapper component

File:
1 edited

Legend:

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

    r670 r672  
    43984398                                  &found,
    43994399                                  &cleanup );
     4400
    44004401            state = r_dcache.get_cache_state(way,set);
    44014402
     
    52185219        }
    52195220
     5221        int    state = 0;
     5222        size_t way   = 0;
     5223        size_t set   = 0;
     5224        size_t word  = 0;
     5225        r_dcache.read_dir( paddr,
     5226                           &state,
     5227                           &way,
     5228                           &set,
     5229                           &word ); // unused
     5230
     5231        r_dcache_cc_state = state;
     5232        r_dcache_cc_way = way;
     5233        r_dcache_cc_set = set;
     5234        r_dcache_cc_inval_addr = (paddr &~0x3F);
    52205235       
    52215236        // Match between MISS address and CC address
     
    52295244        {
    52305245
    5231             if(r_cc_receive_dcache_type.read() == CC_TYPE_BRDCAST and r_dcache_read_for_modify.read() and (r_dcache_miss_type.read() == PROC_MISS))
     5246            if(r_cc_receive_dcache_type.read() == CC_TYPE_BRDCAST and r_dcache_read_for_modify.read() and
     5247               r_cc_receive_dcache_srcid.read() == m_srcid and (r_dcache_miss_type.read() == PROC_MISS))
    52325248            {
    52335249                r_cc_receive_dcache_req = false;
    5234                 r_dcache_fsm       = r_dcache_fsm_cc_save.read();
    5235             }
    5236             else
     5250                r_dcache_fsm            = r_dcache_fsm_cc_save.read();
     5251            }
     5252            else if(r_cc_receive_dcache_type.read() == CC_TYPE_BRDCAST and
     5253                    r_dcache_read_for_modify.read() and
     5254                    r_cc_receive_dcache_srcid.read() != m_srcid and
     5255                    (r_dcache_miss_type.read() == PROC_MISS) and
     5256                    (state == CACHE_SLOT_STATE_SHARED))
     5257            {
     5258                r_dcache_fsm        = DCACHE_CC_INVAL;
     5259            }
     5260            else if(r_cc_receive_dcache_type.read() == CC_TYPE_INVAL and r_dcache_read_for_modify.read() and
     5261                    (r_dcache_miss_type.read() == PROC_MISS) and
     5262                    (state == CACHE_SLOT_STATE_SHARED))
     5263            {
     5264                r_dcache_fsm        = DCACHE_CC_INVAL;
     5265            }
     5266            else
    52375267            {
    52385268                r_dcache_miss_inval = false;
     
    52805310        //    }
    52815311
    5282 #if DEBU//G_DCACHE
     5312#if DEBUG_DCACHE
    52835313if ( m_debug_activated )
    52845314{
     
    52965326        // CC request handler
    52975327       
    5298         int    state = 0;
    5299         size_t way   = 0;
    5300         size_t set   = 0;
    5301         size_t word  = 0;
     5328
    53025329
    53035330#ifdef INSTRUMENTATION
    53045331m_cpt_dcache_dir_read++;
    53055332#endif
    5306         r_dcache.read_dir( paddr,
    5307                            &state,
    5308                            &way,
    5309                            &set,
    5310                            &word ); // unused
     5333
    53115334
    53125335#if DEBUG_DCACHE
     
    53205343}
    53215344#endif
    5322         r_dcache_cc_state = state;
    5323         r_dcache_cc_way = way;
    5324         r_dcache_cc_set = set;
    5325         r_dcache_cc_inval_addr = (paddr &~0x3F);
     5345
    53265346
    53275347        if (state == CACHE_SLOT_STATE_EXCLUSIVE or state == CACHE_SLOT_STATE_MODIFIED)
     
    56005620    }
    56015621    } // end switch r_dcache_fsm
    5602 
    5603 //if(r_dcache_miss_updt.read())
    5604 //std::cout << "  <PROC " << name()
    5605 //          << " miss updt " << r_dcache_miss_updt.read() << std::endl;
     5622if(r_dcache_miss_updt.read())
     5623std::cout << "  <PROC " << name()
     5624          << " miss updt " << r_dcache_miss_updt.read() << std::endl;
    56065625
    56075626//std::cout << "  <PROC " << name()
Note: See TracChangeset for help on using the changeset viewer.