Ignore:
Timestamp:
May 16, 2009, 4:42:39 PM (15 years ago)
Author:
rosiere
Message:

1) Platforms : add new organization for test
2) Load_Store_Unit : add array to count nb_check in store_queue
3) Issue_queue and Core_Glue : rewrite the issue network
4) Special_Register_Unit : add reset value to register CID
5) Softwares : add multicontext test
6) Softwares : add SPECINT
7) Softwares : add MiBench?
7) Read_queue : inhib access for r0
8) Change Core_Glue (network) - dont yet support priority and load balancing scheme

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp

    r112 r117  
    242242
    243243        for (uint32_t i=0; i< _param->_size_store_queue             ; i++)
     244          {
     245          reg_STORE_QUEUE_NB_CHECK  [i] = 0;
    244246          _store_queue              [i]._state = STORE_QUEUE_EMPTY;
     247          }
    245248
    246249        for (uint32_t i=0; i< _param->_size_load_queue              ; i++)
     
    252255    else
    253256      {
     257        //================================================================
     258        // Interface "MEMORY_OUT"
     259        //================================================================
     260
     261        if ((    internal_MEMORY_OUT_VAL  == 1) and
     262            (PORT_READ(in_MEMORY_OUT_ACK[0]) == 1))
     263          {
     264            log_printf(TRACE,Load_store_unit,FUNCTION,"  * MEMORY_OUT[0] transaction");
     265
     266            switch (internal_MEMORY_OUT_SELECT_QUEUE)
     267              {
     268              case SELECT_STORE_QUEUE :
     269                {
     270                  // =======================
     271                  // ===== STORE_QUEUE =====
     272                  // =======================
     273                 
     274                  log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue [%d]",reg_STORE_QUEUE_PTR_READ);
     275           
     276                  // Entry flush and increase the read pointer
     277                  _store_queue [reg_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_EMPTY;
     278                 
     279                  reg_STORE_QUEUE_PTR_READ = (reg_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue;
     280
     281                  break;
     282                }
     283              case SELECT_LOAD_QUEUE :
     284                {
     285                  // ======================
     286                  // ===== LOAD_QUEUE =====
     287                  // ======================
     288                 
     289                  log_printf(TRACE,Load_store_unit,FUNCTION,"    * load_queue  [%d]",internal_MEMORY_OUT_PTR);
     290                 
     291                  // Entry flush and increase the read pointer
     292                 
     293                  _load_queue [internal_MEMORY_OUT_PTR]._state = LOAD_QUEUE_EMPTY;
     294                 
     295                  // reg_LOAD_QUEUE_PTR_READ = (reg_LOAD_QUEUE_PTR_READ+1)%_param->_size_load_queue;
     296
     297                  break;
     298                }
     299              case SELECT_LOAD_QUEUE_SPECULATIVE :
     300                {
     301                  log_printf(TRACE,Load_store_unit,FUNCTION,"    * load_queue  [%d] (speculative)",internal_MEMORY_OUT_PTR);
     302                 
     303                  // !!! WARNING !!!
     304                  // !!! Test special case :
     305                  // !!! in a cycle an instruction can check the last store AND commit instruction
     306                  // !!! also the memory_out is before the port_check
     307
     308                  _load_queue [internal_MEMORY_OUT_PTR]._state    = LOAD_QUEUE_CHECK;
     309                  // NOTE : a speculative load write in the register file.
     310                  // if the speculation is a miss, write_rd is re set at 1.
     311                  _load_queue [internal_MEMORY_OUT_PTR]._write_rd = 0;
     312
     313#ifdef STATISTICS
     314                  if (usage_is_set(_usage,USE_STATISTICS))
     315                    (*_stat_nb_inst_load_commit_speculative) ++;
     316#endif
     317
     318                  break;
     319                }
     320
     321                break;
     322              }
     323          }
     324
    254325        //================================================================
    255326        // Interface "PORT_CHECK"
     
    278349
    279350                // find a entry that it need a check
    280                 Tlsq_ptr_t index_store  = _load_queue[index_load]._store_queue_ptr_write;
     351                Tlsq_ptr_t index_store     = _load_queue[index_load]._store_queue_ptr_write;
     352                Tlsq_ptr_t index_store_old = index_store;
     353
    281354                // Init variable
    282355                bool       end_check    = false;
     
    534607                                  // The check is finish if all bit is set
    535608                                  end_check = (_load_queue[index_load]._check_hit_byte == _param->_mask_check_hit_byte);
     609
    536610                                }
    537611                            }
     
    553627                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * next");
    554628                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * new store_queue_ptr_write : %d",index_store);
     629
     630                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * update reg_STORE_QUEUE_NB_CHECK");
     631#ifdef DEBUG
     632                    if (reg_STORE_QUEUE_NB_CHECK [index_store] == 0)
     633                      throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n"));
     634#endif
     635                    reg_STORE_QUEUE_NB_CHECK [index_store] --;
     636
    555637//                  if (_load_queue[index_load]._store_queue_ptr_write == 0)
    556638//                    _load_queue[index_load]._store_queue_ptr_write = _param->_size_store_queue-1;
     
    615697                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * state new : %s",toString(_load_queue[index_load]._state).c_str());
    616698                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * exception : %d",_load_queue[index_load]._exception);
     699
     700                    if (end_check)
     701                      {
     702                        log_printf(TRACE,Load_store_unit,FUNCTION,"                * end check, decrease all nb_check");
     703                       
     704                        uint32_t i=index_store;
     705                        while (i!=reg_STORE_QUEUE_PTR_READ)
     706                          {
     707                            i=((i==0)?_param->_size_store_queue:i)-1;
     708                           
     709#ifdef DEBUG
     710                            if (reg_STORE_QUEUE_NB_CHECK [i] == 0)
     711                              throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n"));
     712#endif
     713                           
     714                            reg_STORE_QUEUE_NB_CHECK [i] --;
     715                            //i=(i+1)%_param->_size_store_queue;
     716                          }
     717                      }
    617718                  }
    618719              }
     
    803904
    804905        //================================================================
    805         // Interface "MEMORY_OUT"
    806         //================================================================
    807 
    808         if ((    internal_MEMORY_OUT_VAL  == 1) and
    809             (PORT_READ(in_MEMORY_OUT_ACK[0]) == 1))
    810           {
    811             log_printf(TRACE,Load_store_unit,FUNCTION,"  * MEMORY_OUT[0] transaction");
    812 
    813             switch (internal_MEMORY_OUT_SELECT_QUEUE)
    814               {
    815               case SELECT_STORE_QUEUE :
    816                 {
    817                   // =======================
    818                   // ===== STORE_QUEUE =====
    819                   // =======================
    820                  
    821                   log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue [%d]",reg_STORE_QUEUE_PTR_READ);
    822            
    823                   // Entry flush and increase the read pointer
    824                   _store_queue [reg_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_EMPTY;
    825                  
    826                   reg_STORE_QUEUE_PTR_READ = (reg_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue;
    827 
    828                   break;
    829                 }
    830               case SELECT_LOAD_QUEUE :
    831                 {
    832                   // ======================
    833                   // ===== LOAD_QUEUE =====
    834                   // ======================
    835                  
    836                   log_printf(TRACE,Load_store_unit,FUNCTION,"    * load_queue  [%d]",internal_MEMORY_OUT_PTR);
    837                  
    838                   // Entry flush and increase the read pointer
    839                  
    840                   _load_queue [internal_MEMORY_OUT_PTR]._state = LOAD_QUEUE_EMPTY;
    841                  
    842                   // reg_LOAD_QUEUE_PTR_READ = (reg_LOAD_QUEUE_PTR_READ+1)%_param->_size_load_queue;
    843 
    844                   break;
    845                 }
    846               case SELECT_LOAD_QUEUE_SPECULATIVE :
    847                 {
    848                   log_printf(TRACE,Load_store_unit,FUNCTION,"    * load_queue  [%d] (speculative)",internal_MEMORY_OUT_PTR);
    849                  
    850                   _load_queue [internal_MEMORY_OUT_PTR]._state    = LOAD_QUEUE_CHECK;
    851                   // NOTE : a speculative load write in the register file.
    852                   // if the speculation is a miss, write_rd is re set at 1.
    853                   _load_queue [internal_MEMORY_OUT_PTR]._write_rd = 0;
    854 
    855 #ifdef STATISTICS
    856                   if (usage_is_set(_usage,USE_STATISTICS))
    857                     (*_stat_nb_inst_load_commit_speculative) ++;
    858 #endif
    859 
    860                   break;
    861                 }
    862 
    863                 break;
    864               }
    865           }
    866 
    867         //================================================================
    868906        // Interface "DCACHE_REQ"
    869907        //================================================================
     
    943981            Tdcache_address_t address_lsb    = (address & _param->_mask_address_lsb);
    944982            Tdcache_address_t check_hit_byte = gen_mask_not<Tdcache_address_t>(address_lsb+(memory_size(operation)>>3)-1,address_lsb) & _param->_mask_check_hit_byte;
     983            Tlsq_ptr_t        store_queue_ptr_write = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_write;
    945984
    946985            log_printf(TRACE,Load_store_unit,FUNCTION,"    * address                 : 0x%.8x", address);
     
    955994            _load_queue [ptr_write]._packet_id             = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._packet_id;
    956995            _load_queue [ptr_write]._operation             = operation;
    957             _load_queue [ptr_write]._store_queue_ptr_write = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_write;
     996            _load_queue [ptr_write]._store_queue_ptr_write = store_queue_ptr_write;
    958997            _load_queue [ptr_write]._address               = address;
    959998            _load_queue [ptr_write]._check_hit_byte        = check_hit_byte;
     
    9641003            // NOTE : if have an exception, must write in register, because a depend instruction wait the load data.
    9651004            _load_queue [ptr_write]._write_rd              = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._write_rd             ;
    966            
    9671005            _load_queue [ptr_write]._num_reg_rd            = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._num_reg_rd           ;
    9681006            _load_queue [ptr_write]._exception             = exception;
     
    9801018              (*_stat_nb_inst_load) ++;
    9811019#endif
     1020
     1021            // Only load need check
     1022            if (is_operation_memory_load(_load_queue [ptr_write]._operation))
     1023              {
     1024                log_printf(TRACE,Load_store_unit,FUNCTION,"    * update nb_check");
     1025                log_printf(TRACE,Load_store_unit,FUNCTION,"      *     store_queue_ptr_write : %d",store_queue_ptr_write);
     1026                log_printf(TRACE,Load_store_unit,FUNCTION,"      * reg_STORE_QUEUE_PTR_READ  : %d",reg_STORE_QUEUE_PTR_READ);
     1027               
     1028                uint32_t i=store_queue_ptr_write;
     1029                while (i!=reg_STORE_QUEUE_PTR_READ)
     1030                  {
     1031                    i=((i==0)?_param->_size_store_queue:i)-1;
     1032                   
     1033                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * i                         : %d",i);
     1034                   
     1035                    reg_STORE_QUEUE_NB_CHECK [i] ++;
     1036                  }
     1037              }
    9821038          }
    9831039
     
    10751131            uint32_t j = (reg_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue;
    10761132
    1077             log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.8x, %.2d, %s",
     1133            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.8x, %.2d, %.2d %s",
    10781134                       j,
    10791135                       _store_queue[j]._context_id          ,
     
    10881144                     //_store_queue[j]._num_reg_rd          ,
    10891145                       _store_queue[j]._exception           ,
     1146                       reg_STORE_QUEUE_NB_CHECK  [j]        ,
    10901147                       toString(_store_queue[j]._state).c_str());
    10911148          }
Note: See TracChangeset for help on using the changeset viewer.