Changeset 144


Ignore:
Timestamp:
Mar 30, 2011, 6:30:22 PM (13 years ago)
Author:
kane
Message:

in vci_cc_xcache_wrapper_v4 : (1) Fix bug in MISS_VICTIM state, (2) add HIT after MISS, (3) add STORE after STORE

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_cc_xcache_wrapper_v4/caba/source/include/vci_cc_xcache_wrapper_v4.h

    r143 r144  
    7474 *     2    - icache dedicated
    7575 *
     76 * CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     77 *   (In multi-cache)
     78 *   A dcache used by a cpu and in miss_wait state can be use by
     79 *   an another cpu to make a load cached access.
     80 *
     81 * CC_XCACHE_WRAPPER_STORE_AFTER_STORE
     82 *   Store access in dcache (and hit) is make in two cycle :
     83 *    - first read directory and read data
     84 *    - second make a mask with old data and write new data.
     85 *   If data part has a write enable per byte, read data access can be suppress
     86 *   and we can pipeline consecutive store access.
     87 *
    7688 * CC_XCACHE_WRAPPER_STOP_SIMULATION :
    7789 *   stop simulation if processor is stall after a long time
     
    94106// implementation
    95107#ifndef CC_XCACHE_WRAPPER_FIFO_RSP
    96 #define CC_XCACHE_WRAPPER_FIFO_RSP                    1
     108#define CC_XCACHE_WRAPPER_FIFO_RSP                    2
    97109#endif
    98110#ifndef CC_XCACHE_WRAPPER_CC_UPDATE_MULTI_CYCLE
     
    107119#ifndef CC_XCACHE_WRAPPER_VCI_CMD_PRIORITY
    108120#define CC_XCACHE_WRAPPER_VCI_CMD_PRIORITY            3
    109 #endif 
     121#endif
    110122#ifndef CC_XCACHE_WRAPPER_MULTI_CACHE
    111123#define CC_XCACHE_WRAPPER_MULTI_CACHE                 2
     
    113125// <tsar toplevel>/modules/vci_mem_cache_v4/caba/source/include/mem_cache_directory_v4.h : L1_MULTI_CACHE 1
    114126// <soclib toplevel>/soclib/lib/multi_write_buffer/include/multi_write_buffer.h          : CC_XCACHE_MULTI_CACHE 1
     127#endif
     128#ifndef CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     129#define CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS  1
     130#endif
     131#ifndef CC_XCACHE_WRAPPER_STORE_AFTER_STORE
     132#define CC_XCACHE_WRAPPER_STORE_AFTER_STORE           1
    115133#endif
    116134 
     
    444462    uint32_t * m_cpt_icache_access; //[m_nb_icache]
    445463    uint32_t * m_cpt_dcache_access; //[m_nb_dcache]
     464    uint32_t * m_cpt_dcache_hit_after_miss_read;  //[m_nb_dcache]
     465    uint32_t * m_cpt_dcache_hit_after_miss_write; //[m_nb_dcache]
     466    uint32_t * m_cpt_dcache_store_after_store; //[m_nb_dcache]
     467    uint32_t * m_cpt_icache_miss_victim_wait; //[m_nb_icache]
     468    uint32_t * m_cpt_dcache_miss_victim_wait; //[m_nb_dcache]
    446469
    447470    uint32_t ** m_cpt_fsm_dcache;  //[m_nb_dcache]
     
    495518    ~VciCcXCacheWrapperV4();
    496519
    497     void print_trace(size_t mode = 0);
    498     void print_cpi();
    499     void print_stats();
     520  void print_trace(size_t mode = 0);
     521  void print_cpi();
     522  void print_stats(bool print_wbuf=true, bool print_fsm=true);
    500523
    501524// #if CC_XCACHE_WRAPPER_STOP_SIMULATION
  • trunk/modules/vci_cc_xcache_wrapper_v4/caba/source/src/vci_cc_xcache_wrapper_v4.cpp

    r143 r144  
    490490                dreq_num_cpu           = new uint32_t                            [m_nb_dcache];
    491491
    492                 m_cpt_icache_access = new uint32_t [m_nb_icache];
    493                 m_cpt_dcache_access = new uint32_t [m_nb_dcache];
    494 
     492                m_cpt_icache_access         = new uint32_t [m_nb_icache];
     493                m_cpt_dcache_access         = new uint32_t [m_nb_dcache];
     494                m_cpt_icache_miss_victim_wait = new uint32_t [m_nb_icache];
     495                m_cpt_dcache_miss_victim_wait = new uint32_t [m_nb_dcache];
     496
     497#if CC_XCACHE_WRAPPER_STORE_AFTER_STORE
     498                m_cpt_dcache_store_after_store    = new uint32_t [m_nb_dcache];
     499#endif
     500#if CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     501                m_cpt_dcache_hit_after_miss_read  = new uint32_t [m_nb_dcache];
     502                m_cpt_dcache_hit_after_miss_write = new uint32_t [m_nb_dcache];
     503#endif
    495504               
    496505                m_cpt_fsm_dcache  = new uint32_t * [m_nb_dcache];
     
    754763        delete [] m_cpt_icache_access   ;
    755764        delete [] m_cpt_dcache_access   ;
    756 
     765        delete [] m_cpt_icache_miss_victim_wait;
     766        delete [] m_cpt_dcache_miss_victim_wait;
     767#if CC_XCACHE_WRAPPER_STORE_AFTER_STORE
     768        delete [] m_cpt_dcache_store_after_store;
     769#endif
     770#if CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     771        delete [] m_cpt_dcache_hit_after_miss_read;
     772        delete [] m_cpt_dcache_hit_after_miss_write;
     773#endif
    757774        for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
    758775        delete [] m_cpt_fsm_dcache [num_cache];
     
    801818    }
    802819    ////////////////////////
    803     tmpl(void)::print_stats()
     820  tmpl(void)::print_stats(bool print_wbuf, bool print_fsm)
    804821    ////////////////////////
    805822    {
     
    860877        std::cout << "- DCACHE ACCESS                  : " << m_cpt_dcache_access_all << std::endl;
    861878        for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
    862             std::cout << "  + [" << num_cache << "] : " << m_cpt_dcache_access [num_cache] << " (" << (float)m_cpt_dcache_access [num_cache]*100.0/(float)m_cpt_dcache_access_all << "%)" << std::endl;
    863 
    864         std::cout << "- DCACHE FSM" << std::endl;
    865         for (uint32_t i=0; i<soclib::common::size(dcache_fsm_state_str ); ++i)
    866         {
    867             std::cout << "  + "  << dcache_fsm_state_str[i] << " :\t ";
    868             for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
    869                 std::cout << m_cpt_fsm_dcache [num_cache][i] << ", ";
    870             std::cout << std::endl;
    871         }
    872         std::cout << "- ICACHE FSM" << std::endl;
    873         for (uint32_t i=0; i<soclib::common::size(icache_fsm_state_str ); ++i)
    874         {
    875             std::cout << "  + "  << icache_fsm_state_str[i] << " :\t ";
    876             for (uint32_t num_cache=0; num_cache<m_nb_icache; ++num_cache)
    877                 std::cout << m_cpt_fsm_icache [num_cache][i] << ", ";
    878             std::cout << std::endl;
    879         }
    880         std::cout << "- CMD FSM" << std::endl;
    881         for (uint32_t i=0; i<soclib::common::size(cmd_fsm_state_str ); ++i)
    882             std::cout << "  + " << cmd_fsm_state_str[i] << " :\t " << m_cpt_fsm_cmd [i] << std::endl;
    883         std::cout << "- RSP FSM" << std::endl;
    884         for (uint32_t i=0; i<soclib::common::size(rsp_fsm_state_str ); ++i)
    885             std::cout << "  + " << rsp_fsm_state_str[i] << " :\t " << m_cpt_fsm_rsp [i] << std::endl;
    886         std::cout << "- TGT FSM" << std::endl;
    887         for (uint32_t i=0; i<soclib::common::size(tgt_fsm_state_str ); ++i)
    888             std::cout << "  + "  << tgt_fsm_state_str[i] << " :\t " << m_cpt_fsm_tgt [i] << std::endl;
    889         std::cout << "- CLEANUP FSM" << std::endl;
    890         for (uint32_t i=0; i<soclib::common::size(cleanup_fsm_state_str ); ++i)
    891             std::cout << "  + "  << cleanup_fsm_state_str[i] << " :\t " << m_cpt_fsm_cleanup [i] << std::endl;
     879          {
     880            std::cout << "  + [" << num_cache << "] : " << m_cpt_dcache_access [num_cache] << " (" << (float)m_cpt_dcache_access [num_cache]*100.0/(float)m_cpt_dcache_access_all << "%)";
     881
     882#if CC_XCACHE_WRAPPER_STORE_AFTER_STORE
     883            std::cout << " - store after store : " << m_cpt_dcache_store_after_store [num_cache];
     884#endif
     885#if CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     886            std::cout << " - Hit after Miss : Read " << m_cpt_dcache_hit_after_miss_read [num_cache] << ", Write " << m_cpt_dcache_hit_after_miss_write [num_cache];
     887#endif
     888            std::cout << std::endl;
     889          }
     890
     891        uint32_t m_cpt_icache_miss_victim_wait_all = 0;
     892        for (uint32_t num_cache=0; num_cache<m_nb_icache; ++num_cache)
     893            m_cpt_icache_miss_victim_wait_all += m_cpt_icache_miss_victim_wait [num_cache];
     894        std::cout << "- ICACHE MISS VICTIM WAIT        : " << m_cpt_icache_miss_victim_wait_all << std::endl;
     895        for (uint32_t num_cache=0; num_cache<m_nb_icache; ++num_cache)
     896            std::cout << "  + [" << num_cache << "] : " << m_cpt_icache_miss_victim_wait [num_cache] << std::endl;
     897
     898        uint32_t m_cpt_dcache_miss_victim_wait_all = 0;
     899        for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
     900            m_cpt_dcache_miss_victim_wait_all += m_cpt_dcache_miss_victim_wait [num_cache];
     901        std::cout << "- DCACHE MISS VICTIM WAIT        : " << m_cpt_dcache_miss_victim_wait_all << std::endl;
     902        for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
     903            std::cout << "  + [" << num_cache << "] : " << m_cpt_dcache_miss_victim_wait [num_cache] << std::endl;
     904
     905        if (print_fsm)
     906          {
     907            std::cout << "- DCACHE FSM" << std::endl;
     908            for (uint32_t i=0; i<soclib::common::size(dcache_fsm_state_str ); ++i)
     909              {
     910                std::cout << "  + "  << dcache_fsm_state_str[i] << " :\t ";
     911                for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
     912                  std::cout << m_cpt_fsm_dcache [num_cache][i] << ", ";
     913                std::cout << std::endl;
     914              }
     915            std::cout << "- ICACHE FSM" << std::endl;
     916            for (uint32_t i=0; i<soclib::common::size(icache_fsm_state_str ); ++i)
     917              {
     918                std::cout << "  + "  << icache_fsm_state_str[i] << " :\t ";
     919                for (uint32_t num_cache=0; num_cache<m_nb_icache; ++num_cache)
     920                  std::cout << m_cpt_fsm_icache [num_cache][i] << ", ";
     921                std::cout << std::endl;
     922              }
     923            std::cout << "- CMD FSM" << std::endl;
     924            for (uint32_t i=0; i<soclib::common::size(cmd_fsm_state_str ); ++i)
     925              std::cout << "  + " << cmd_fsm_state_str[i] << " :\t " << m_cpt_fsm_cmd [i] << std::endl;
     926            std::cout << "- RSP FSM" << std::endl;
     927            for (uint32_t i=0; i<soclib::common::size(rsp_fsm_state_str ); ++i)
     928              std::cout << "  + " << rsp_fsm_state_str[i] << " :\t " << m_cpt_fsm_rsp [i] << std::endl;
     929            std::cout << "- TGT FSM" << std::endl;
     930            for (uint32_t i=0; i<soclib::common::size(tgt_fsm_state_str ); ++i)
     931              std::cout << "  + "  << tgt_fsm_state_str[i] << " :\t " << m_cpt_fsm_tgt [i] << std::endl;
     932            std::cout << "- CLEANUP FSM" << std::endl;
     933            for (uint32_t i=0; i<soclib::common::size(cleanup_fsm_state_str ); ++i)
     934              std::cout << "  + "  << cleanup_fsm_state_str[i] << " :\t " << m_cpt_fsm_cleanup [i] << std::endl;
     935          }
    892936
    893937        std::cout << "* : accepted or not by the cache" << std::endl ;
    894938
     939        if (print_wbuf)
    895940        for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
    896941            r_wbuf[num_cache]->printStatistics();
     
    10851130            for (uint32_t num_cache=0; num_cache<m_nb_icache; ++num_cache)
    10861131            {
    1087                 m_cpt_icache_access [num_cache] = 0;
     1132                m_cpt_icache_access           [num_cache] = 0;
     1133                m_cpt_icache_miss_victim_wait [num_cache] = 0;
    10881134
    10891135                for (uint32_t i=0; i<soclib::common::size(icache_fsm_state_str ); ++i)
     
    10921138            for (uint32_t num_cache=0; num_cache<m_nb_dcache; ++num_cache)
    10931139            {
    1094                 m_cpt_dcache_access [num_cache] = 0;
    1095 
     1140                m_cpt_dcache_access               [num_cache] = 0;
     1141                m_cpt_dcache_miss_victim_wait     [num_cache] = 0;
     1142
     1143#if CC_XCACHE_WRAPPER_STORE_AFTER_STORE
     1144                m_cpt_dcache_store_after_store    [num_cache] = 0;
     1145#endif
     1146#if CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     1147                m_cpt_dcache_hit_after_miss_read  [num_cache] = 0;
     1148                m_cpt_dcache_hit_after_miss_write [num_cache] = 0;
     1149#endif
    10961150                for (uint32_t i=0; i<soclib::common::size(dcache_fsm_state_str ); ++i)
    10971151                    m_cpt_fsm_dcache  [num_cache][i] = 0;
     
    16761730            num_cache = get_num_icache(addr,num_cpu);
    16771731
    1678             // test if already used
    1679             if (not ireq[num_cache].valid and
    1680                 (r_icache_lock [num_cache] == m_nb_cpu) or
    1681                 (r_icache_lock [num_cache] == num_cpu))
     1732            bool icache_req_valid = ((not ireq[num_cache].valid and               // no previous request in this cycle
     1733                                      (r_icache_lock [num_cache] == m_nb_cpu)) or // no previous request in previous cycle
     1734                                     (r_icache_lock [num_cache] == num_cpu));     // previous request in previous cycle by this cpu
     1735
     1736            if (icache_req_valid)
    16821737            {
    16831738                bool valid = _ireq.valid;
     
    17091764            addr      = (addr_40)_dreq.addr;
    17101765            num_cache = get_num_dcache(addr);
     1766           
     1767
     1768            bool dcache_no_lock      = (r_dcache_lock [num_cache] == m_nb_cpu);
     1769            bool dcache_lock_owner   = (r_dcache_lock [num_cache] == num_cpu);
     1770#if CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     1771            bool dcache_lock_no_owner= not dcache_no_lock and not dcache_lock_owner;
     1772            bool dcache_wait         = ((r_dcache_fsm[num_cache] == DCACHE_MISS_WAIT)//  or
     1773                                        // (r_dcache_fsm[num_cache] == DCACHE_UNC_WAIT) or
     1774                                        // (r_dcache_fsm[num_cache] == DCACHE_SC_WAIT)
     1775                                        );
     1776
     1777            bool dcache_req_valid = ((not dreq[num_cache].valid and               // no previous request in this cycle
     1778                                      not have_sync and                           // no sync instruction
     1779                                      (dcache_no_lock or
     1780                                       (dcache_lock_no_owner and dcache_wait))) or // no previous request in previous cycle
     1781                                     (dcache_lock_owner and not dcache_wait));     // previous request in previous cycle by this cpu
     1782#else
     1783            bool dcache_req_valid = ((not dreq[num_cache].valid and // no previous request in this cycle
     1784                                      not have_sync and             // no sync instruction
     1785                                      dcache_no_lock) or            // no previous request in previous cycle
     1786                                     dcache_lock_owner);            // previous request in previous cycle by this cpu
     1787#endif
     1788            // @@@@
     1789
    17111790
    17121791            // test if already used
    1713             if (not dreq[num_cache].valid and
    1714                 not have_sync and
    1715                 (r_dcache_lock [num_cache] == m_nb_cpu) or
    1716                 (r_dcache_lock [num_cache] == num_cpu))
     1792            if (dcache_req_valid)
    17171793            {
    17181794                bool valid = _dreq.valid;
     
    17221798                    PRINTF("    * <CPU2CACHE> DCACHE :    Transaction between cpu %d and cache %d (lock)\n",num_cpu,num_cache);
    17231799                    dreq_num_cache [num_cpu  ] = num_cache;
     1800
     1801#if CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     1802                    if (not dcache_lock_no_owner)
     1803#endif
    17241804                    r_dcache_lock [num_cache] = num_cpu;
    17251805                }
     
    18231903                        PRINTF("    * <ICACHE [%d]> hit %d - cached %d - cleanup_hit %d\n",num_cache, icache_hit, icache_cached, icache_cleanup_hit);
    18241904
    1825                         // ASSERT( not (icache_hit and icache_cleanup_hit),
    1826                         //         "Icache hit and icache_cleanup_hit");
    1827 
    18281905                        if (icache_hit and icache_cleanup_hit)
    18291906                        {
     
    18371914                                m_cpt_ins_miss++;
    18381915                                m_cost_ins_miss_frz++;
     1916                               
    18391917                                r_icache_addr_save[num_cache] = (addr_40) _ireq.addr;
    1840                                
    1841                                 CACHE_MISS_BUF_REQ_INIT(i,num_cache);
    1842                                
     1918
    18431919                                if ( icache_cached )
    18441920                                {
    1845                                     r_icache_fsm     [num_cache] = ICACHE_MISS_VICTIM;
    1846                                     r_icache_miss_req[num_cache] = true;
    1847                                    
     1921                                    // to prevent deadlock, miss victim don't be block
     1922                                    if (not r_icache_cleanup_req[num_cache])
     1923                                    {
     1924                                        CACHE_MISS_BUF_REQ_INIT(i,num_cache);
     1925                                        r_icache_fsm     [num_cache] = ICACHE_MISS_VICTIM;
     1926                                        r_icache_miss_req[num_cache] = true;
     1927                                    }
     1928                                    else
     1929                                        m_cpt_icache_miss_victim_wait [num_cache] ++;
    18481930                                }
    18491931                                else
    18501932                                {
     1933                                    CACHE_MISS_BUF_REQ_INIT(i,num_cache);
     1934                                    r_icache_addr_save[num_cache] = (addr_40) _ireq.addr;
     1935
    18511936                                    r_icache_fsm    [num_cache] = ICACHE_UNC_WAIT;
    18521937                                    r_icache_unc_req[num_cache] = true;
     
    18631948                        _irsp.valid          = icache_hit;
    18641949                        _irsp.instruction    = icache_ins;
    1865                     }
     1950                        }
    18661951                    break;
    18671952                }
     
    18691954            case ICACHE_MISS_VICTIM:
    18701955                {
    1871                     if (not r_icache_cleanup_req[num_cache])
     1956                    // if (not r_icache_cleanup_req[num_cache])
    18721957                    {
    18731958                        size_t     way;
     
    22852370                                            if (not dcache_cleanup_hit)
    22862371                                            {
    2287                                                 CACHE_MISS_BUF_REQ_INIT(d,num_cache);
    22882372                                               
    22892373                                                // Miss : send signal at the CMD_FSM (via r_dcache_miss_req or r_dcache_unc_req)
    22902374                                                if ( dcache_cached ) {
    2291                                                     m_cpt_data_read_miss++;
    2292                                                     m_cost_data_miss_frz++;
    2293                                                     r_dcache_miss_req [num_cache] = true;
    2294                                                     r_dcache_fsm [num_cache] = DCACHE_MISS_VICTIM;
    2295                                                    
     2375                                                    // to prevent deadlock, miss victim don't be block
     2376                                                    if (not r_dcache_cleanup_req[num_cache].read())
     2377                                                    {
     2378                                                        CACHE_MISS_BUF_REQ_INIT(d,num_cache);
     2379                                                       
     2380                                                        m_cpt_data_read_miss++;
     2381                                                        m_cost_data_miss_frz++;
     2382                                                        r_dcache_miss_req [num_cache] = true;
     2383                                                        r_dcache_fsm [num_cache] = DCACHE_MISS_VICTIM;
     2384                                                    }
     2385                                                    else
     2386                                                        m_cpt_icache_miss_victim_wait [num_cache] ++;
    22962387                                                } else {
    22972388                                                    if (not r_dcache_previous_unc[num_cache].read()) // strongly order to the uncached access
    22982389                                                    {
     2390                                                        CACHE_MISS_BUF_REQ_INIT(d,num_cache);
     2391
    22992392                                                        r_dcache_previous_unc[num_cache] = true;
    23002393                                                       
     
    24512544                {
    24522545                    m_cpt_dcache_data_write++;
    2453                     data_t mask = vci_param::be2mask(r_dcache_be_save[num_cache]);
    2454                     data_t wdata = (mask & r_dcache_wdata_save[num_cache]) | (~mask & r_dcache_rdata_save[num_cache]);
    2455                     vci_addr_t ad = r_dcache_addr_save[num_cache].read();
     2546                    data_t     mask = vci_param::be2mask(r_dcache_be_save[num_cache]);
     2547                    data_t     wdata = (mask & r_dcache_wdata_save[num_cache]) | (~mask & r_dcache_rdata_save[num_cache]);
     2548                    vci_addr_t ad    = r_dcache_addr_save[num_cache].read();
    24562549                    r_dcache[num_cache]->write(ad, wdata);
    24572550
    2458                     r_dcache_fsm [num_cache] = DCACHE_IDLE;
     2551                    int dcache_fsm_next = DCACHE_IDLE; // default
     2552
     2553#if CC_XCACHE_WRAPPER_STORE_AFTER_STORE
     2554                    // Test if write after write
     2555
     2556                    if (_dreq.valid and (_dreq.type == iss_t::DATA_WRITE))
     2557                    {
     2558                        PRINTF("    * <DCACHE [%d]> Have dreq (Write after Write)\n",num_cache);
     2559
     2560                        data_t      dcache_rdata       = 0;
     2561                        // dcache_cached and dcache_hit don't used with _dreq.type == {DATA_SC, XTN_READ, XTN_WRITE}
     2562                        bool        dcache_cached      = dreq_cached  [num_cache];
     2563                        uint32_t    dcache_num_cpu     = dreq_num_cpu [num_cache];
     2564                        bool        dcache_hit         = r_dcache[num_cache]->read((vci_addr_t) _dreq.addr, &dcache_rdata);
     2565
     2566                        m_cpt_dcache_data_read += m_dcache_ways;
     2567                        m_cpt_dcache_dir_read  += m_dcache_ways;
     2568
     2569                        PRINTF("    * <DCACHE [%d]> r_dcache_previous_unc : %d\n",num_cache,r_dcache_previous_unc[num_cache].read());
     2570                       
     2571                        if (dcache_cached or not r_dcache_previous_unc[num_cache].read()) // strongly order to the uncached access
     2572                            {
     2573                                bool valid;
     2574                                addr_40 addr = _dreq.addr;
     2575                                set_num_dcache(addr,num_cache);
     2576                               
     2577                                // FIXME :
     2578                                //  * dans le wbuf, ne pas mettre l'adresse au complet (economie de surface)
     2579                                //  * pour cela, virer le set_num_dcache !
     2580                                valid = r_wbuf[num_cache]->write(addr, _dreq.be, _dreq.wdata, dcache_cached, dcache_num_cpu);
     2581                                PRINTF("    * <DCACHE [%d]> r_wbuf valid          : %d\n",num_cache,valid);
     2582                               
     2583                                if (valid)
     2584                                    {
     2585                                        m_cpt_dcache_store_after_store [num_cache] ++;
     2586                                       
     2587                                        m_cpt_data_write++;
     2588                                       
     2589                                        if (not dcache_cached)
     2590                                            {
     2591                                                r_dcache_previous_unc[num_cache] = true;
     2592                                                m_cpt_data_write_uncached++;
     2593                                            }
     2594                                        else if (not dcache_hit)
     2595                                            m_cpt_data_write_miss++;
     2596                                       
     2597                                        if (dcache_hit) {
     2598                                            // update data cache
     2599                                            dcache_fsm_next = DCACHE_WRITE_UPDT;
     2600                                        } else {
     2601                                            // write accepted
     2602                                            dcache_fsm_next = DCACHE_IDLE;
     2603                                        }
     2604                                    }
     2605                               
     2606                                _drsp.valid = valid;
     2607                                _drsp.rdata = 0;
     2608                            }
     2609
     2610                        r_dcache_addr_save   [num_cache] = (addr_40) _dreq.addr;
     2611                        // r_dcache_type_save   [num_cache] = _dreq.type;
     2612                        r_dcache_wdata_save  [num_cache] = _dreq.wdata;
     2613                        r_dcache_be_save     [num_cache] = _dreq.be;
     2614                        r_dcache_rdata_save  [num_cache] = dcache_rdata;
     2615                        // r_dcache_cached_save [num_cache] = dcache_cached;
     2616                        // r_dcache_num_cpu_save[num_cache] = dcache_num_cpu;
     2617                    }
     2618#endif
     2619
     2620                    r_dcache_fsm [num_cache] = dcache_fsm_next; // default
    24592621
    24602622                    break;
     
    24632625            case DCACHE_MISS_VICTIM:
    24642626                {
    2465                     if (not r_dcache_cleanup_req[num_cache].read())
     2627                    // if (not r_dcache_cleanup_req[num_cache].read())
    24662628                     {
    24672629                         size_t     way;
     
    24862648            case DCACHE_MISS_WAIT:
    24872649                {
     2650#if CC_XCACHE_WRAPPER_MULTI_CACHE_HIT_AFTER_MISS
     2651                  data_t   dcache_rdata   = 0;
     2652                  bool     dcache_hit     = r_dcache[num_cache]->read((vci_addr_t) _dreq.addr, &dcache_rdata);
     2653                  // bool     dcache_cached  = dreq_cached  [num_cache];
     2654                  // uint32_t dcache_num_cpu = dreq_num_cpu [num_cache];
     2655
     2656                  m_cpt_dcache_data_read += m_dcache_ways;
     2657                  m_cpt_dcache_dir_read  += m_dcache_ways;
     2658                 
     2659                  if (_dreq.valid)
     2660                    switch (_dreq.type)
     2661                      {
     2662                      case iss_t::DATA_READ : // accept only hit dcache load
     2663                        {
     2664                          m_cpt_data_read++; // new dcache read
     2665                         
     2666                          if (dcache_hit) // no special test for uncached read, because it's always miss
     2667                            {
     2668                              m_cpt_dcache_hit_after_miss_read [num_cache] ++;
     2669                             
     2670                              // address is in the cache : return the word
     2671                              _drsp.valid = true;
     2672                              _drsp.rdata = dcache_rdata; // return read data (cf dcache_hit)
     2673                            }
     2674                          break;
     2675                        }
     2676                      // case iss_t::DATA_WRITE : // accept only cached write and miss in dcache (else need update dcache)
     2677                      //   {
     2678                      //     if (dcache_cached and not dcache_hit)
     2679                      //       {
     2680                      //         bool valid;
     2681                      //         addr_40 addr = _dreq.addr;
     2682                      //         set_num_dcache(addr,num_cache);
     2683                             
     2684                      //         // FIXME :
     2685                      //         //  * dans le wbuf, ne pas mettre l'adresse au complet (economie de surface)
     2686                      //         //  * pour cela, virer le set_num_dcache !
     2687                      //         valid = r_wbuf[num_cache]->write(addr, _dreq.be, _dreq.wdata, dcache_cached, dcache_num_cpu);
     2688                      //         PRINTF("    * <DCACHE [%d]> r_wbuf valid          : %d\n",num_cache,valid);
     2689                             
     2690                      //         if (valid)
     2691                      //           {
     2692                      //             m_cpt_dcache_hit_after_miss_write [num_cache] ++;
     2693
     2694                      //             m_cpt_data_write++;
     2695                      //             m_cpt_data_write_miss++;
     2696                      //           }
     2697                             
     2698                      //         _drsp.valid = valid;
     2699                      //         _drsp.rdata = 0;
     2700                      //       }
     2701                      //     break;
     2702                      //   }
     2703                      default :
     2704                        {
     2705                          break;
     2706                        }
     2707                      }
     2708#endif
    24882709
    24892710                    // if ( _dreq.valid ) m_cost_data_miss_frz++;
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/configuration/default.cfg

    r143 r144  
    1 1
    2 4 4
     14
     21 1
    334 64 16
    444 64 16
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/define.h

    r143 r144  
    33
    44// List of benchmark
    5 #define BENCHMARK_NB_THREAD                   1
     5#define BENCHMARK_NB_THREAD                   4
    66
    77#define BENCHMARK_DHRYSTONE                   0
     
    1010#define BENCHMARK_SORT_INSERTION              0
    1111#define BENCHMARK_SORT_SELECTION              0
    12 #define BENCHMARK_SORT_SHELL                  1
     12#define BENCHMARK_SORT_SHELL                  0
    1313#define BENCHMARK_MATRIX_MULTIPLICATION_ST    0
    14 #define BENCHMARK_MATRIX_MULTIPLICATION_MT    0
     14#define BENCHMARK_MATRIX_MULTIPLICATION_MT    1
    1515#define BENCHMARK_SELF_CODE_MODIFYING         0
    1616
Note: See TracChangeset for help on using the changeset viewer.