Changeset 474


Ignore:
Timestamp:
Jul 25, 2013, 10:07:40 AM (11 years ago)
Author:
devigne
Message:

Introducing NON INCLUSIVITY property in the vci_mem_cache (ODCCP)

  • A define statement in the .cpp can be changed to activate or deactivate this characteristic.
File:
1 edited

Legend:

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

    r460 r474  
    5555
    5656#define RANDOMIZE_CAS        1
     57
     58#define ODCCP_NON_INCLUSIVE  1
     59
    5760
    5861namespace soclib { namespace caba {
     
    273276{
    274277  "ALLOC_DIR_RESET",
     278  "ALLOC_DIR_CONFIG",
    275279  "ALLOC_DIR_READ",
    276280  "ALLOC_DIR_WRITE",
     
    290294const char *alloc_upt_fsm_str[] =
    291295{
     296  "ALLOC_UPT_CONFIG",
    292297  "ALLOC_UPT_WRITE",
    293298  "ALLOC_UPT_XRAM_RSP",
     
    24942499        addr_t      addr      = (addr_t) m_cmd_read_addr_fifo.read();
    24952500        bool        hit_read  = m_trt.hit_read(m_nline[addr], index);
     2501#if ODCCP_NON_INCLUSIVE
     2502        bool        hit_write = (m_trt.hit_write(m_nline[addr], &index_write) or
     2503                                ((r_cleanup_to_ixr_cmd_nline.read() == m_nline[addr]) and r_cleanup_to_ixr_cmd_req.read()));
     2504#else
    24962505        bool        hit_write = m_trt.hit_write(m_nline[addr], &index_write);
     2506#endif
    24972507        bool        wok       = !m_trt.full(index);
    24982508
     
    32963306        size_t  hit_index = 0;
    32973307        size_t  wok_index = 0;
    3298         addr_t  addr  = (addr_t) r_write_address.read();
     3308        addr_t  addr      = (addr_t) r_write_address.read();
    32993309        bool    hit_read  = m_trt.hit_read(m_nline[addr], hit_index);
     3310#if ODCCP_NON_INCLUSIVE
     3311        bool    hit_write = (m_trt.hit_write(m_nline[addr]) or
     3312                            ((r_cleanup_to_ixr_cmd_nline.read() == m_nline[addr]) and r_cleanup_to_ixr_cmd_req.read()));
     3313#else
    33003314        bool    hit_write = m_trt.hit_write(m_nline[addr]);
     3315#endif
    33013316        bool    wok       = !m_trt.full(wok_index);
    33023317
     
    38633878    case IXR_RSP_ACK:        // Aknowledge the VCI response for a PUT
    38643879    {
     3880#if ODCCP_NON_INCLUSIVE
     3881      if(p_vci_ixr.rspval.read())
     3882      {
     3883        if (r_ixr_rsp_trt_index.read() == m_trt_lines)
     3884          r_ixr_rsp_fsm = IXR_RSP_IDLE;
     3885        else
     3886          r_ixr_rsp_fsm = IXR_RSP_TRT_ERASE;
     3887      }
     3888#else
    38653889      if(p_vci_ixr.rspval.read()) r_ixr_rsp_fsm = IXR_RSP_TRT_ERASE;
     3890#endif
    38663891
    38673892#if DEBUG_MEMC_IXR_RSP
     
    40234048        DirectoryEntry victim(m_cache_directory.select(set, way));
    40244049
     4050#if ODCCP_NON_INCLUSIVE
     4051        bool inval = (victim.count and victim.valid and victim.coherent) ;
     4052#else
    40254053        bool inval = (victim.count and victim.valid) ;
     4054#endif
    40264055
    40274056        // copy the victim line in a local buffer
     
    40484077        if(!r_xram_rsp_trt_buf.rerror)
    40494078        {
     4079#if ODCCP_NON_INCLUSIVE
     4080          r_xram_rsp_fsm = XRAM_RSP_INVAL_LOCK;
     4081#else
    40504082          /*ODCCP*/ //if victim is no coherent and there is an inval no coherent pending we wait
    40514083          if(!victim.coherent and r_xram_rsp_to_ixr_cmd_inval_ncc_pending.read())
     
    40574089            r_xram_rsp_fsm = XRAM_RSP_INVAL_LOCK;
    40584090          }
     4091#endif
    40594092        }
    40604093        else
     
    42084241      m_cache_directory.write(set, way, entry);
    42094242
    4210       // request an invalidattion request in UPT for victim line
     4243      // request an invalidation request in UPT for victim line
    42114244      if(r_xram_rsp_victim_inval.read())
    42124245      {
     
    42544287#endif
    42554288
     4289#if ODCCP_NON_INCLUSIVE
     4290      if     (!r_xram_rsp_victim_dirty.read())       m_trt.erase(r_xram_rsp_trt_index.read());
     4291
     4292      if     (r_xram_rsp_victim_dirty.read())        r_xram_rsp_fsm = XRAM_RSP_TRT_DIRTY;
     4293      else if(r_xram_rsp_trt_buf.proc_read)          r_xram_rsp_fsm = XRAM_RSP_DIR_RSP;
     4294      else if(r_xram_rsp_victim_inval.read())        r_xram_rsp_fsm = XRAM_RSP_INVAL;
     4295      else                                           r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4296#else
    42564297      // If the victim is not dirty and coherent or victim's count egal 0 , we don't need another XRAM put transaction,
    42574298      // and we can erase the TRT entry
     
    42594300
    42604301      // Next state
    4261       if(r_xram_rsp_victim_dirty.read() or (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1)))       r_xram_rsp_fsm = XRAM_RSP_TRT_DIRTY;
     4302      if(r_xram_rsp_victim_dirty.read() or (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1)))       
     4303                                               r_xram_rsp_fsm = XRAM_RSP_TRT_DIRTY;
    42624304      else if(r_xram_rsp_trt_buf.proc_read)    r_xram_rsp_fsm = XRAM_RSP_DIR_RSP;
    42634305      else if(r_xram_rsp_victim_inval.read())  r_xram_rsp_fsm = XRAM_RSP_INVAL;
    42644306      else                                     r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4307#endif
    42654308      break;
    42664309    }
     
    43164359        r_xram_rsp_to_tgt_rsp_req    = true;
    43174360
    4318         if(r_xram_rsp_victim_inval)      r_xram_rsp_fsm = XRAM_RSP_INVAL;
    4319         else if(r_xram_rsp_victim_dirty or (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1))) r_xram_rsp_fsm = XRAM_RSP_WRITE_DIRTY;
    4320         else                             r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4361#if ODCCP_NON_INCLUSIVE
     4362        if     (r_xram_rsp_victim_inval.read())      r_xram_rsp_fsm = XRAM_RSP_INVAL;
     4363        else if(r_xram_rsp_victim_dirty.read())      r_xram_rsp_fsm = XRAM_RSP_WRITE_DIRTY;
     4364        else                                         r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4365#else
     4366        if(r_xram_rsp_victim_inval.read())           r_xram_rsp_fsm = XRAM_RSP_INVAL;
     4367        else if(r_xram_rsp_victim_dirty.read() or
     4368               (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1)))
     4369                                                     r_xram_rsp_fsm = XRAM_RSP_WRITE_DIRTY;
     4370        else                                         r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4371#endif
    43214372
    43224373#if DEBUG_MEMC_XRAM_RSP
     
    43534404        r_xram_rsp_next_ptr                 = r_xram_rsp_victim_ptr.read();
    43544405
    4355         if(r_xram_rsp_victim_dirty or (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1)))  r_xram_rsp_fsm = XRAM_RSP_WRITE_DIRTY;
     4406#if ODCCP_NON_INCLUSIVE
     4407        if(r_xram_rsp_victim_dirty.read())  r_xram_rsp_fsm = XRAM_RSP_WRITE_DIRTY;
     4408        else if(not_last_multi_req)         r_xram_rsp_fsm = XRAM_RSP_HEAP_REQ;
     4409        else                                r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4410#else
     4411        if(r_xram_rsp_victim_dirty or (!r_xram_rsp_victim_coherent.read() and (r_xram_rsp_victim_count.read() == 1))) 
     4412                                     r_xram_rsp_fsm = XRAM_RSP_WRITE_DIRTY;
    43564413        else if(not_last_multi_req)  r_xram_rsp_fsm = XRAM_RSP_HEAP_REQ;
    43574414        else                         r_xram_rsp_fsm = XRAM_RSP_IDLE;
     4415#endif
    43584416
    43594417#if DEBUG_MEMC_XRAM_RSP
     
    43804438        }
    43814439        m_cpt_write_dirty++;
    4382        
     4440
     4441#if (ODCCP_NON_INCLUSIVE == 0)
    43834442        // if victim is no coherent, we dont request a ixr command
    43844443        if( (!r_xram_rsp_victim_coherent.read()) and (r_xram_rsp_victim_count.read() == 1) )
     
    43894448          break;
    43904449        }
     4450#endif
    43914451
    43924452        bool multi_req = !r_xram_rsp_victim_is_cnt.read() and r_xram_rsp_victim_inval.read();
     
    54155475        {
    54165476          size_t index = 0;
    5417           bool   hit   = m_trt.hit_write(r_cleanup_nline.read(), &index); // we save the index of the matching entry in TRT
     5477          bool   hit   = m_trt.hit_write(r_cleanup_nline.read(), &index); // we save the index of the matching entry in TRT
     5478#if ODCCP_NON_INCLUSIVE
     5479          if (!hit)
     5480          {
     5481            for(size_t i = 0; i < m_words; i++){
     5482              r_cleanup_to_ixr_cmd_data[i]   = r_cleanup_data[i];
     5483            }
     5484            r_cleanup_to_ixr_cmd_req          = r_cleanup_contains_data.read();
     5485            r_cleanup_to_ixr_cmd_srcid        = r_cleanup_srcid.read();
     5486            r_cleanup_to_ixr_cmd_trdid        = m_trt_lines;
     5487            r_cleanup_to_ixr_cmd_pktid        = r_cleanup_pktid.read();
     5488            r_cleanup_to_ixr_cmd_nline        = r_cleanup_nline.read();
     5489            r_cleanup_to_ixr_cmd_l1_dirty_ncc = true;
     5490            r_cleanup_fsm = CLEANUP_SEND_CLACK;
     5491          }
     5492          else // wait until inval done
     5493          {
     5494            r_cleanup_fsm = CLEANUP_WAIT;
     5495          }
     5496
     5497#else
    54185498          if (!hit)
    54195499          {
    54205500            std::cout << "assert on line " << r_cleanup_nline.read() << " | at cycle " << std::dec <<m_cpt_cycles << std::endl;
    5421             for (int i=0; i<4; i++) m_trt.print(i);
     5501            for (size_t i = 0; i < m_trt_lines; i++) m_trt.print(i);
    54225502          }
    54235503          assert (hit and "CLEANUP_IXR_REQ found no matching entry in TRT");
     
    54355515          r_cleanup_to_ixr_cmd_l1_dirty_ncc = r_cleanup_contains_data.read();
    54365516          r_cleanup_fsm = CLEANUP_SEND_CLACK;
     5517#endif
     5518
    54375519#if DEBUG_MEMC_CLEANUP
    54385520      if(m_debug)
Note: See TracChangeset for help on using the changeset viewer.