Ignore:
Timestamp:
Apr 23, 2014, 4:45:19 PM (10 years ago)
Author:
haoliu
Message:

MESI Bug fixed for llsc operation in vci_mem_cache component

File:
1 edited

Legend:

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

    r680 r682  
    31843184                            << " / count = " <<std::dec << entry.count
    31853185                            << " / copy = " <<std::dec << entry.owner.srcid
     3186                            << " / is_inst = " << entry.owner.inst
    31863187                            << " / is_cnt = " << entry.is_cnt << std::endl;
    31873188                        if((m_cmd_read_pktid_fifo.read() & 0x7) == TYPE_LL) std::cout << " / LL access" << std::endl;
     
    59545955
    59555956                    }
    5956                     if (!r_xram_rsp_victim_coherent.read())
    5957                     {
    5958                         addr_t min = r_xram_rsp_victim_nline.read()*m_words*4 ;
    5959                         addr_t max = r_xram_rsp_victim_nline.read()*m_words*4 + (m_words - 1)*4;
    5960                         m_llsc_table.sw(min, max);
    5961                     }
     5957                   // if (!r_xram_rsp_victim_coherent.read())
     5958                   // {
     5959                   //     addr_t min = r_xram_rsp_victim_nline.read()*m_words*4 ;
     5960                   //     addr_t max = r_xram_rsp_victim_nline.read()*m_words*4 + (m_words - 1)*4;
     5961                   //     m_llsc_table.sw(min, max);
     5962                   // }
    59625963#if DEBUG_MEMC_XRAM_RSP
    59635964                    if(m_debug)
     
    67596760                    //                              (r_cas_to_cleanup_nline.read() == r_cleanup_nline.read());
    67606761
    6761                     size_t match_cas_inval = (r_cleanup_locked_pktid.read() & 0x7) == TYPE_CAS;
     6762                    //size_t match_cas_inval = (r_cleanup_locked_pktid.read() & 0x7) == TYPE_CAS;
     6763                    //size_t match_sc_inval = (r_cleanup_locked_pktid.read() & 0x7) == TYPE_SC;
    67626764
    67636765                    bool match_ll = ((r_cleanup_locked_pktid.read() & 0x07) == TYPE_LL);
     
    67726774                    if( not r_cleanup_contains_data.read() )
    67736775                    {
     6776                        if(r_write_to_cleanup_req.read() and r_write_to_cleanup_nline.read() == r_cleanup_nline.read())
     6777                        //update the line with the data saved in write_to_cleanup_data table if the cleanup without data
     6778                        {
     6779                            for (size_t word = 0; word < m_words; word ++)
     6780                            {
     6781                                m_cache_data.write(way, set, word, r_write_to_cleanup_data[word].read(), r_write_to_cleanup_be[word].read());
     6782                            }
     6783                            //addr_t min = r_cleanup_nline.read()*m_words*4 ;
     6784                            //addr_t max = r_cleanup_nline.read()*m_words*4 + (m_words - 1)*4;
     6785                            //m_llsc_table.sw(min, max);
     6786                        }
     6787
    67746788                        size_t set = m_y[(addr_t)(cleanup_address)];
    67756789                        m_cache_data.read_line(way, set, r_cleanup_data);
     
    67816795                            m_cache_data.write(way, set, word, r_cleanup_data[word].read(), 0xF);
    67826796                        }
    6783                         addr_t min = r_cleanup_nline.read()*m_words*4 ;
    6784                         addr_t max = r_cleanup_nline.read()*m_words*4 + (m_words - 1)*4;
    6785                         m_llsc_table.sw(min, max);
     6797
     6798                        if((r_cleanup_locked_pktid.read() & 0x7) != TYPE_SC)
     6799                        {
     6800                            addr_t min = r_cleanup_nline.read()*m_words*4 ;
     6801                            addr_t max = r_cleanup_nline.read()*m_words*4 + (m_words - 1)*4;
     6802                            m_llsc_table.sw(min, max);
     6803                        }
    67866804                    }
    67876805
     
    68236841                    else // cas, getm, one copy updated in dir
    68246842                    {
    6825                         if(match_cas_inval)
    6826                         {
    6827                             entry.state     = ENTRY_SHARED;
    6828                             entry.count     = 0;
    6829                         }
    6830                         else if(r_cleanup_locked_is_read.read())
     6843                       // if(match_cas_inval or match_sc_inval)
     6844                       // {
     6845                       //     entry.state     = ENTRY_SHARED;
     6846                       //     entry.count     = 0;
     6847                       // }
     6848                        if(r_cleanup_locked_is_read.read())
    68316849                        {
    68326850                            entry.state         = ENTRY_EXCLUSIVE;
     
    68676885                    if(r_cleanup_to_tgt_rsp_req.read()) break;
    68686886
    6869                     size_t match_cas_inval = (r_cleanup_locked_pktid.read() & 0x7) == TYPE_CAS;
     6887                    //size_t match_cas_inval = (r_cleanup_locked_pktid.read() & 0x7) == TYPE_CAS;
    68706888
    68716889                    r_cleanup_to_tgt_rsp_req     = true;
     
    69066924                    }
    69076925
    6908                     if(r_write_to_cleanup_req.read())
     6926                    if(r_write_to_cleanup_req.read() and r_write_to_cleanup_nline.read() == r_cleanup_nline.read())
    69096927                        r_write_to_cleanup_req = false;
    69106928
     
    73707388                                          std::vector<be_t> (m_words,0),
    73717389                                          data_vector);
     7390
     7391                                addr_t min = r_cleanup_nline.read()*m_words*4 ;
     7392                                addr_t max = r_cleanup_nline.read()*m_words*4 + (m_words - 1)*4;
     7393                                m_llsc_table.sw(min, max);
    73727394                            }
    73737395                            //std::cout << "cleanup with a non coherent ligne in trt index = " << index << std::endl;
     
    1175611778                        DspinDhccpParam::dspin_set(
    1175711779                                flit,
    11758                                 DspinDhccpParam::TYPE_MULTI_INVAL_DATA,
     11780                                multi_inval_type,
    1175911781                                DspinDhccpParam::M2P_TYPE);
    1176011782                    }
Note: See TracChangeset for help on using the changeset viewer.