source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp @ 81

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1#ifdef STATISTICS
2#include "Behavioural/include/Stat.h"
3
4namespace morpheo {
5namespace behavioural {
6
7  void Stat::create_expr (std::string varname,
8                          std::string expr,
9                          bool each_cycle)
10  {
11    if (is_valid_var (varname))
12      throw(ERRORMORPHEO("Stat::create_expr",_("Variable is not valid.")));
13   
14    expr_t expression;
15
16    expression.variable   = (*_list_operand) [varname].counter;
17    expression.expression = string2tree(expr);
18    expression.each_cycle = each_cycle;
19
20    _list_expr->push_back(expression);
21  }
22
23  void Stat::create_expr_average (std::string varname,
24                                  std::string expr_sum,
25                                  std::string expr_deps,
26                                  std::string unit,
27                                  std::string description)
28  {
29    create_counter(varname,unit,description);
30    create_expr   (varname, "/ "+expr_sum+" "+expr_deps, false);
31  }
32
33  void Stat::create_expr_average_by_cycle (std::string varname,
34                                           std::string expr_sum,
35                                           std::string unit,
36                                           std::string description)
37  {
38    create_expr_average (varname, expr_sum, "cycle", unit, description);
39  }
40
41  void Stat::create_expr_percent (std::string varname,
42                                  std::string expr_sum,
43                                  std::string expr_max,
44                                  std::string description)
45  {
46    create_counter(varname,"%",description);
47    create_expr   (varname, "/ * "+expr_sum+" 100 "+expr_max, false);
48  }
49
50
51};
52};
53#endif
Note: See TracBrowser for help on using the repository browser.