Ignore:
Timestamp:
May 12, 2010, 7:34:01 PM (14 years ago)
Author:
rosiere
Message:

1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/include
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h

    r137 r138  
    143143        }
    144144    }
     145#endif
    145146
    146147#undef  FUNCTION
     
    184185      log_printf(FUNC,Behavioural,FUNCTION,"End");
    185186    }
    186 #endif
     187
     188
     189#undef  FUNCTION
     190#define FUNCTION "Signal::alloc"
     191  void              dealloc         (void)
     192    {
     193      log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     194
     195      switch (_direction)
     196        {
     197        case INTERNAL :
     198          switch (_type_info)
     199            {
     200            case BOOL     : delete (static_cast<sc_signal <bool    > *>(_sc_signal_map)); break;
     201            case UINT8_T  : delete (static_cast<sc_signal <uint8_t > *>(_sc_signal_map)); break;
     202            case UINT16_T : delete (static_cast<sc_signal <uint16_t> *>(_sc_signal_map)); break;
     203            case UINT32_T : delete (static_cast<sc_signal <uint32_t> *>(_sc_signal_map)); break;
     204            case UINT64_T : delete (static_cast<sc_signal <uint64_t> *>(_sc_signal_map)); break;
     205            default       : throw (ErrorMorpheo ("Signal \""+_name+"\" : type unknow.\n"));
     206            }
     207        default : throw (ErrorMorpheo ("Signal \""+_name+"\" : invalid direction.\n"));
     208
     209
     210        }
     211
     212      log_printf(FUNC,Behavioural,FUNCTION,"End");
     213    }
    187214
    188215#ifdef VHDL
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Simulation.h

    r124 r138  
    1919namespace behavioural          {
    2020
     21  typedef enum
     22    {
     23      ALL_THREAD,
     24      EACH_THREAD_AND_CONTINUE,
     25      EACH_THREAD_AND_STOP
     26    } stop_type_t;
     27
    2128  extern bool                _simulation_stop_exception;
    2229  extern double              _simulation_nb_cycle;
    2330  extern double              _simulation_nb_instruction;
    2431  extern std::vector<double> _simulation_nb_instruction_commited;
     32  extern stop_type_t         _simulation_stop_type;
    2533  extern bool                _simulation_file_with_date;
    2634  extern bool                _simulation_file_with_pid ;
     
    2937
    3038  bool simulation_test_end (void);
    31   void simulation_init     (double nb_cycle,
    32                             double denug_nb_cycle,
    33                             double nb_instruction,
    34                             bool   file_with_date,
    35                             bool   file_with_pid);
     39  void simulation_init     (double      nb_cycle,
     40                            double      denug_nb_cycle,
     41                            double      nb_instruction,
     42                            stop_type_t stop_type,
     43                            bool        file_with_date,
     44                            bool        file_with_pid);
    3645}; // end namespace behavioural         
     46
     47  template<> inline std::string toString<morpheo::behavioural::stop_type_t>(const morpheo::behavioural::stop_type_t& x)
     48  {
     49    switch (x)
     50      {
     51      case morpheo::behavioural::ALL_THREAD               : return "all_thread"; break;
     52      case morpheo::behavioural::EACH_THREAD_AND_CONTINUE : return "each_thread_and_continue"; break;
     53      case morpheo::behavioural::EACH_THREAD_AND_STOP     : return "each_thread_and_stop"; break;
     54      default : return ""; break;
     55      }
     56  };
     57
     58  template<> inline morpheo::behavioural::stop_type_t fromString<morpheo::behavioural::stop_type_t>(const std::string& x)
     59  {
     60    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::ALL_THREAD))) == 0) or
     61        (x.compare(toString(                      morpheo::behavioural::ALL_THREAD )) == 0))
     62      return morpheo::behavioural::ALL_THREAD;
     63
     64    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::EACH_THREAD_AND_CONTINUE))) == 0) or
     65        (x.compare(toString(                      morpheo::behavioural::EACH_THREAD_AND_CONTINUE )) == 0))
     66      return morpheo::behavioural::EACH_THREAD_AND_CONTINUE;
     67
     68    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::EACH_THREAD_AND_STOP))) == 0) or
     69        (x.compare(toString(                      morpheo::behavioural::EACH_THREAD_AND_STOP )) == 0))
     70      return morpheo::behavioural::EACH_THREAD_AND_STOP;
     71
     72    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
     73  };
     74
    3775}; // end namespace morpheo             
    3876
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h

    r124 r138  
    4949    private: const cycle_t                  _period;
    5050    private: const bool                     _save_periodic;
     51    private: bool                           _generate_file;
     52
    5153      // Tableau des variables
    5254    private: std::map<std::string, var_t> * _list_operand;
    5355      // Liste chaîné des expressions
    5456    private: std::list<expr_t>            * _list_expr;
     57      // List chaîné des "counters" (seulement pour la désallocation)
     58    private: std::list<counters_t*>       * _list_counters;
    5559
    5660    private: counter_t                    * _cycle;
    5761
    5862    private: std::list<Stat *>            * _list_stat;
    59 
    60     private: bool                           _generate_file;
    6163
    6264    public :                     Stat                         (std::string name_instance,
     
    7375                                                               std::string unit,
    7476                                                               std::string description);
     77    public  : counters_t *       create_counters              (std::string varname,
     78                                                               uint32_t    nb_counter,
     79                                                               std::string unit,
     80                                                               std::string description_counter, // need one %d
     81                                                               std::string description_percent, // need one %d
     82                                                               std::string description_average);
    7583    private : counter_t *        alloc_operand                (counter_type_t type,
    7684                                                               std::string varname,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h

    r81 r138  
    66#include <map>
    77#include <utility>
     8#include <cassert>
    89
    910namespace morpheo {
     
    1920//typedef std::pair<std::string, operator_t> pair_string_operator_t;
    2021
     22  class counters_t
     23  {
     24  private : const uint32_t     _nb_counter;
     25  private :       counter_t ** _counter;
     26
     27  public  : counters_t (uint32_t nb_counter):
     28    _nb_counter (nb_counter+1)
     29    {
     30      assert(nb_counter>0);
     31
     32      _counter = new counter_t * [_nb_counter];
     33    }
     34
     35  // public : counters_t (const counters_t & x):
     36  //   _nb_counter (x._nb_counter)
     37  //   {
     38  //     _counter = new counter_t [_nb_counter];
     39     
     40  //     for (uint32_t i=0; i<_nb_counter; ++i)
     41  //       _counter[i] = x._counter[i];
     42  //   }
     43   
     44  public  : ~counters_t (void)
     45    {
     46      delete [] _counter;
     47    }
     48
     49  public  : void set_counter (counter_t * counter,
     50                              uint32_t    index)
     51    {
     52      assert((index >= 0) and (index < _nb_counter));
     53
     54      _counter [index] = counter;
     55    }
     56
     57  // public : friend const counters_t  operator+ (const counters_t & left,
     58  //                                              const uint32_t     right)
     59  //   {
     60  //     assert((right >= 0) and (right <= left._nb_counter));
     61     
     62  //     counters_t tmp=left;
     63     
     64  //     tmp._counter[right] ++;
     65   
     66  //     return tmp;
     67  //   }
     68
     69  public : const counters_t & operator+= (const uint32_t value)
     70    {
     71      assert((value >= 0) and (value <= _nb_counter));
     72     
     73      (*_counter[value]) ++;
     74     
     75      return *this;
     76    }
     77
     78  };
     79
    2180};
    2281};
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h

    r128 r138  
    172172  template<> inline morpheo::behavioural::Tpriority_t fromString<morpheo::behavioural::Tpriority_t>(const std::string& x)
    173173  {
    174     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_STATIC))) == 0) or
    175          (x.compare("priority_static")      == 0))
     174    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_STATIC))) == 0) or
     175        (x.compare(toString(                      morpheo::behavioural::PRIORITY_STATIC )) == 0))
    176176      return morpheo::behavioural::PRIORITY_STATIC;
    177     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_ROUND_ROBIN))) == 0) or
    178          (x.compare("priority_round_robin") == 0))
     177
     178    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PRIORITY_ROUND_ROBIN))) == 0) or
     179        (x.compare(toString(                      morpheo::behavioural::PRIORITY_ROUND_ROBIN )) == 0))
    179180      return morpheo::behavioural::PRIORITY_ROUND_ROBIN;
     181
    180182    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
    181183  };
     
    193195  template<> inline morpheo::behavioural::Tload_balancing_t fromString<morpheo::behavioural::Tload_balancing_t>(const std::string& x)
    194196  {
    195     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_BALANCE))) == 0) or
    196          (x.compare("load_balancing_balance") == 0))
     197    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_BALANCE))) == 0) or
     198        (x.compare(toString(                      morpheo::behavioural::LOAD_BALANCING_BALANCE )) == 0))
    197199      return morpheo::behavioural::LOAD_BALANCING_BALANCE;
    198     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY))) == 0) or
    199          (x.compare("load_balancing_maximum_for_priority") == 0))
     200
     201    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY))) == 0) or
     202        (x.compare(toString(                      morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY )) == 0))
    200203      return morpheo::behavioural::LOAD_BALANCING_MAXIMUM_FOR_PRIORITY;
     204
    201205    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
    202206  };
     
    218222  template<> inline morpheo::behavioural::Tvictim_t fromString<morpheo::behavioural::Tvictim_t>(const std::string& x)
    219223  {
    220     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_RANDOM     ))) == 0) or
    221          (x.compare("victim_random")      == 0))
     224    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_RANDOM     ))) == 0) or
     225        (x.compare(toString(                      morpheo::behavioural::VICTIM_RANDOM      )) == 0))
    222226      return morpheo::behavioural::VICTIM_RANDOM;
    223     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_ROUND_ROBIN))) == 0) or
    224          (x.compare("victim_round_robin") == 0))
     227
     228    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_ROUND_ROBIN))) == 0) or
     229        (x.compare(toString(                      morpheo::behavioural::VICTIM_ROUND_ROBIN )) == 0))
    225230      return morpheo::behavioural::VICTIM_ROUND_ROBIN;
    226     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_NLU        ))) == 0) or
    227          (x.compare("victim_nlu")         == 0))
     231
     232    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_NLU        ))) == 0) or
     233        (x.compare(toString(                      morpheo::behavioural::VICTIM_NLU         )) == 0))
    228234      return morpheo::behavioural::VICTIM_NLU;
    229     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_PSEUDO_LRU ))) == 0) or
    230          (x.compare("victim_pseudo_lru")  == 0))
     235
     236    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_PSEUDO_LRU ))) == 0) or
     237        (x.compare(toString(                      morpheo::behavioural::VICTIM_PSEUDO_LRU  )) == 0))
    231238      return morpheo::behavioural::VICTIM_PSEUDO_LRU;
    232     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_LRU        ))) == 0) or
    233          (x.compare("victim_lru")         == 0))
     239
     240    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_LRU        ))) == 0) or
     241        (x.compare(toString(                      morpheo::behavioural::VICTIM_LRU         )) == 0))
    234242      return morpheo::behavioural::VICTIM_LRU;
    235     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_FIFO       ))) == 0) or
    236          (x.compare("victim_fifo")        == 0))
     243
     244    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::VICTIM_FIFO       ))) == 0) or
     245        (x.compare(toString(                      morpheo::behavioural::VICTIM_FIFO        )) == 0))
    237246      return morpheo::behavioural::VICTIM_FIFO;
     247
    238248    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
    239249  };
     
    258268  template<> inline morpheo::behavioural::Tpredictor_t fromString<morpheo::behavioural::Tpredictor_t>(const std::string& x)
    259269  {
    260     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_NEVER_TAKE ))) == 0) or
    261          (x.compare("predictor_never_take") == 0))
     270    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_NEVER_TAKE ))) == 0) or
     271        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_NEVER_TAKE  )) == 0))
    262272      return morpheo::behavioural::PREDICTOR_NEVER_TAKE;
    263     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_ALWAYS_TAKE))) == 0) or
    264          (x.compare("predictor_always_take") == 0))
     273
     274    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_ALWAYS_TAKE))) == 0) or
     275        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_ALWAYS_TAKE )) == 0))
    265276      return morpheo::behavioural::PREDICTOR_ALWAYS_TAKE;
    266     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_STATIC     ))) == 0) or
    267          (x.compare("predictor_static")      == 0))
     277
     278    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_STATIC     ))) == 0) or
     279        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_STATIC      )) == 0))
    268280      return morpheo::behavioural::PREDICTOR_STATIC;
    269     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LAST_TAKE  ))) == 0) or
    270          (x.compare("predictor_last_take")   == 0))
     281
     282    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LAST_TAKE  ))) == 0) or
     283        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_LAST_TAKE   )) == 0))
    271284      return morpheo::behavioural::PREDICTOR_LAST_TAKE;
    272     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_COUNTER    ))) == 0) or
    273          (x.compare("predictor_counter")     == 0))
     285
     286    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_COUNTER    ))) == 0) or
     287        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_COUNTER     )) == 0))
    274288      return morpheo::behavioural::PREDICTOR_COUNTER;
    275     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LOCAL      ))) == 0) or
    276          (x.compare("predictor_local")       == 0))
     289
     290    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_LOCAL      ))) == 0) or
     291        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_LOCAL       )) == 0))
    277292      return morpheo::behavioural::PREDICTOR_LOCAL;
    278     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_GLOBAL     ))) == 0) or
    279          (x.compare("predictor_global")      == 0))
     293
     294    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_GLOBAL     ))) == 0) or
     295        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_GLOBAL      )) == 0))
    280296      return morpheo::behavioural::PREDICTOR_GLOBAL;
    281     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_META       ))) == 0) or
    282          (x.compare("predictor_meta")        == 0))
     297
     298    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_META       ))) == 0) or
     299        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_META        )) == 0))
    283300      return morpheo::behavioural::PREDICTOR_META;
    284     if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_CUSTOM     ))) == 0) or
    285          (x.compare("predictor_custom")      == 0))
     301
     302    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::PREDICTOR_CUSTOM     ))) == 0) or
     303        (x.compare(toString(                      morpheo::behavioural::PREDICTOR_CUSTOM      )) == 0))
    286304      return morpheo::behavioural::PREDICTOR_CUSTOM;
     305
    287306    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
    288307  };
Note: See TracChangeset for help on using the changeset viewer.