Changeset 680


Ignore:
Timestamp:
Apr 17, 2014, 11:12:35 AM (10 years ago)
Author:
haoliu
Message:

MESI Bug fixed

Location:
branches/MESI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/MESI/communication/dspin_dhccp_param/caba/source/include/dspin_dhccp_param.h

    r670 r680  
    210210    static const uint8_t  MULTI_INVAL_IS_CONFIG_SHIFT  = 21;
    211211    static const uint64_t MULTI_INVAL_IS_CONFIG_MASK   = 1;
     212    static const uint8_t  BRDCAST_IS_CONFIG_SHIFT      = 1;
     213    static const uint64_t BRDCAST_IS_CONFIG_MASK       = 1;
     214 
     215    static const uint8_t  MULTI_INVAL_IS_SHARED_SHIFT  = 22;
     216    static const uint64_t MULTI_INVAL_IS_SHARED_MASK   = 1;
     217    static const uint8_t  BRDCAST_IS_SHARED_SHIFT      = 2;
     218    static const uint64_t BRDCAST_IS_SHARED_MASK       = 1;
    212219
    213220    static const uint8_t  MULTI_UPDT_DEST_SHIFT        = MULTI_INVAL_DEST_SHIFT;
     
    306313      MULTI_INVAL_NLINE,
    307314      MULTI_INVAL_IS_CONFIG,
     315      BRDCAST_IS_CONFIG,
     316      MULTI_INVAL_IS_SHARED,
     317      BRDCAST_IS_SHARED,
    308318
    309319      MULTI_UPDT_DEST,
     
    351361        GET_FIELD(flit,MULTI_INVAL_NLINE);
    352362        GET_FIELD(flit,MULTI_INVAL_IS_CONFIG);
     363        GET_FIELD(flit,BRDCAST_IS_CONFIG);
     364        GET_FIELD(flit,MULTI_INVAL_IS_SHARED);
     365        GET_FIELD(flit,BRDCAST_IS_SHARED);
    353366        GET_FIELD(flit,MULTI_UPDT_DEST);
    354367        GET_FIELD(flit,MULTI_UPDT_SRCID);
     
    395408        SET_FIELD(flit,value,MULTI_INVAL_NLINE);
    396409        SET_FIELD(flit,value,MULTI_INVAL_IS_CONFIG);
     410        SET_FIELD(flit,value,BRDCAST_IS_CONFIG);
     411        SET_FIELD(flit,value,MULTI_INVAL_IS_SHARED);
     412        SET_FIELD(flit,value,BRDCAST_IS_SHARED);
    397413        SET_FIELD(flit,value,MULTI_UPDT_DEST);
    398414        SET_FIELD(flit,value,MULTI_UPDT_SRCID);
  • branches/MESI/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r677 r680  
    388388      r_vci_rsp_fifo_dcache("r_vci_rsp_fifo_dcache", 16),       // 2 words depth
    389389//      r_vci_rsp_fifo_rpktid("r_vci_rsp_fifo_rpktid", 2),    // 2 words depth
    390       r_cc_send_data_fifo("r_cc_send_data_fifo", 16),
     390      r_cc_send_data_fifo("r_cc_send_data_fifo", 2),
    391391
    392392      r_cc_send_fsm("r_cc_send_fsm"),
     
    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
     
    52795279          ((r_dcache_vci_paddr.read() & mask) == (paddr & mask)))
    52805280        {
    5281 
    5282             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))
     5281           
     5282            if(r_dcache_read_for_modify.read() and(r_dcache_miss_type.read() == PROC_MISS) and
     5283              (r_cc_receive_dcache_type.read() != CC_TYPE_UPDT) and (state == CACHE_SLOT_STATE_SHARED))
    52835284            {
    52845285                r_dcache_miss_clack = true;
    52855286                r_dcache_fsm        = DCACHE_CC_INVAL;
    52865287            }
     5288            else if(r_dcache_read_for_modify.read() and (r_dcache_miss_type.read() == PROC_MISS) and
     5289                   (r_cc_receive_dcache_type.read() == CC_TYPE_BRDCAST) and (state == CACHE_SLOT_STATE_INVALID) and
     5290                   (r_cc_receive_dcache_srcid.read() == m_srcid))
     5291            {
     5292                r_cc_receive_dcache_req = false;
     5293                r_dcache_fsm            = r_dcache_fsm_cc_save.read();
     5294            }   
    52875295            else if(r_cc_receive_dcache_type.read() == CC_TYPE_UPDT)
    52885296            {
     
    53445352    std::cout << "  <PROC " << name()
    53455353              << " DCACHE_CC_CHECK> Coherence request matching a pending miss:"
     5354              << " state =" << state
     5355              << " r_receive_srcid = " << std::hex << r_cc_receive_dcache_srcid.read()
     5356              << " m_proc_id = " << std::hex << m_proc_id
    53465357              << " PADDR = " << std::hex << paddr << std::endl;
    53475358}
     
    53815392                r_dcache_cc_send_multi_ack_miss = false;
    53825393            }
    5383             else if ( r_cc_receive_dcache_type.read() == CC_TYPE_INVAL ) // hit inval
     5394            else if ( r_cc_receive_dcache_type.read() != CC_TYPE_UPDT ) // hit inval
    53845395            {
    53855396                r_dcache_fsm           = DCACHE_CC_INVAL;
     
    63196330                r_cc_receive_dcache_nline  = DspinDhccpParam::dspin_get(receive_data,
    63206331                                             DspinDhccpParam::BROADCAST_NLINE);
    6321                 r_cc_receive_dcache_type = CC_TYPE_INVAL;
     6332                r_cc_receive_dcache_type = CC_TYPE_BRDCAST;
    63226333                // request icache to handle the BROADCAST
    63236334                r_cc_receive_icache_req = true;
  • branches/MESI/modules/vci_mem_cache/caba/source/include/update_tab.h

    r677 r680  
    2727  addr_t        nline;      // The identifier of the cache line
    2828  size_t        count;      // The number of acknowledge responses to receive
    29   bool      is_change;  // multi ack miss req sends this bit to 1
     29  bool      type;       // for a command read or write
     30  bool      is_changed; // multi ack miss req sends this bit to 1
    3031
    3132  UpdateTabEntry()
     
    4142    nline           = 0;
    4243    count           = 0;
    43     is_change   = 0;
     44    type            = 0;
     45    is_changed  = 0;
    4446  }
    4547
     
    5456                 addr_t i_nline,
    5557                 size_t i_count,
    56                  size_t i_is_change)
     58                 bool   i_type,
     59                 bool   i_is_changed)
    5760  {
    5861    valid           = i_valid;
     
    6669    nline           = i_nline;
    6770    count           = i_count;
    68     is_change   = i_is_change;
     71    type        = i_type;
     72    is_changed  = i_is_changed;
    6973  }
    7074
     
    8185    nline       = source.nline;
    8286    count       = source.count;
    83     is_change   = source.is_change;
     87    type        = source.type;
     88    is_changed  = source.is_changed;
    8489  }
    8590
     
    99104    nline       = 0;
    100105    count       = 0;
    101     is_change   = 0;
     106    type        = 0;
     107    is_changed  = 0;
    102108  }
    103109
     
    119125    nline       = source.nline;
    120126    count       = source.count;
    121     is_change   = source.is_change;
     127    type        = source.type;
     128    is_changed  = source.is_changed;
    122129  }
    123130
     
    136143              << " / trdid = " << trdid   
    137144              << " / pktid = " << pktid
     145              << " / type = "  << type
     146              << " / is_changed = "  << is_changed
    138147              << " / nline = " << nline  << std::endl;
    139148  }
     
    227236           const addr_t nline,
    228237           const size_t count,
     238           const bool   type,
    229239           size_t       &index,
    230            const bool   is_change=false)
     240           const bool   is_changed=false)
    231241  {
    232242    for ( size_t i=0 ; i<size_tab ; i++ )
     
    244254        tab[i].nline            = (addr_t) nline;
    245255        tab[i].count            = (size_t) count;
    246         tab[i].is_change    = is_change;
     256        tab[i].type         = type;
     257        tab[i].is_changed   = is_changed;
    247258        index                       = i;
    248259        return true;
     
    464475  {
    465476    assert(index<size_tab && "Bad Update Tab Entry");
    466     tab[index].is_change = true;
    467   }
    468 
    469   size_t is_change(const size_t index)
    470   {
    471     assert(index<size_tab && "Bad Update Tab Entry");
    472     return tab[index].is_change;
     477    tab[index].is_changed = true;
     478  }
     479
     480  bool is_changed(const size_t index)
     481  {
     482    assert(index<size_tab && "Bad Update Tab Entry");
     483    return tab[index].is_changed;
     484  }
     485
     486  bool is_read(const size_t index)
     487  {
     488    assert(index<size_tab && "Bad Update Tab Entry");
     489    return tab[index].type;
    473490  }
    474491};
  • branches/MESI/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h

    r677 r680  
    10241024      sc_signal<size_t>   r_cleanup_locked_index;   // ivt index
    10251025      sc_signal<bool>     r_cleanup_locked_is_updt;
    1026       sc_signal<bool>     r_cleanup_locked_is_change;
     1026      sc_signal<bool>     r_cleanup_locked_is_changed;
     1027      sc_signal<bool>     r_cleanup_locked_is_read;
    10271028
    10281029      sc_signal<size_t>   r_cleanup_miss_srcid;   // srcid of write rsp
  • branches/MESI/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp

    r678 r680  
    28442844                                            nline,
    28452845                                            nb_copies,
     2846                                            false,
    28462847                                            index);
    28472848
     
    32413242                            r_read_to_cc_send_brdcast_req   = not multi_req;
    32423243                            r_read_to_cc_send_nline         = nline;
    3243                             //r_read_to_cc_send_srcid         = m_cmd_read_srcid_fifo.read();
     3244                            r_read_to_cc_send_srcid         = m_cmd_read_srcid_fifo.read();
    32443245                            //r_read_to_cc_send_is_shared     = r_read_state.read() == ENTRY_SHARED;
    32453246
     
    32763277                                      nline,
    32773278                                      r_read_count.read(),
     3279                                      true,             //is a command read
    32783280                                      index);
    32793281                               
     
    34493451                                                           false,             // multi_inval 
    34503452                                                           true,              // it needs a read response
    3451                                                            false,              // acknowledge required
     3453                                                           false,             // acknowledge required
    34523454                                                           m_cmd_read_srcid_fifo.read(),
    34533455                                                           m_cmd_read_trdid_fifo.read(),
     
    34553457                                                           nline,
    34563458                                                           0x01,
     3459                                                           true,              // is a command read
    34573460                                                           index);
    34583461
     
    41394142                            else // invalid the line and send multi_inval or brdcast to cache L1, and set trt table to evict the line
    41404143                            {
    4141                                 if(entry.state == ENTRY_EXCLUSIVE)
    4142                                 {
    4143                                     r_write_inval_trt_send = false;
    4144                                 }
    4145                                 else
    4146                                 {
    4147                                     r_write_inval_trt_send = true;
    4148                                 }
    4149                                 r_write_fsm = WRITE_INVAL_TRT_LOCK;
     4144                               // if(entry.state == ENTRY_EXCLUSIVE)
     4145                               // {
     4146                               //     r_write_inval_trt_send = false;
     4147                               // }
     4148                               // else
     4149                               // {
     4150                               //     r_write_inval_trt_send = true;
     4151                               // }
     4152                                r_write_fsm = WRITE_INVAL_IVT_LOCK;
    41504153
    41514154                            }
     
    41554158                    {
    41564159                        // if a miss write matched with a trt wait situation(wait for dirty data), it must block the command write until the dirty data has arrived in memcache
    4157                         if(r_write_to_cleanup_req.read() and
    4158                            r_write_to_cleanup_nline.read() == nline)
    4159                         {
    4160                             std::cout << "hit write cleanup nline =" << std::hex << nline << std::endl;
    4161                             r_write_fsm = WRITE_WAIT;
    4162                         }
    4163                         else
    4164                         {
     4160                       // if(r_write_to_cleanup_req.read() and
     4161                       //    r_write_to_cleanup_nline.read() == nline)
     4162                       // {
     4163                       //     std::cout << "hit write cleanup nline =" << std::hex << nline << std::endl;
     4164                       //     r_write_fsm = WRITE_WAIT;
     4165                       // }
     4166                       // else
     4167                       // {
    41654168                            r_write_fsm = WRITE_MISS_TRT_LOCK;
    4166                         }
     4169                       // }
    41674170                    }
    41684171
     
    44194422                    m_heap.write(r_write_next_ptr.read(),last_entry);
    44204423
    4421                     r_write_fsm = WRITE_INVAL_XRAM_REQ;  //this is sure that this line is in shared state, it can be send to xram
     4424                    r_write_fsm = WRITE_IDLE;
    44224425
    44234426#if DEBUG_MEMC_XRAM_RSP
     
    49044907                            "MEMC ERROR in WRITE_INVAL_IVT_LOCK state: Bad DIR allocation");
    49054908
    4906                     assert( (r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE) and
    4907                             "MEMC ERROR in WRITE_INVAL_IVT_LOCK state: Bad TRT allocation");
    4908 
    4909                     size_t set          = m_y[(addr_t)(r_write_address.read())];
     4909                    //assert( (r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE) and
     4910                    //        "MEMC ERROR in WRITE_INVAL_IVT_LOCK state: Bad TRT allocation");
     4911                   
     4912                    size_t set         = m_y[(addr_t)(r_write_address.read())];
     4913                    size_t way         = r_write_way.read();
    49104914
    49114915                    bool cc_send_valid = not r_write_to_cc_send_multi_req.read() and
    4912                                          not r_write_to_cc_send_brdcast_req.read() and 
    4913                                             (r_write_inval_trt_send.read() or not r_write_to_cleanup_req.read());
     4916                                         not r_write_to_cc_send_brdcast_req.read() and
     4917                                         not (r_write_state.read() == ENTRY_EXCLUSIVE and r_write_to_cleanup_req.read());   
     4918                                           // (r_write_inval_trt_send.read() or not r_write_to_cleanup_req.read());
    49144919
    49154920                    if(r_alloc_ivt_fsm.read() == ALLOC_IVT_WRITE)
     
    49394944                                            nline,
    49404945                                            nb_copies,
     4946                                            false,       // is a command write
    49414947                                            index);
    49424948                         /*//   std::cout << " trt wait nline =" << std::hex << nline
     
    49484954                                << " / nb_copies = " << r_write_count.read() << std::endl;
    49494955#endif
     4956                           // for(size_t word=0 ; word<m_words ; word++)
     4957                           // {
     4958                           //     r_write_to_cleanup_be[word]   = r_write_be[word];
     4959                           //     r_write_to_cleanup_data[word] = r_write_data[word];
     4960
     4961                           //     data_t mask = 0;
     4962                           //     if(r_write_be[word].read() & 0x1) mask = mask | 0x000000FF;
     4963                           //     if(r_write_be[word].read() & 0x2) mask = mask | 0x0000FF00;
     4964                           //     if(r_write_be[word].read() & 0x4) mask = mask | 0x00FF0000;
     4965                           //     if(r_write_be[word].read() & 0x8) mask = mask | 0xFF000000;
     4966       
     4967                           //     // complete only if mask is not null (for energy consumption)
     4968                           //     r_write_data[word] =
     4969                           //         (r_write_data[word].read()         &  mask) |
     4970                           //         (m_cache_data.read(r_write_way.read(), set, word) & ~mask);
     4971                           ///*//     std::cout << std::hex
     4972                           //              << ((r_write_data[word].read()         &  mask) |
     4973                           //         (m_cache_data.read(r_write_way.read(), set, word) & ~mask)) << std::endl;*/
     4974                           // }
     4975
     4976                            DirectoryEntry entry;
     4977                            entry.state         = ENTRY_LOCKED;
     4978                            entry.dirty         = true;
     4979                            entry.tag           = r_write_tag.read();
     4980                            entry.is_cnt        = r_write_is_cnt.read();
     4981                            entry.lock          = r_write_lock.read();
     4982                            entry.owner.srcid   = r_write_copy.read();
     4983                            entry.owner.inst    = r_write_copy_inst.read();
     4984                            entry.ptr           = 0;
     4985                            entry.count         = r_write_count.read();
     4986           
     4987                            m_cache_directory.write(set, way, entry);
     4988           
     4989                            if ((r_write_pktid.read() & 0x7) == TYPE_SC)
     4990                            {
     4991                                m_llsc_table.sc(r_write_address.read(),
     4992                                        r_write_sc_key.read());
     4993                            }
     4994
    49504995                            for(size_t word=0 ; word<m_words ; word++)
    49514996                            {
    49524997                                r_write_to_cleanup_be[word]   = r_write_be[word];
    49534998                                r_write_to_cleanup_data[word] = r_write_data[word];
    4954 
    4955                                 data_t mask = 0;
    4956                                 if(r_write_be[word].read() & 0x1) mask = mask | 0x000000FF;
    4957                                 if(r_write_be[word].read() & 0x2) mask = mask | 0x0000FF00;
    4958                                 if(r_write_be[word].read() & 0x4) mask = mask | 0x00FF0000;
    4959                                 if(r_write_be[word].read() & 0x8) mask = mask | 0xFF000000;
    4960        
    4961                                 // complete only if mask is not null (for energy consumption)
    4962                                 r_write_data[word] =
    4963                                     (r_write_data[word].read()         &  mask) |
    4964                                     (m_cache_data.read(r_write_way.read(), set, word) & ~mask);
    4965                            /*//     std::cout << std::hex
    4966                                          << ((r_write_data[word].read()         &  mask) |
    4967                                     (m_cache_data.read(r_write_way.read(), set, word) & ~mask)) << std::endl;*/
     4999                               
     5000                                if(r_write_state.read() == ENTRY_SHARED)
     5001                                {
     5002                                    m_cache_data.write(way, set, word, r_write_data[word].read(), r_write_be[word].read());
     5003                                }
    49685004                            }
    4969                             r_write_fsm     = WRITE_DIR_INVAL;
     5005                            r_write_fsm     = WRITE_INVAL_CC_SEND;
    49705006                        }
    49715007                        else
     
    49865022                            "MEMC ERROR in WRITE_DIR_INVAL state: Bad DIR allocation");
    49875023
    4988                     assert( (r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE) and
    4989                             "MEMC ERROR in WRITE_DIR_INVAL state: Bad TRT allocation");
     5024                  //  assert( (r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE) and
     5025                  //          "MEMC ERROR in WRITE_DIR_INVAL state: Bad TRT allocation");
    49905026
    49915027                    assert( (r_alloc_ivt_fsm.read() == ALLOC_IVT_WRITE) and
    49925028                            "MEMC ERROR in WRITE_DIR_INVAL state: Bad IVT allocation");
    49935029
    4994                     // register PUT request in TRT
    4995                     std::vector<data_t> data_vector;
    4996                     data_vector.clear();
    4997                     for(size_t i=0; i<m_words; i++) data_vector.push_back(r_write_data[i].read());
    4998 
    4999                     m_trt.set( r_write_trt_index.read(),
    5000                                false,             // PUT request
    5001                                m_nline[(addr_t)(r_write_address.read())],
    5002                                0,                 // unused
    5003                                0,                 // unused
    5004                                0,                 // unused
    5005                                false,             // not a processor read
    5006                                0,                 // unused
    5007                                0,                 // unused
    5008                                std::vector<be_t> (m_words,0),
    5009                                data_vector );
     5030                  // register PUT request in TRT
     5031                  //  std::vector<data_t> data_vector;
     5032                  //  data_vector.clear();
     5033                  //  for(size_t i=0; i<m_words; i++) data_vector.push_back(r_write_data[i].read());
     5034
     5035                  //  m_trt.set( r_write_trt_index.read(),
     5036                  //             false,             // PUT request
     5037                  //             m_nline[(addr_t)(r_write_address.read())],
     5038                  //             0,                 // unused
     5039                  //             0,                 // unused
     5040                  //             0,                 // unused
     5041                  //             false,             // not a processor read
     5042                  //             0,                 // unused
     5043                  //             0,                 // unused
     5044                  //             std::vector<be_t> (m_words,0),
     5045                  //             data_vector );
    50105046
    50115047                    // invalidate directory entry
    50125048                    DirectoryEntry entry;
    5013                     entry.state         = ENTRY_INVALID;
    5014                     entry.dirty         = false;
    5015                     entry.tag           = 0;
    5016                     entry.is_cnt        = false;
     5049                    entry.state         = ENTRY_LOCKED;
     5050                    entry.dirty         = true;
     5051                    entry.tag           = r_write_tag.read();
     5052                    entry.is_cnt        = 0;
    50175053                    entry.lock          = false;
    50185054                    entry.owner.srcid   = 0;
     
    50495085                        bool not_last_multi_inval      = (r_write_count.read()  != 1) and not r_write_is_cnt.read();
    50505086                        bool multi_inval               = not r_write_is_cnt.read();
     5087
    50515088                        r_write_to_cc_send_multi_req   = last_multi_inval;
    50525089                        r_write_to_cc_send_brdcast_req = not multi_inval;
     
    50575094                        r_write_next_ptr               = r_write_ptr.read();
    50585095
     5096                        if(r_write_state.read() == ENTRY_EXCLUSIVE)
     5097                        {
     5098                            r_write_to_cleanup_req   = true;
     5099                            r_write_to_cleanup_nline = m_nline[(addr_t)(r_write_address.read())];
     5100                        }
     5101
    50595102                        if( not last_multi_inval and multi_inval)
    50605103                        {
     
    50635106                        else
    50645107                        {
    5065                             if(r_write_inval_trt_send.read())
    5066                             {
    5067                                 r_write_fsm = WRITE_INVAL_XRAM_REQ;
    5068                             }
    5069                             else //the line is in exlusive state, must wait for the
    5070                                  //response of multi_inval in reason of receiving the updated data
    5071                             {
     5108                           // if(r_write_inval_trt_send.read())
     5109                           // {
     5110                           //     r_write_fsm = WRITE_INVAL_XRAM_REQ;
     5111                           // }
     5112                           // else //the line is in exlusive state, must wait for the
     5113                           //      //response of multi_inval in reason of receiving the updated data
     5114                           // {
    50725115                                r_write_fsm              = WRITE_IDLE;
    5073                                 r_write_to_cleanup_req   = true;
    5074                                 r_write_to_cleanup_nline = m_nline[(addr_t)(r_write_address.read())];
    5075                             }
     5116
     5117                           // }
    50765118                        }
    50775119#if DEBUG_MEMC_WRITE
     
    59045946                                               r_xram_rsp_victim_nline.read(),
    59055947                                               count_copies,
     5948                                               false,      //unuse
    59065949                                               index);
    59075950
     
    66426685                            << " CLEANUP_LOCKED_IVT_LOCK> :"
    66436686                            << "/ is_updt =" << m_ivt.is_update(index)
    6644                             << "/ is_change =" << m_ivt.is_change(index)
     6687                            << "/ is_changed =" << m_ivt.is_changed(index)
    66456688                            << "/ match =" << match_inval
    66466689                            << "/ need rsp  =" << m_ivt.need_rsp(index)
     
    66546697                        r_cleanup_locked_index      = index;
    66556698                        r_cleanup_locked_is_updt    = m_ivt.is_update(index);
    6656                         r_cleanup_locked_is_change  = m_ivt.is_change(index);
    6657 
    6658                         if( m_ivt.is_update(index) and not m_ivt.is_change(index))
     6699                        r_cleanup_locked_is_changed = m_ivt.is_changed(index);
     6700                        r_cleanup_locked_is_read    = m_ivt.is_read(index);
     6701
     6702                        if( m_ivt.is_update(index) and not m_ivt.is_changed(index))
    66596703                        {
    66606704                            r_cleanup_fsm = CLEANUP_LOCKED_IVT_CLEAR;
     
    67126756
    67136757                    addr_t cleanup_address = r_cleanup_nline.read() * m_words * 4;
    6714                     size_t match_cas_multi_inval = r_cas_to_cleanup_req.read() and
    6715                                                   (r_cas_to_cleanup_nline.read() == r_cleanup_nline.read());
     6758                    //size_t match_cas_multi_inval = r_cas_to_cleanup_req.read() and
     6759                    //                              (r_cas_to_cleanup_nline.read() == r_cleanup_nline.read());
     6760
     6761                    size_t match_cas_inval = (r_cleanup_locked_pktid.read() & 0x7) == TYPE_CAS;
    67166762
    67176763                    bool match_ll = ((r_cleanup_locked_pktid.read() & 0x07) == TYPE_LL);
    6718                     DirectoryEntry  entry;
     6764
     6765                    DirectoryEntry      entry;
    67196766                    entry.is_cnt        = false;
    67206767                    entry.lock          = r_cleanup_lock.read();
     
    67396786                    }
    67406787
    6741                     if(r_cleanup_locked_is_updt.read() and not r_cleanup_locked_is_change.read()) //cleanup req cross with multi ack rsp. here, just decrements the count and remains the state.
     6788                    if(r_cleanup_locked_is_updt.read() and not r_cleanup_locked_is_changed.read()) //cleanup req cross with multi ack rsp. here, just decrements the count and remains the state.
    67426789                    {
    67436790                        assert(r_cleanup_count.read() == 1 && " only one copy when cleanup fsm receives a req for is_updt command");
     
    67486795                        r_cleanup_fsm       = CLEANUP_SEND_CLACK;
    67496796                    }
    6750                     else if(r_cleanup_locked_is_updt.read() and r_cleanup_locked_is_change.read())
     6797                    else if(r_cleanup_locked_is_updt.read() and r_cleanup_locked_is_changed.read())
    67516798                    {
    67526799                        entry.state = ENTRY_SHARED;
     
    67626809                        }
    67636810
    6764                         if((r_cleanup_locked_pktid.read() & 0x7) == 0x03)
     6811                        if((r_cleanup_locked_pktid.read() & 0x7) == TYPE_READ_INS_MISS)
    67656812                        {
    67666813                            entry.owner.inst = true;
     
    67766823                    else // cas, getm, one copy updated in dir
    67776824                    {
    6778                         if(match_cas_multi_inval)
     6825                        if(match_cas_inval)
    67796826                        {
    67806827                            entry.state     = ENTRY_SHARED;
    67816828                            entry.count     = 0;
    67826829                        }
     6830                        else if(r_cleanup_locked_is_read.read())
     6831                        {
     6832                            entry.state         = ENTRY_EXCLUSIVE;
     6833                            entry.count         = 1;
     6834                            entry.owner.srcid   = r_cleanup_locked_srcid.read();
     6835                        }
    67836836                        else
    67846837                        {
    67856838                            entry.state     = ENTRY_EXCLUSIVE;
    6786                             entry.count     = 1;
    6787                         }
    6788                         entry.owner.srcid   = r_cleanup_locked_srcid.read();
     6839                            entry.count     = 0;
     6840                        }
     6841
    67896842                        entry.owner.inst    = 0;
    67906843                        r_cleanup_fsm       = CLEANUP_LOCKED_RSP;
     
    68146867                    if(r_cleanup_to_tgt_rsp_req.read()) break;
    68156868
     6869                    size_t match_cas_inval = (r_cleanup_locked_pktid.read() & 0x7) == TYPE_CAS;
     6870
    68166871                    r_cleanup_to_tgt_rsp_req     = true;
    68176872                    r_cleanup_to_tgt_rsp_srcid   = r_cleanup_locked_srcid.read();
     
    68196874                    r_cleanup_to_tgt_rsp_nline   = r_cleanup_nline.read();
    68206875                   
    6821                     if(r_cleanup_locked_is_change.read() and r_cleanup_locked_is_updt.read())
     6876                    if(r_cleanup_locked_is_changed.read() and r_cleanup_locked_is_updt.read())
    68226877                    {
    68236878                        r_cleanup_to_tgt_rsp_pktid   = r_cleanup_locked_pktid.read(); // rsp for is_updt in shared state
     
    68306885
    68316886                    if(r_read_to_multi_ack_req.read() and (r_read_to_multi_ack_nline.read() == r_cleanup_nline.read()) and // rsp for LL or pheriph
    6832                       (r_cleanup_locked_is_change.read() and r_cleanup_locked_is_updt.read()))
     6887                      (r_cleanup_locked_is_changed.read() and r_cleanup_locked_is_updt.read()))
    68336888                    {
    68346889                        r_cleanup_to_tgt_rsp_ll_key     = r_read_to_multi_ack_ll_key.read();
     
    68516906                    }
    68526907
    6853                     if(r_cas_to_cleanup_req.read())
    6854                     {
    6855                         r_cas_to_cleanup_req        = false;
    6856                         r_cleanup_to_tgt_rsp_type   = true;
    6857                     }
    6858                     else
    6859                     {
    6860                         r_cleanup_to_tgt_rsp_type   = false;
    6861                     }
     6908                    if(r_write_to_cleanup_req.read())
     6909                        r_write_to_cleanup_req = false;
     6910
     6911                    r_cleanup_to_tgt_rsp_type   = not r_cleanup_locked_is_read.read();
    68626912
    68636913                    for(size_t i = 0; i<m_words; i++)
     
    72247274                        config_rsp_lines_cleanup_decr = true;
    72257275                    }
    7226 
     7276                   
     7277                    assert(r_cleanup_miss_need_rsp.read() == false && "THERE IS A CLEANUP MISS NEEDS RSP");
    72277278                    if (r_cleanup_miss_need_rsp.read())         
    72287279                    {
     
    72937344                            r_cleanup_to_ixr_cmd_req     = true;
    72947345
    7295                             if( (r_write_to_cleanup_req == true) and (r_write_to_cleanup_nline.read() == r_cleanup_nline.read()) )
    7296                             {
    7297                                 r_write_to_cleanup_req   = false;
    7298                             }
     7346                           // if( (r_write_to_cleanup_req == true) and (r_write_to_cleanup_nline.read() == r_cleanup_nline.read()) )
     7347                           // {
     7348                           //     r_write_to_cleanup_req   = false;
     7349                           // }
    72997350
    73007351                            if (r_cleanup_contains_data.read())
     
    76857736                        not r_cas_to_cc_send_multi_req.read()   and
    76867737                        not r_cas_to_cc_send_brdcast_req.read() and
    7687                         not r_cas_to_cleanup_req.read()         and
    76887738                            m_cas_to_cc_send_inst_fifo.wok())
    76897739                    {
     
    76957745                        addr_t      nline           = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
    76967746                        size_t      nb_copies_sent  = 0;
    7697                         if(r_cas_state.read() == ENTRY_EXCLUSIVE)
    7698                         {
    7699                             nb_copies_sent = 1;
    7700                         }
    7701                         else
    7702                         { 
     7747
     7748                       // if(r_cas_state.read() == ENTRY_EXCLUSIVE)
     7749                       // {
     7750                       //     nb_copies_sent = 1;
     7751                       // }
     7752                       // else
     7753                       // { 
    77037754                            nb_copies_sent = r_cas_count.read();
    7704                         }
     7755                       // }
    77057756//                        if(m_ivt.search_inval(nline, index) and r_cas_to_cleanup_req.read())
    77067757//                        {
     
    77237774                                        nline,
    77247775                                        nb_copies_sent,
     7776                                        false,   // is a command write
    77257777                                        index);
    77267778                        if(wok)   // coherence transaction registered in ivt
     
    77737825                         
    77747826                                r_cas_to_cc_send_nline        = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
    7775                                 r_cas_to_cleanup_req          = true;
    7776                                 r_cas_to_cleanup_nline        = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
     7827                                //r_cas_to_cleanup_req          = true;
     7828                                //r_cas_to_cleanup_nline        = m_nline[(addr_t)(m_cmd_cas_addr_fifo.read())];
    77777829                                r_cas_fsm        = CAS_IDLE;
    77787830                                cmd_cas_fifo_get = true;
     
    79047956                        if(entry.next == r_cas_next_ptr.read())    // last copy
    79057957                        {
    7906                             r_cas_to_cleanup_nline      = nline;
     7958                            //r_cas_to_cleanup_nline      = nline;
    79077959                            r_cas_to_cc_send_multi_req  = true;
    7908                             r_cas_to_cleanup_req        = true;
     7960                            //r_cas_to_cleanup_req        = true;
    79097961                            r_cas_fsm                   = CAS_HEAP_LAST;   // Response will be sent after receiving
    79107962                        }   
     
    80208072                                        nline,
    80218073                                        nb_copies,
     8074                                        false,  // is a command write
    80228075                                        index);
    80238076
     
    1161411667
    1161511668                    DspinDhccpParam::dspin_set( flit,
    11616                             m_broadcast_boundaries,
    11617                             DspinDhccpParam::BROADCAST_BOX);
    11618 
    11619                    // DspinDhccpParam::dspin_set( flit,
    11620                    //         r_read_to_cc_send_srcid.read(),    // send the srcid itself which demands the request getM
    11621                    //         DspinDhccpParam::BROADCAST_SRCID);
     11669                             m_broadcast_boundaries,
     11670                             DspinDhccpParam::BROADCAST_BOX);
     11671
     11672                     DspinDhccpParam::dspin_set( flit,
     11673                             r_read_to_cc_send_srcid.read(),    // send the srcid itself which demands the request getM
     11674                             DspinDhccpParam::BROADCAST_SRCID);
    1162211675
    1162311676                   // DspinDhccpParam::dspin_set( flit,
Note: See TracChangeset for help on using the changeset viewer.