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

Last change on this file since 84 was 84, checked in by rosiere, 16 years ago

Change Address_manager :

  • before : pc_previous, pc_current, pc_next
  • now : pc_current, pc_next, pc_next_next.

pc_next is send at the prediction_unit, it return the instruction_enable and pc_next_next

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.7 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 (std::string    varname,
24                          std::string    expr,
25                          counter_type_t type,
26                          std::string    unit,
27                          std::string    description,
28                          bool           each_cycle)
29  {
30    if (type = TYPE_COUNTER)
31      create_counter (varname,unit,description);
32    else
33      create_variable(varname);
34
35    create_expr(varname, expr, each_cycle);
36  }
37
38
39  void Stat::create_expr_average (std::string varname,
40                                  std::string expr_sum,
41                                  std::string expr_deps,
42                                  std::string unit,
43                                  std::string description)
44  {
45    create_counter(varname,unit,description);
46    create_expr   (varname, "/ "+expr_sum+" "+expr_deps, false);
47  }
48
49  void Stat::create_expr_average_by_cycle (std::string varname,
50                                           std::string expr_sum,
51                                           std::string unit,
52                                           std::string description)
53  {
54    create_expr_average (varname, expr_sum, "cycle", unit, description);
55  }
56
57  void Stat::create_expr_percent (std::string varname,
58                                  std::string expr_sum,
59                                  std::string expr_max,
60                                  std::string description)
61  {
62    create_counter(varname,"%",description);
63    create_expr   (varname, "/ * "+expr_sum+" 100 "+expr_max, false);
64  }
65
66
67};
68};
69#endif
Note: See TracBrowser for help on using the repository browser.