Last change
on this file since 138 was
138,
checked in by rosiere, 14 years ago
|
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) ...
|
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Rev | Line | |
---|
[138] | 1 | #ifdef STATISTICS |
---|
| 2 | #include "Behavioural/include/Stat.h" |
---|
| 3 | |
---|
| 4 | namespace morpheo { |
---|
| 5 | namespace behavioural { |
---|
| 6 | counters_t * Stat::create_counters (std::string varname, |
---|
| 7 | uint32_t nb_counter, |
---|
| 8 | std::string unit, |
---|
| 9 | std::string description_counter, |
---|
| 10 | std::string description_percent, |
---|
| 11 | std::string description_average) |
---|
| 12 | { |
---|
| 13 | counters_t * counters = new counters_t (nb_counter); |
---|
| 14 | |
---|
| 15 | _list_counters->push_back(counters); |
---|
| 16 | |
---|
| 17 | std::string sum = "0"; |
---|
| 18 | |
---|
| 19 | for (uint32_t i=0; i<=nb_counter; ++i) // 0 and _nb_counter |
---|
| 20 | { |
---|
| 21 | std::string name=varname+"_"+toString(i); |
---|
| 22 | |
---|
| 23 | counters->set_counter(alloc_operand (TYPE_COUNTER, name, unit, toString(description_counter.c_str(),i)), i); |
---|
| 24 | |
---|
| 25 | create_expr_percent("percent_"+name,name,"cycle",toString(description_percent.c_str(),i)); |
---|
| 26 | |
---|
| 27 | if (i!=0) |
---|
| 28 | sum = "+ "+sum+" * "+toString(i)+" "+name; // "cycle" |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | create_expr_average_by_cycle("average_"+varname,sum,unit+" / cycle",description_average); |
---|
| 32 | |
---|
| 33 | return counters; |
---|
| 34 | } |
---|
| 35 | }; |
---|
| 36 | }; |
---|
| 37 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.