1 | #ifdef STATISTICS |
---|
2 | /* |
---|
3 | * $Id: Decod_queue_statistics_allocation.cpp 110 2009-02-19 16:31:47Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace decod_unit { |
---|
17 | namespace decod_queue { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Decod_queue::statistics_allocation" |
---|
22 | void Decod_queue::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics) |
---|
23 | { |
---|
24 | log_begin(Decod_queue,FUNCTION); |
---|
25 | |
---|
26 | |
---|
27 | _stat = new Stat (static_cast<std::string>(_name), |
---|
28 | "Decod_queue", |
---|
29 | param_statistics); |
---|
30 | |
---|
31 | _stat_sum_transaction_decod_in = _stat->create_variable("sum_transaction_decod_in"); |
---|
32 | _stat_sum_inst_enable = _stat->create_variable("sum_inst_enable"); |
---|
33 | _stat_average_occupation_bundle= _stat->create_counter ("average_occupation_bundle", "", "Occupation average of instruction's bundle."); |
---|
34 | |
---|
35 | _stat->create_expr ("average_occupation_bundle" ,"/ sum_inst_enable sum_transaction_decod_in"); |
---|
36 | _stat->create_expr_percent ("percent_occupation_bundle" ,"average_occupation_bundle", toString(_param->_nb_inst_decod),"Percent of instruction's bundle occupation."); |
---|
37 | |
---|
38 | _stat_use_queue = _stat->create_variable ("use_queue"); |
---|
39 | _stat_nb_inst = new counter_t * [_param->_nb_context]; |
---|
40 | |
---|
41 | std::string expr_average_inst = ""; |
---|
42 | |
---|
43 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
44 | { |
---|
45 | _stat_nb_inst [i] = _stat->create_variable("nb_inst_"+toString(i)); |
---|
46 | |
---|
47 | _stat->create_expr_average_by_cycle("average_inst_"+toString(i), "nb_inst_"+toString(i), "", toString(_("Average instruction number in decod_queue by cycle (context %d)"),i)); |
---|
48 | _stat->create_expr_percent ("percent_use_inst_"+toString(i) , "average_inst_"+toString(i), toString(_param->_nb_instruction_in_queue), toString(_("Percent decod_queue's occupation (context %d)"),i)); |
---|
49 | |
---|
50 | if (i == 0) |
---|
51 | expr_average_inst = "nb_inst_"+toString(i); |
---|
52 | else |
---|
53 | expr_average_inst = "+ nb_inst_"+toString(i) + " " +expr_average_inst; |
---|
54 | } |
---|
55 | |
---|
56 | _stat->create_expr_average_by_cycle("average_inst", expr_average_inst, "", _("Average instruction number in decod_queue by cycle (all context)")); |
---|
57 | _stat->create_expr_percent ("percent_use_inst" , "average_inst", toString(_param->_nb_instruction_in_queue), _("Percent decod_queue's occupation (all context)")); |
---|
58 | |
---|
59 | _stat->create_expr_average_by_cycle("average_use_queue", "use_queue", "", _("Average slot decod_queue occupation by cycle.")); |
---|
60 | _stat->create_expr_percent ("percent_use_queue", "average_use_queue", toString(_param->_nb_instruction_in_queue), _("Percent slot decod_queue occupation.")); |
---|
61 | |
---|
62 | log_end(Decod_queue,FUNCTION); |
---|
63 | }; |
---|
64 | |
---|
65 | }; // end namespace decod_queue |
---|
66 | }; // end namespace decod_unit |
---|
67 | }; // end namespace front_end |
---|
68 | }; // end namespace multi_front_end |
---|
69 | }; // end namespace core |
---|
70 | |
---|
71 | }; // end namespace behavioural |
---|
72 | }; // end namespace morpheo |
---|
73 | #endif |
---|