Ignore:
Timestamp:
Jan 31, 2008, 6:46:41 PM (16 years ago)
Author:
rosiere
Message:

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File:
1 edited

Legend:

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

    r74 r75  
    2121         stat != _list_stat->end();
    2222         stat ++)
    23       xml.text((*stat)->print(depth+1));
     23      xml.text((*stat)->print(1));
    2424   
    2525
    2626    // Test special case
    27     if (_cycle_sum < _nb_cycle_before_begin)
     27
     28    if (have_counter())
    2829      {
    29         xml.comment(_("Number of cycle is less than the number minimal"));
    30       }
    31     else
    32       {
    33         bool stop = false;
    34         cycle_t nb_cycle_min;
    35         cycle_t nb_cycle_max = _nb_cycle_before_begin-1;
    36         for (cycle_t period=0; stop==false; period++)
     30        if (_cycle_sum < _nb_cycle_before_begin)
    3731          {
    38             std::map<std::string, var_t>::iterator operand=_list_operand->begin();
     32            xml.comment(_("Number of cycle is less than the number minimal"));
     33          }
     34        else
     35          {
     36            bool stop = false;
     37            cycle_t nb_cycle_min;
     38            cycle_t nb_cycle_max = _nb_cycle_before_begin-1;
     39            for (cycle_t period=0; stop==false; period++)
     40              {
     41                std::map<std::string, var_t>::iterator operand=_list_operand->begin();
     42               
     43                if (operand->second.save_counter.size()==0)
     44                  throw(ERRORMORPHEO("Stat::generate_file",_("Queue 'save_counter' is empty.")));
     45               
     46                bool last = operand->second.save_counter.size()==1;
     47               
     48                nb_cycle_min  = nb_cycle_max+1;
     49               
     50                if (last)
     51                  nb_cycle_max = static_cast<cycle_t>(_cycle_sum);
     52                else
     53                  nb_cycle_max += _period;
    3954
    40             if (operand->second.save_counter.size()==0)
    41               throw(ERRORMORPHEO("Stat::generate_file",_("Queue 'save_counter' is empty.")));
    42 
    43             bool last = operand->second.save_counter.size()==1;
    44 
    45             nb_cycle_min  = nb_cycle_max+1;
    46 
    47             if (last)
    48               nb_cycle_max = static_cast<cycle_t>(_cycle_sum);
    49             else
    50               nb_cycle_max += _period;
    51 
    52             xml.balise_open_begin("period");
    53             xml.attribut("number",toString(period));
    54             xml.attribut("nb_cycle_min",toString(nb_cycle_min));
    55             xml.attribut("nb_cycle_max",toString(nb_cycle_max));
    56             xml.balise_open_end();
    57            
    58             for (;
    59                  operand!= _list_operand->end();
    60                  ++operand)
    61               {
    62                 if (operand->second.type == TYPE_COUNTER)
     55                xml.balise_open_begin("period");
     56                xml.attribut("number",toString(period));
     57                xml.attribut("nb_cycle_min",toString(nb_cycle_min));
     58                xml.attribut("nb_cycle_max",toString(nb_cycle_max));
     59                xml.balise_open_end();
     60               
     61                for (;
     62                     operand!= _list_operand->end();
     63                     ++operand)
    6364                  {
    64                     xml.singleton_begin(operand->second.name);
    65                     xml.attribut("value",toString(operand->second.save_counter.front()));
    66                     xml.attribut("unit",operand->second.unit);
    67                     xml.attribut("description",operand->second.description);
    68                     xml.singleton_end();
     65                    if (operand->second.type == TYPE_COUNTER)
     66                      {
     67                        xml.singleton_begin(operand->second.name);
     68                        xml.attribut("value",toString(operand->second.save_counter.front()));
     69                        xml.attribut("unit",operand->second.unit);
     70                        xml.attribut("description",operand->second.description);
     71                        xml.singleton_end();
     72                      }
     73                    operand->second.save_counter.pop_front();
    6974                  }
    70                 operand->second.save_counter.pop_front();
     75               
     76                xml.balise_close();
     77               
     78                stop = last;
    7179              }
    72 
    73             xml.balise_close();
    74            
    75             stop = last;
    7680          }
    7781      }
Note: See TracChangeset for help on using the changeset viewer.