Changeset 175


Ignore:
Timestamp:
Jun 5, 2011, 1:24:11 PM (13 years ago)
Author:
kane
Message:

vci_cc_xcache_wrapper_v4 : suppress one state (CC_UPDATE)

Location:
trunk
Files:
6 edited

Legend:

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

    r167 r175  
    9292#endif
    9393#ifndef CC_XCACHE_WRAPPER_DEBUG_CYCLE_MIN
    94 #define CC_XCACHE_WRAPPER_DEBUG_CYCLE_MIN             4725000
     94#define CC_XCACHE_WRAPPER_DEBUG_CYCLE_MIN             1013300
    9595#endif
    9696#ifndef CC_XCACHE_WRAPPER_DEBUG_FILE_TRANSACTION
     
    133133        DCACHE_CC_CHECK,
    134134        DCACHE_CC_INVAL,
    135         DCACHE_CC_UPDT,
    136135        DCACHE_CC_CLEANUP,
    137136    };
     
    147146        ICACHE_CC_CHECK,
    148147        ICACHE_CC_INVAL,
    149         ICACHE_CC_UPDT,
    150148    };
    151149
  • trunk/modules/vci_cc_xcache_wrapper_v4/caba/source/src/vci_cc_xcache_wrapper_v4.cpp

    r167 r175  
    8888# define set_num_icache(     addr,num_cache) set_num_cache     (addr,num_cache)
    8989# define set_num_icache_only(addr,num_cache) set_num_cache_only(addr,num_cache)
    90 # define get_num_dcache(     addr)           get_num_cache     (addr)         
    91 # define get_num_dcache_only(addr)           get_num_cache_only(addr)         
    92 # define set_num_dcache(     addr,num_cache) set_num_cache     (addr,num_cache)
    93 # define set_num_dcache_only(addr,num_cache) set_num_cache_only(addr,num_cache)
    9490#elif (CC_XCACHE_WRAPPER_MULTI_CACHE==2)
    9591# define get_num_icache(     addr,num_cpu)   num_cpu
     
    9793# define set_num_icache(     addr,num_cache) do  {} while (0)
    9894# define set_num_icache_only(addr,num_cache) addr
     95#else
     96#error "Invalid value to CC_XCACHE_WRAPPER_MULTI_CACHE"
     97#endif
    9998# define get_num_dcache(     addr)           get_num_cache     (addr)         
    10099# define get_num_dcache_only(addr)           get_num_cache_only(addr)         
    101100# define set_num_dcache(     addr,num_cache) set_num_cache     (addr,num_cache)
    102101# define set_num_dcache_only(addr,num_cache) set_num_cache_only(addr,num_cache)
    103 #else
    104 #error "Invalid value to CC_XCACHE_WRAPPER_MULTI_CACHE"
    105 #endif
    106102
    107103      const char *dcache_fsm_state_str[] = {
     
    118114        "DCACHE_CC_CHECK",
    119115        "DCACHE_CC_INVAL",
    120         "DCACHE_CC_UPDT",
    121116        "DCACHE_CC_CLEANUP",
    122117      };
     
    131126        "ICACHE_CC_CHECK",
    132127        "ICACHE_CC_INVAL",
    133         "ICACHE_CC_UPDT",
    134128      };
    135129      const char *cmd_fsm_state_str[] = {
     
    300294             "wbuf_nlines must be a multiple of nb cache.");
    301295
    302       // FIXME : s'adapter à la taille des requêtes XTN_READ/XTN_WRITE
     296      // FIXME : s'adapter à la taille des requêtes XTN_READ/XTN_WRITE, car le type est fournit dans le champs l'adresse
    303297      ASSERT((m_nb_dcache == 1) or (dcache_words >= 16),
    304298             "When multi cache is activated, need 4 bits (16 word) to the cache set .");
     
    576570            << _dcache_words << std::endl; // cache_nb_words
    577571        }
    578 
    579572#endif
    580573    } // end constructor
     
    12091202//           r_wbuf[num_cache]->printTrace(1);
    12101203// #endif
    1211 
    1212         }
     1204        }
     1205#if CC_XCACHE_WRAPPER_DEBUG
     1206      if (m_cpt_total_cycles>=CC_XCACHE_WRAPPER_DEBUG_CYCLE_MIN)
     1207      {
     1208          PRINTF("    * rsp_fifo_icache %s\n",name().c_str());
     1209          r_vci_rsp_fifo_icache_data     .print();
     1210          r_vci_rsp_fifo_icache_num_cache.print();
     1211          PRINTF("    * rsp_fifo_dcache %s\n",name().c_str());
     1212          r_vci_rsp_fifo_dcache_data     .print();
     1213          r_vci_rsp_fifo_dcache_num_cache.print();
     1214      }
     1215#endif
    12131216
    12141217      /////////////////////////////////////////////////////////////////////
     
    21382141              m_cpt_icache_data_read += m_icache_ways;
    21392142              addr_40 ad = r_tgt_iaddr;
    2140               data_t  icache_rdata = 0;
    21412143
    21422144              PRINTF("    * <ICACHE [%d]> CC_CHECK\n",num_cache);
     
    21572159                r_icache_fsm[num_cache] = r_icache_fsm_save[num_cache];
    21582160              } else {
    2159                 bool    icache_hit   = r_icache[num_cache]->read(ad, &icache_rdata);
     2161                uint32_t word       = r_cache_word;
     2162                data_t   mask       = vci_param::be2mask(r_tgt_be[word]);
     2163                data_t   rdata      = 0;
     2164                bool     icache_hit = r_icache[num_cache]->read(ad+word*4,&rdata);
    21602165
    21612166                PRINTF("    * <ICACHE [%d]> have no request, hit cache : %d\n",num_cache,icache_hit);
     
    21632168                if ( icache_hit and r_tgt_update)
    21642169                  {
    2165                     uint32_t word  = r_cache_word;
    2166                     data_t   mask  = vci_param::be2mask(r_tgt_be[word]);
    2167                     data_t   rdata = 0;
    2168 
    2169                     r_icache[num_cache]->read(ad+word*4,&rdata);
    2170                     r_tgt_buf[word] = (mask & r_tgt_buf[word]) | (~mask & rdata);
     2170                    // Assumption : We have RAM for icache with write enable on byte.
     2171                    // Consequence : icache_read is only consultation of directory
     2172
     2173                    //if(r_tgt_be[word])
     2174                    r_icache[num_cache]->write(ad+word*4, (mask & r_tgt_buf[word]) | (~mask & rdata));
    21712175                           
    21722176                    word ++;
     
    21792183                    if (word==m_icache_words)
    21802184                      {
    2181                         r_icache_fsm[num_cache] = ICACHE_CC_UPDT;
    2182 
    2183                         // find next valid word
    2184                         for (word=0; word<m_icache_words; ++word)
    2185                           if (r_tgt_be[word] != 0)
    2186                             break;
     2185                          r_tgt_icache_req[num_cache] = false;
     2186                          r_tgt_icache_rsp[num_cache] = true;
     2187                          r_icache_fsm    [num_cache] = r_icache_fsm_save[num_cache].read();
     2188                          word = 0;
    21872189                      }
    21882190                    r_cache_word = word;
     
    22142216              break;
    22152217            }   
    2216             /////////////////////
    2217           case ICACHE_CC_UPDT:
    2218             {                       
    2219               addr_40 ad = r_tgt_iaddr.read();
    2220               m_cpt_icache_dir_write++;
    2221               m_cpt_icache_data_write++;
    2222 
    2223               uint32_t word  = r_cache_word;
    2224 
    2225               if(r_tgt_be[word])
    2226                 r_icache[num_cache]->write(ad+word*4, r_tgt_buf[word]);
    2227 
    2228               word ++;
    2229              
    2230               // find next valid word
    2231               for (; word<m_icache_words; ++word)
    2232                 if (r_tgt_be[word] != 0)
    2233                   break;
    2234 
    2235               if (word==m_icache_words)
    2236                 {
    2237                   r_tgt_icache_req[num_cache] = false;
    2238                   r_tgt_icache_rsp[num_cache] = true;
    2239                   r_icache_fsm    [num_cache] = r_icache_fsm_save[num_cache].read();
    2240                   word = 0;
    2241                 }
    2242               r_cache_word = word;
    2243 
    2244               break;
    2245             }   
    2246 
    22472218          }// end switch r_icache_fsm
    22482219
     
    25152486                          if (not dcache_cached)
    25162487                            {
     2488                                ASSERT(not dcache_hit,
     2489                                       "Request is uncached, but hit in dcache!");
     2490
    25172491                              r_dcache_previous_unc[num_cache] = true;
    25182492                              m_cpt_data_write_uncached++;
     
    25202494                          else if (not dcache_hit)
    25212495                            m_cpt_data_write_miss++;
    2522                                         
     2496                                   
    25232497                          if (dcache_hit) {
    25242498                            // update data cache
     
    29222896            {
    29232897              addr_40  ad          = r_tgt_daddr;
    2924               data_t  dcache_rdata = 0;
    29252898
    29262899              PRINTF("    * <DCACHE [%d]> CC_CHECK\n",num_cache);
     
    29422915                r_dcache_fsm[num_cache] = r_dcache_fsm_save[num_cache];
    29432916              } else {
    2944                 bool    dcache_hit   = r_dcache[num_cache]->read(ad, &dcache_rdata);
     2917                uint32_t word       = r_cache_word;
     2918                data_t   mask       = vci_param::be2mask(r_tgt_be[word]);
     2919                data_t   rdata      = 0;
     2920                bool     dcache_hit = r_dcache[num_cache]->read(ad+word*4,&rdata);
    29452921
    29462922                PRINTF("    * <DCACHE [%d]> have no request, hit cache : %d, update : %d\n",num_cache,dcache_hit,(uint32_t)r_tgt_update);
    29472923
    2948                 m_cpt_dcache_data_read += m_dcache_ways;
     2924                m_cpt_dcache_data_write+= m_dcache_ways;
    29492925                m_cpt_dcache_dir_read += m_dcache_ways;
    29502926
    29512927                if ( dcache_hit and r_tgt_update )
    29522928                  {
    2953                     uint32_t word  = r_cache_word;
    2954                     data_t   mask  = vci_param::be2mask(r_tgt_be[word]);
    2955                     data_t   rdata = 0;
    2956 
    2957                     r_dcache[num_cache]->read(ad+word*4,&rdata);
    2958                            
    2959                     r_tgt_buf[word] = (mask & r_tgt_buf[word]) | (~mask & rdata);
     2929                    // Assumption : We have RAM for dcache with write enable on byte.
     2930                    // Consequence : dcache_read is only consultation of directory
     2931
     2932                    //if(r_tgt_be[word])
     2933                    r_dcache[num_cache]->write(ad+word*4, (mask & r_tgt_buf[word]) | (~mask & rdata));
    29602934
    29612935                    word ++;
     
    29682942                    if (word==m_dcache_words)
    29692943                      {
    2970                         r_dcache_fsm[num_cache] = DCACHE_CC_UPDT;
    2971 
    2972                         for (word=0; word<m_dcache_words; ++word)
    2973                           if (r_tgt_be[word] != 0)
    2974                             break;
     2944                        r_tgt_dcache_req[num_cache] = false;
     2945                        r_tgt_dcache_rsp[num_cache] = true;
     2946                        r_dcache_fsm    [num_cache] = r_dcache_fsm_save[num_cache];
     2947                        word = 0;
    29752948                      }
    29762949                    r_cache_word = word;
     
    29882961                }
    29892962              }
    2990               break;
    2991             }
    2992             ///////////////////
    2993           case DCACHE_CC_UPDT:    // update directory and data cache       
    2994             {
    2995               addr_40 ad = r_tgt_daddr;
    2996 
    2997               m_cpt_dcache_dir_write++;
    2998               m_cpt_dcache_data_write++;
    2999 
    3000               uint32_t word  = r_cache_word;
    3001                    
    3002               if(r_tgt_be[word])
    3003                 r_dcache[num_cache]->write(ad+word*4, r_tgt_buf[word]);
    3004 
    3005               word ++;
    3006 
    3007               for (; word<m_dcache_words; ++word)
    3008                 if (r_tgt_be[word] != 0)
    3009                   break;
    3010                    
    3011               if (word==m_dcache_words)
    3012                 {
    3013                   r_tgt_dcache_req[num_cache] = false;
    3014                   r_tgt_dcache_rsp[num_cache] = true;
    3015                   r_dcache_fsm    [num_cache] = r_dcache_fsm_save[num_cache];
    3016                   word = 0;
    3017                 }
    3018               r_cache_word = word;
    3019 
    30202963              break;
    30212964            }
     
    38983841
    38993842        m_cost_imiss_transaction++;
    3900         PRINTF("      * <RSP> rspval : %d\n",(uint32_t)p_vci_ini_rw.rspval.read());
     3843        PRINTF("      * <RSP> rspval : %d / r_vci_rsp_fifo_icache_data.wok %d\n",(uint32_t)p_vci_ini_rw.rspval.read(),(uint32_t)r_vci_rsp_fifo_icache_data.wok());
    39013844
    39023845        if (p_vci_ini_rw.rspval.read() and r_vci_rsp_fifo_icache_data.wok())
     
    39493892
    39503893        m_cost_dmiss_transaction++;
     3894
     3895        PRINTF("      * <RSP> rspval : %d / r_vci_rsp_fifo_icache_data.wok %d\n",(uint32_t)p_vci_ini_rw.rspval.read(),(uint32_t)r_vci_rsp_fifo_dcache_data.wok());
     3896
    39513897        if (p_vci_ini_rw.rspval.read() and r_vci_rsp_fifo_dcache_data.wok())
    39523898          {
    3953             PRINTF("      * <RSP> have rspval - error : %d\n",(int)p_vci_ini_rw.rerror.read());
     3899              PRINTF("      * <RSP> have rsp - r_vci_rsp_cpt : %d/%d\n",(uint32_t)r_vci_rsp_cpt.read(),(uint32_t)m_icache_words);
    39543900
    39553901            ASSERT(r_vci_rsp_cpt.read() < m_dcache_words,
  • trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp

    r143 r175  
    3030
    3131#define DEBUG_VCI_MEM_CACHE 0
    32 #define DEBUG_START_CYCLE   1500
     32#define DEBUG_START_CYCLE   1013300
    3333#define RANDOMIZE_SC
    3434
     
    15831583          if ( !r_write_to_tgt_rsp_req.read() ) {
    15841584
    1585             PRINTF("  * <MEM_CACHE.WRITE> YURI Request from %d.%d (%d)\n",(uint32_t)r_write_srcid.read(), (uint32_t)r_write_trdid.read(), (uint32_t)r_write_pktid.read());
     1585            PRINTF("  * <MEM_CACHE.WRITE> Request from %d.%d (%d)\n",(uint32_t)r_write_srcid.read(), (uint32_t)r_write_trdid.read(), (uint32_t)r_write_pktid.read());
    15861586
    15871587            r_write_to_tgt_rsp_req          = true;
     
    38203820      case TGT_RSP_READ:                // send the response
    38213821        {
     3822          PRINTF("* <MEM_CACHE.TGT> YURI RSP_READ     : rspack %d - cpt %d on %d\n", (int)p_vci_tgt.rspack,(int)r_tgt_rsp_cpt.read(),(int)(r_read_to_tgt_rsp_word.read()+r_read_to_tgt_rsp_length-1));
     3823
    38223824          if ( p_vci_tgt.rspack ) {
    38233825            if ( r_tgt_rsp_cpt.read() == (r_read_to_tgt_rsp_word.read()+r_read_to_tgt_rsp_length-1) ) {
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/configuration/default.cfg

    r167 r175  
    1 1
     12
    224 4
    334 64 16
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/define.h

    r165 r175  
    2828#define SORT_SHELL_SIZE                       5000
    2929#define MATRIX_MULTIPLICATION_ST_SIZE         50
    30 #define MATRIX_MULTIPLICATION_MT_SIZE         96
     30#define MATRIX_MULTIPLICATION_MT_SIZE         75
    3131#define MATRIX_MULTIPLICATION_MT_LOCK_BY_LINE 1
    3232#define SELF_CODE_MODIFYING_NB_RUNS           10
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/top.cpp

    r167 r175  
    3232
    3333#  define USE_OLD_XCACHE                    0
    34 #  define USE_VGMN                          1
    3534#  define NB_PROC_MIN                       1
    3635#  define NB_PROC_MAX                       15
     
    460459          sc_start(sc_core::sc_time(ncycles, SC_NS));
    461460
     461        // sc_start(sc_core::sc_time(1013000, SC_NS));
     462        // uint32_t num_cycle=1013000 ;
     463
     464        // for (uint32_t i=0; i<600; ++i)
     465        //   {
     466        //     std::cout << std::endl
     467        //               << std::dec << "===== [ cycle " << num_cycle << " ]======" << std::endl
     468        //               << std::endl;
     469        //     sc_start(sc_core::sc_time(1, SC_NS));
     470        //     interconnect_p.print_trace();
     471        //     num_cycle ++;
     472        //   }
     473
    462474        // std::cout << "Hit ENTER to end simulation" << std::endl;
    463475        // char buf[1];
Note: See TracChangeset for help on using the changeset viewer.