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

MESI Bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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};
Note: See TracChangeset for help on using the changeset viewer.