Ignore:
Timestamp:
Sep 3, 2013, 4:16:40 PM (11 years ago)
Author:
haoliu
Message:

bug fix in vci_cc_vcache_wrapper(RWT)
In DCACHE_CC_INVAL state, the ligne should be in the zombi state
when it is NCC and non dirty

Location:
branches/RWT/modules/vci_cc_vcache_wrapper/caba/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h

    r495 r513  
    636636    sc_signal<bool>                        r_dcache_llsc_valid;
    637637
     638   
     639    sc_signal<bool>                        r_cache_frozen;
     640
    638641    ////////////////////////////////
    639642    // Activity counters
     
    801804    void clear_stats();
    802805    void print_trace(size_t mode = 0);
     806    bool frozen();
    803807    void cache_monitor(paddr_t addr);
    804808    void start_monitor(paddr_t,paddr_t);
  • branches/RWT/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r495 r513  
    20332033
    20342034        // Switch slot state to ZOMBI and send CLEANUP command
    2035         r_icache.write_dir( 0,
    2036                             r_icache_cc_way.read(),
     2035        r_icache.write_dir( r_icache_cc_way.read(),
    20372036                            r_icache_cc_set.read(),
    20382037                            CACHE_SLOT_STATE_ZOMBI );
     
    29132912                            }
    29142913                        }
     2914#if DEBUG_DCACHE
     2915if ( m_debug_activated )
     2916std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
     2917          << " WRITE REQ "
     2918          << " / wbuf_request = " << wbuf_request
     2919          << " / updt_request = " << updt_request
     2920          << " / cache_state = " << cache_state
     2921          << " / PADDR = " << std::hex << paddr << std::endl;
     2922#endif
     2923
    29152924                    } // end WRITE
    29162925
     
    39403949                r_dcache_miss_set     = set;
    39413950                r_dcache_cc_cleanup_line_ncc = true;
    3942                 //if (r_dcache_content_state[m_dcache_sets*way+set] != LINE_CACHE_DATA_NOT_DIRTY)//Must send data in the cleanup
    3943                 if (true)//Must send data in the cleanup
     3951                if (r_dcache_content_state[m_dcache_sets*way+set] != LINE_CACHE_DATA_NOT_DIRTY)//Must send data in the cleanup
     3952                //if (true)//Must send data in the cleanup
    39443953                {
    39453954                    r_dcache_xtn_flush_addr_data = (tag * m_dcache_sets + set) * m_dcache_words * 4;
     
    41894198                {
    41904199                    r_dcache_cc_cleanup_line_ncc = true;
    4191                     //if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY)) //must send data
    4192                     if (true) //must send data
     4200                    if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY)) //must send data
     4201                    //if (true) //must send data
    41934202                    {
    41944203                        r_dcache_cc_cleanup_updt_data = true;
     
    43344343            bool     s_cleanup_updt_data = false;
    43354344            bool     s_cleanup_line_ncc = false;
     4345            uint32_t mask = 0;
    43364346
    43374347#ifdef INSTRUMENTATION
     
    43604370                        s_cleanup_line_ncc = true;
    43614371                        r_dcache_miss_data_addr = (victim*m_dcache_words)*4;
    4362                         //if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY))//must send data
    4363                         if (true)//must send data
     4372                        if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY))//must send data
     4373                        //if (true)//must send data
    43644374                        {
    43654375                            s_cleanup_updt_data = true;
     
    43684378                                m_cpt_cleanup_data_dirty_word += r_dcache_dirty_word[(m_dcache_sets*way+set)*m_dcache_words + w];
    43694379                            }
     4380                            mask = r_dcache.get_cache_mask(way, set);
     4381                           // std::cout << "found a vcitim ncc dirty mask = " << mask << std::endl;
    43704382                            r_dcache_fsm = DCACHE_MISS_DATA;
    43714383                        }
     
    43734385                        {
    43744386                            s_cleanup_updt_data = false;
     4387                            mask = r_dcache.get_cache_mask(way, set);
     4388                           // std::cout << "found a vcitim ncc non dirty mask = " << mask << std::endl;
    43754389                        }
    43764390
     
    44014415                        r_dcache_cleanup_victim_updt_data = s_cleanup_updt_data;
    44024416                        r_dcache_cleanup_victim_line_ncc = s_cleanup_line_ncc;
    4403                         std::cout << "  <PROC " << name()
    4404                                   << "/ CYCLE = "
    4405                                   << m_cpt_total_cycles
    4406                                   << std :: endl;
    44074417                    }
    44084418                }
     
    46624672            {
    46634673                r_dcache_fsm = DCACHE_MISS_DIR_UPDT;
     4674                r_dcache.reset_cache_mask(r_dcache_miss_way.read(), r_dcache_miss_set.read());
    46644675            }
    46654676        }
     
    50975108if ( m_debug_activated )
    50985109{
    5099     std::cout << "  <PROC " << name()
     5110    std::cout << "  <PROC " << name() << std::hex
    51005111              << " DCACHE_CC_CHECK> paddr = " << paddr
    51015112              << " r_dcache_vci_paddr = " << r_dcache_vci_paddr.read()
     
    51075118              << " ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)) = "
    51085119              << ((r_dcache_vci_paddr.read() & mask) == (paddr & mask))
    5109               <<std::endl;
     5120              << std::dec <<std::endl;
    51105121}
    51115122#endif
     
    52735284        int      cache_state = r_dcache_cc_state.read();
    52745285        bool     dirty_save = false;
     5286        uint32_t mask = 0;
    52755287
    52765288        if (r_dcache_cc_need_write.read())
     
    53295341                {
    53305342                    r_dcache_cc_cleanup_line_ncc = true;
    5331                     //if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY) or r_dcache_dirty_save.read() or dirty_save) //must send data
    5332                     if (true) //must send data
     5343                    if ((r_dcache_content_state[way*m_dcache_sets+set] != LINE_CACHE_DATA_NOT_DIRTY) or r_dcache_dirty_save.read() or dirty_save) //must send data
     5344                    //if (true) //must send data
    53335345                    {
    53345346                        r_dcache_cc_cleanup_updt_data = true;
     
    53375349                            m_cpt_cleanup_data_dirty_word += r_dcache_dirty_word[(m_dcache_sets*way+set)*m_dcache_words + w];
    53385350                        }
     5351
     5352                        mask = r_dcache.get_cache_mask(way, set);
     5353                      //  std::cout << "cc inval ncc dirty mask = " << mask << std::endl;
     5354
    53395355                        r_dcache_fsm          = DCACHE_CC_INVAL_DATA;
    53405356                    }
    53415357                    else
    53425358                    {
     5359                        r_dcache.write_dir( way,
     5360                                            set,
     5361                                            CACHE_SLOT_STATE_ZOMBI );
     5362 
     5363                        mask = r_dcache.get_cache_mask(way, set);
     5364                      //  std::cout << "cc inval ncc non dirty mask = " << mask << std::endl;
     5365
    53435366                        r_dcache_cc_cleanup_updt_data = false;
    53445367                        r_dcache_fsm = r_dcache_fsm_cc_save.read();
Note: See TracChangeset for help on using the changeset viewer.