Ignore:
Timestamp:
Jul 30, 2010, 4:47:27 PM (14 years ago)
Author:
rosiere
Message:
  • Add test for all configuration
  • RAT : add rat scheme (depth_save)
Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_test_map.cpp

    r97 r139  
    1414#undef  FUNCTION
    1515#define FUNCTION "Component::test_map"
     16  // bool Component::test_map (bool recursive)
     17  // {
     18  //   log_printf(INFO,Behavioural,FUNCTION, "Test port map and interface.");
     19  //   return test_map (0, recursive);
     20  // }
     21
    1622  bool Component::test_map (bool recursive)
    17   {
    18     log_printf(INFO,Behavioural,FUNCTION, "Test port map and interface.");
    19     return test_map (0, recursive);
    20   }
    21 
    22   bool Component::test_map (uint32_t depth, bool recursive)
    2323  {
    2424    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2525
    26     std::string tab  = morpheo::tab(depth);
     26    // std::string tab  = morpheo::tab(depth);
    2727    std::string name = _entity->get_name();
    2828    bool test_ok = true;
    2929
    3030    bool is_behavioural = _list_component->empty ();
    31     if (is_behavioural)
    32       {
    33         log_printf(INFO,Interface,FUNCTION, "%s* Component \"%s\" is a behavioural description",tab.c_str(),name.c_str());
    34       }
    35     else
    36       {
    37         log_printf(INFO,Interface,FUNCTION, "%s* Component \"%s\" is a structural description",tab.c_str(),name.c_str());
    38       }
     31    // if (is_behavioural)
     32    //   {
     33    //     log_printf(INFO,Interface,FUNCTION, "%s* Component \"%s\" is a behavioural description",tab.c_str(),name.c_str());
     34    //   }
     35    // else
     36    //   {
     37    //     log_printf(INFO,Interface,FUNCTION, "%s* Component \"%s\" is a structural description",tab.c_str(),name.c_str());
     38    //   }
    3939
    4040   
    4141    //  log_printf(INFO,Behavioural,FUNCTION, "%s* Test port I/O",tab.c_str());
    4242   
    43     test_ok &= _entity->test_map(depth+1,true,is_behavioural);
     43    test_ok &= _entity->test_map(true,is_behavioural);
    4444   
    4545    //  log_printf(INFO,Behavioural,FUNCTION, "%s* Test all internal component",tab.c_str());
     
    5050      if (((*i)->_instance & INSTANCE_COMPONENT) != 0)
    5151        {
    52           test_ok &= (*i)->_entity->test_map(depth+1,false,is_behavioural);
     52          test_ok &= (*i)->_entity->test_map(false,is_behavioural);
    5353          if (recursive)
    5454            try
    5555              {
    56                 test_ok &= (*i)->_component->test_map(depth+1,recursive);
     56                test_ok &= (*i)->_component->test_map(recursive);
    5757              }
    5858            catch (morpheo::ErrorMorpheo & error)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_test_map.cpp

    r94 r139  
    1515#undef  FUNCTION
    1616#define FUNCTION "Entity::test_map"
    17   bool Entity::test_map (uint32_t depth, bool top_level, bool is_behavioural)
     17  bool Entity::test_map (bool top_level, bool is_behavioural)
    1818  {
    1919    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2020 
    21     std::string tab=morpheo::tab(depth);
     21    // std::string tab=morpheo::tab(depth);
    2222
    23     log_printf(INFO,Interface,FUNCTION,"%s* Entity \"%s\"",tab.c_str(),_name.c_str());
     23    // log_printf(INFO,Interface,FUNCTION,"%s* Entity \"%s\"",tab.c_str(),_name.c_str());
    2424 
    25     bool _return = _interfaces->test_map(depth+1,top_level, is_behavioural);
    26 
    27 #ifndef DEBUG
    28     if (_return == false)
    29       {
    30         std::cerr << "In entity \"" << _name << "\" (type : \"" << _type << "\"), a lot of port is not connected !" << std::endl;
    31       }
    32 #endif
     25    bool _return = _interfaces->test_map(top_level, is_behavioural);
    3326
    3427    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_test_map.cpp

    r94 r139  
    1414#undef  FUNCTION
    1515#define FUNCTION "Interface::test_map"
    16   bool Interface::test_map (uint32_t depth, bool top_level, bool is_behavioural)
     16  bool Interface::test_map (std::string name_interfaces, bool top_level, bool is_behavioural)
    1717  {
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919
    20     std::string tab  = morpheo::tab(depth);
     20    // std::string tab  = morpheo::tab(depth);
    2121    bool _return = true;
    2222
    23     log_printf(INFO,Interface,FUNCTION, "%s* Interface \"%s\"",tab.c_str(),_name.c_str());
     23    // log_printf(INFO,Interface,FUNCTION, "%s* Interface \"%s\"",tab.c_str(),_name.c_str());
    2424   
    2525    for (std::list<Signal*>::iterator i  = _list_signal->begin();
    2626         i != _list_signal->end();
    2727         ++i)
    28       _return &= (*i)->test_map(depth+1,top_level, is_behavioural);
     28      _return &= (*i)->test_map(name_interfaces+"."+_name,top_level, is_behavioural);
    2929
    3030    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_test_map.cpp

    r94 r139  
    1414#undef  FUNCTION
    1515#define FUNCTION "Interfaces::test_map"
    16   bool Interfaces::test_map (uint32_t depth, bool top_level, bool is_behavioural)
     16  bool Interfaces::test_map (bool top_level, bool is_behavioural)
    1717  {
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919
    20     std::string tab  = morpheo::tab(depth);
     20    // std::string tab  = morpheo::tab(depth);
    2121
    2222    bool _return = true;
    2323
    24     log_printf(INFO,Interface,FUNCTION, "%s* Interfaces \"%s\"",tab.c_str(),_name.c_str());
     24    // log_printf(INFO,Interface,FUNCTION, "%s* Interfaces \"%s\"",tab.c_str(),_name.c_str());
    2525   
    2626    for (std::list<Interface_fifo*>::iterator i  = _list_interface->begin();
    2727         i != _list_interface->end();
    2828         ++i)
    29       _return &= (*i)->test_map(depth+1, top_level, is_behavioural);
     29      _return &= (*i)->test_map(_name, top_level, is_behavioural);
    3030
    3131    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_test_map.cpp

    r94 r139  
    1414#undef  FUNCTION
    1515#define FUNCTION "Signal::test_map"
    16   bool Signal::test_map (uint32_t depth, bool top_level, bool is_behavioural)
     16  bool Signal::test_map (std::string name_interface,bool top_level, bool is_behavioural)
    1717  {
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919
     20    std::string signame = name_interface+"."+_name;
    2021    std::string str     = "";
    21     std::string tab     = morpheo::tab(depth);
     22//  std::string tab     = morpheo::tab(depth);
    2223    bool        _return = true;
    2324
     
    4950                    _return = false;
    5051                   
    51                     str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
     52                    str = "Signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
    5253                  }
    5354                break;
     
    5859                  {
    5960                    _return = false;
    60                     str = "Signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
     61                    str = "Signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
    6162                  }
    6263                break;
     
    6869                    _return = false;
    6970                   
    70                     str = "Internal signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
     71                    str = "Internal signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
    7172                  }
    7273               
     
    7879                    _return = false;
    7980                   
    80                     str += "Internal signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
     81                    str += "Internal signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
    8182                  }
    8283               
     
    101102                    _return = false;
    102103                   
    103                     str = "Signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
     104                    str = "Signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
    104105                  }
    105106                break;
     
    111112                    _return = false;
    112113                   
    113                     str = "Signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
     114                    str = "Signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
    114115                  }
    115116                break;
     
    121122                    _return = false;
    122123                   
    123                     str = "Internal signal \""+_name+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
     124                    str = "Internal signal \""+signame+"\" is not mapped with an outpout port top-level's interface or a input port component's interface.";
    124125                  }
    125126               
     
    131132                    _return = false;
    132133                   
    133                     str += "Internal signal \""+_name+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
     134                    str += "Internal signal \""+signame+"\" is not mapped with an input port top-level's interface or a output port component's interface.";
    134135                  }
    135136               
     
    143144    if (_return == false)
    144145      {
    145 #ifndef DEBUG
    146         std::cerr << str << std::endl;
    147 #else
    148         log_printf(INFO,Interface,FUNCTION, "%s* %s",tab.c_str(),str.c_str());
    149 #endif
     146        msgError("%s\n",str.c_str());
    150147      }
    151148    else
    152149      {
    153 //      log_printf(INFO,Interface,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),_name.c_str());
     150//      log_printf(INFO,Interface,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),signame.c_str());
    154151      }
    155152
     
    181178//     else
    182179//       {
    183 // //   log_printf(INFO,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),_name.c_str());
     180// //   log_printf(INFO,Behavioural,FUNCTION, "%s* Signal \"%s\" is OK.",tab.c_str(),signame.c_str());
    184181//       }
    185182   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp

    r138 r139  
    55namespace behavioural {
    66
    7   Stat::Stat (std::string name_instance,
    8               std::string name_component,
     7  Stat::Stat (std::string             name_instance,
     8              std::string             name_component,
    99              Parameters_Statistics * param):
    1010    _name_instance         (name_instance),
     
    1616    _generate_file = true;
    1717
    18     _list_operand  = new std::map<std::string, var_t>;
    19     _list_expr     = new std::list<expr_t>;
    20     _list_stat     = new std::list<Stat *>;
    21     _list_counters = new std::list<counters_t *>;
     18    _list_operand         = new std::map<std::string, var_t>;
     19    _list_expr_per_cycle  = new std::list<expr_t>;
     20    _list_expr_per_period = new std::list<expr_t>;
     21    _list_stat            = new std::list<Stat *>;
     22    _list_counters        = new std::list<counters_t *>;
    2223
    23     _cycle         = create_variable("cycle");
    24 //  _cycle         = create_counter("cycle","","");
    25     *_cycle        = 0; // for the first period
     24    _cycle                = create_variable("cycle");
     25//  _cycle                = create_counter("cycle","","");
     26    *_cycle               = 0; // for the first period
    2627  }
    2728
    2829  Stat::Stat (std::string name_instance,
    2930              std::string name_component,
    30               cycle_t nb_cycle_before_begin,
    31               cycle_t period):
     31              cycle_t     nb_cycle_before_begin,
     32              cycle_t     period):
    3233    _name_instance         (name_instance),
    3334    _name_component        (name_component),
     
    3839    _generate_file = true;
    3940
    40     _list_operand  = new std::map<std::string, var_t>;
    41     _list_expr     = new std::list<expr_t>;
    42     _list_stat     = new std::list<Stat *>;
    43     _list_counters = new std::list<counters_t *>;
     41    _list_operand         = new std::map<std::string, var_t>;
     42    _list_expr_per_cycle  = new std::list<expr_t>;
     43    _list_expr_per_period = new std::list<expr_t>;
     44    _list_stat            = new std::list<Stat *>;
     45    _list_counters        = new std::list<counters_t *>;
    4446
    45     _cycle         = create_variable("cycle");
    46 //  _cycle         = create_counter("cycle","","");
    47     *_cycle        = 0; // for the first period
     47    _cycle                = create_variable("cycle");
     48//  _cycle                = create_counter("cycle","","");
     49    *_cycle               = 0; // for the first period
    4850  }
    4951
     
    6365
    6466    // parcourir la liste et desallouer les arbres
    65     for (std::list<expr_t>::iterator i=_list_expr->begin();
    66          i!= _list_expr->end();
     67    for (std::list<expr_t>::iterator i=_list_expr_per_cycle->begin();
     68         i!= _list_expr_per_cycle->end();
    6769         ++i)
    6870      {
    6971        delete i->expression;
    7072      }
    71     delete _list_expr;
     73    delete _list_expr_per_cycle;
     74
     75    for (std::list<expr_t>::iterator i=_list_expr_per_period->begin();
     76         i!= _list_expr_per_period->end();
     77         ++i)
     78      {
     79        delete i->expression;
     80      }
     81    delete _list_expr_per_period;
    7282
    7383    // parcourir la liste et desallouer les arbres
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp

    r110 r139  
    1818    expression.variable   = (*_list_operand) [varname].counter;
    1919    expression.expression = string2tree(expr);
    20     expression.each_cycle = each_cycle;
     20//  expression.each_cycle = each_cycle;
    2121
    22     _list_expr->push_back(expression);
     22    if (each_cycle)
     23      _list_expr_per_cycle ->push_back(expression);
     24    else
     25      _list_expr_per_period->push_back(expression);
    2326  }
    2427
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_exprs.cpp

    r81 r139  
    77  {
    88    // parcourir la liste et desallouer les counters
    9     for (std::list<expr_t>::iterator i=_list_expr->begin();
    10          i!= _list_expr->end();
     9    for (std::list<expr_t>::iterator i=_list_expr_per_cycle->begin();
     10         i!= _list_expr_per_cycle->end();
    1111         ++i)
    12       {
    13         if (i->each_cycle == only_each_cycle)
    14           eval_expr (*i);
    15       }
     12      eval_expr (*i);
     13
     14    if (not only_each_cycle)
     15      for (std::list<expr_t>::iterator i=_list_expr_per_period->begin();
     16           i!= _list_expr_per_period->end();
     17           ++i)
     18        eval_expr (*i);
    1619  }
    1720}; 
Note: See TracChangeset for help on using the changeset viewer.