Changeset 166 for trunk/modules


Ignore:
Timestamp:
May 11, 2011, 4:59:18 PM (13 years ago)
Author:
kane
Message:

(1) add modif from previous version (before merging), (2) add two registers to manage priority (FSM CMD)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_cc_xcache_wrapper_v4/caba/source/src/vci_cc_xcache_wrapper_v4.cpp

    r165 r166  
    32873287              ASSERT(p_vci_ini_c.reop and (p_vci_ini_c.rtrdid.read() == TYPE_DATA_CLEANUP),
    32883288                     "illegal response packet received for a cleanup transaction");
    3289               ASSERT(p_vci_ini_c.rerror.read() == vci_param::ERR_NORMAL,
     3289              ASSERT(p_vci_ini_c.rerror.read()&1 == vci_param::ERR_NORMAL,
    32903290                     "error signaled in a cleanup response" );
    32913291              ASSERT(p_vci_ini_c.rpktid.read() == (sc_dt::sc_uint<vci_param::P>)r_cleanup_num_cache,
     
    33063306              ASSERT(p_vci_ini_c.reop and (p_vci_ini_c.rtrdid.read() == TYPE_INS_CLEANUP),
    33073307                     "illegal response packet received for a cleanup transaction");
    3308               ASSERT(p_vci_ini_c.rerror.read() == vci_param::ERR_NORMAL,
     3308              ASSERT(p_vci_ini_c.rerror.read()&1 == vci_param::ERR_NORMAL,
    33093309                     "error signaled in a cleanup response" );
    33103310                   
     
    33633363      for (uint32_t i=0; i<m_nb_dcache; ++i)
    33643364        {
    3365           bool find = false;
     3365          uint32_t num_cache=(r_vci_cmd_num_dcache_prior+i)%m_nb_dcache;
     3366          bool     find = false;
    33663367         
    33673368          size_t  _wbuf_min   = 0;
     
    33743375          if (
    33753376#if CC_XCACHE_WRAPPER_DEBUG_FILE_TRANSACTION
    3376               (r_wbuf[i]->rok_info(&_wbuf_min, &_wbuf_max, &_wbuf_addr, &_wbuf_index)) and
     3377              (r_wbuf[num_cache]->rok_info(&_wbuf_min, &_wbuf_max, &_wbuf_addr, &_wbuf_index)) and
    33773378#else
    3378               (r_wbuf[i]->rok     (&_wbuf_min, &_wbuf_max)) and
     3379              (r_wbuf[num_cache]->rok     (&_wbuf_min, &_wbuf_max)) and
    33793380#endif                     
    33803381              (dcache_write_num_cache == m_nb_dcache))
    33813382            {
    33823383              find = true;
    3383               dcache_write_num_cache = i;
     3384              dcache_write_num_cache = num_cache;
    33843385             
    33853386              PRINTF("      * <CMD> wbuf min, max            : %d, %d\n",(int)_wbuf_min,(int)_wbuf_max);
     
    34213422          bool     dcache_miss_req      = false;
    34223423          bool     icache_miss_req      = false;
    3423           uint32_t dcache_miss_num_cache = 0;
    3424           uint32_t icache_miss_num_cache = 0;
     3424          uint32_t dcache_miss_num_cache = m_nb_dcache;
     3425          uint32_t icache_miss_num_cache = m_nb_icache;
    34253426          addr_40  addr = 0;
    34263427
     
    34293430     
    34303431          {
    3431             for (; dcache_miss_num_cache<m_nb_dcache; ++dcache_miss_num_cache)
     3432            for (uint32_t i=0; i<m_nb_dcache; ++i)
    34323433              {
    3433                 dcache_miss_req = r_dcache_miss_req[dcache_miss_num_cache];
     3434                uint32_t num_cache=(r_vci_cmd_num_dcache_prior+i)%m_nb_dcache;
     3435
     3436                dcache_miss_req = r_dcache_miss_req[num_cache];
    34343437                if (dcache_miss_req)
    3435                   break;
     3438                {
     3439                    dcache_miss_num_cache = num_cache;
     3440                    break;
     3441                }
    34363442              }
    3437             for (; icache_miss_num_cache<m_nb_icache; ++icache_miss_num_cache)
     3443            for (uint32_t i=0; i<m_nb_icache; ++i)
    34383444              {
    3439                 icache_miss_req = r_icache_miss_req[icache_miss_num_cache];
     3445                uint32_t num_cache=(r_vci_cmd_num_icache_prior+i)%m_nb_icache;
     3446
     3447                icache_miss_req = r_icache_miss_req[num_cache];
    34403448                if (icache_miss_req)
    3441                   break;
     3449                {
     3450                    icache_miss_num_cache = num_cache;
     3451                    break;
     3452                }
    34423453              }
    34433454
     
    34893500          }
    34903501
    3491           uint32_t dcache_unc_num_cache = 0;
    3492           for (; dcache_unc_num_cache<m_nb_dcache; ++dcache_unc_num_cache)
    3493             if (r_dcache_unc_req[dcache_unc_num_cache])
    3494               break;
    3495           uint32_t icache_unc_num_cache = 0;
    3496           for (; icache_unc_num_cache<m_nb_icache; ++icache_unc_num_cache)
    3497             if (r_icache_unc_req[icache_unc_num_cache])
    3498               break;
    3499           uint32_t dcache_sc_num_cache = 0;
    3500           for (; dcache_sc_num_cache<m_nb_dcache; ++dcache_sc_num_cache)
    3501             if (r_dcache_sc_req[dcache_sc_num_cache])
    3502               break;
     3502          uint32_t dcache_unc_num_cache = m_nb_dcache;
     3503          for (uint32_t i=0; i<m_nb_dcache; ++i)
     3504          {
     3505              uint32_t num_cache=(r_vci_cmd_num_dcache_prior+i)%m_nb_dcache;
     3506              if (r_dcache_unc_req[num_cache])
     3507              {
     3508                  dcache_unc_num_cache = num_cache;
     3509                  break;
     3510              }
     3511          }
     3512          uint32_t icache_unc_num_cache = m_nb_icache;
     3513          for (uint32_t i=0; i<m_nb_icache; ++i)
     3514          {
     3515              uint32_t num_cache=(r_vci_cmd_num_icache_prior+i)%m_nb_icache;
     3516              if (r_icache_unc_req[num_cache])
     3517              {
     3518                  icache_unc_num_cache = num_cache;
     3519                  break;
     3520              }
     3521          }
     3522          uint32_t dcache_sc_num_cache = m_nb_dcache;
     3523          for (uint32_t i=0; i<m_nb_dcache; ++i)
     3524          {
     3525              uint32_t num_cache=(r_vci_cmd_num_dcache_prior+i)%m_nb_dcache;
     3526              if (r_dcache_sc_req[num_cache])
     3527              {
     3528                  dcache_sc_num_cache = num_cache;
     3529                  break;
     3530              }
     3531          }
    35033532
    35043533          // 1 - Data Read
     
    38813910            PRINTF("      * <RSP> ins : %x\n",(int)p_vci_ini_rw.rdata.read());
    38823911
    3883             ASSERT( (r_vci_rsp_cpt < m_icache_words),
     3912            ASSERT( (r_vci_rsp_cpt.read() < m_icache_words),
    38843913                    "The VCI response packet for instruction miss is too long" );
    3885             r_vci_rsp_cpt = r_vci_rsp_cpt + 1;
     3914            r_vci_rsp_cpt = r_vci_rsp_cpt.read() + 1;
    38863915            vci_rsp_fifo_icache_put       = true,
    38873916            vci_rsp_fifo_icache_num_cache = r_vci_rsp_num_cache;
     
    38923921                PRINTF("      * <RSP> have reop\n");
    38933922
    3894                 ASSERT( ((r_vci_rsp_cpt == m_icache_words - 1) or
    3895                          p_vci_ini_rw.rerror.read() or
     3923                ASSERT( ((r_vci_rsp_cpt.read() == m_icache_words - 1) or
     3924                         (p_vci_ini_rw.rerror.read()&1) or
    38963925                         (r_vci_rsp_ins_error[r_vci_rsp_num_cache].read()&0x1)),
    38973926                        "The VCI response packet for instruction miss is too short");
     
    39293958            PRINTF("      * <RSP> have rspval - error : %d\n",(int)p_vci_ini_rw.rerror.read());
    39303959
    3931             ASSERT(r_vci_rsp_cpt < m_dcache_words,
     3960            ASSERT(r_vci_rsp_cpt.read() < m_dcache_words,
    39323961                   "illegal VCI response packet for data read miss");
    3933             r_vci_rsp_cpt = r_vci_rsp_cpt + 1;
     3962            r_vci_rsp_cpt = r_vci_rsp_cpt.read() + 1;
    39343963
    39353964            vci_rsp_fifo_dcache_put       = true,
     
    39383967
    39393968            if ( p_vci_ini_rw.reop.read() ) {
    3940               ASSERT( ((r_vci_rsp_cpt == m_dcache_words - 1)
     3969              ASSERT( ((r_vci_rsp_cpt.read() == m_dcache_words - 1)
    39413970                       or (p_vci_ini_rw.rerror.read()&0x1)
    39423971                       or r_vci_rsp_data_error[r_vci_rsp_num_cache].read()),
Note: See TracChangeset for help on using the changeset viewer.