1 | #ifdef STATISTICS |
---|
2 | /* |
---|
3 | * $Id: Decod_queue_statistics_allocation.cpp 136 2009-10-20 18:52:15Z 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 | #undef FUNCTION |
---|
20 | #define FUNCTION "Decod_queue::statistics_allocation" |
---|
21 | void Decod_queue::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics) |
---|
22 | { |
---|
23 | log_begin(Decod_queue,FUNCTION); |
---|
24 | |
---|
25 | |
---|
26 | _stat = new Stat (static_cast<std::string>(_name), |
---|
27 | "Decod_queue", |
---|
28 | param_statistics); |
---|
29 | |
---|
30 | _stat_decode_in_empty = _stat->create_counter ("decode_in_empty" , "", "Number cycle with no input instruction."); |
---|
31 | _stat_decode_in_full = _stat->create_counter ("decode_in_full" , "", toString("Number cycle with full input instruction (%d).",_param->_nb_inst_decod)); |
---|
32 | _stat_decode_in_average = _stat->create_counter ("decode_in_average", "", "Average decod instruction."); |
---|
33 | |
---|
34 | _stat->create_expr_average_by_cycle("average_decod_in", toString("+ * decode_in_full %d decode_in_average",_param->_nb_inst_decod), "", "Average instruction from decode unit"); |
---|
35 | _stat->create_expr_percent ("percent_decod_in" ,"average_decod_in", toString(_param->_nb_inst_decod),"Percent of instruction's bundle occupation."); |
---|
36 | |
---|
37 | _stat_use_queue = _stat->create_variable ("use_queue"); |
---|
38 | _stat_nb_inst = new counter_t * [_param->_nb_context]; |
---|
39 | |
---|
40 | std::string expr_average_inst = ""; |
---|
41 | |
---|
42 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
43 | { |
---|
44 | _stat_nb_inst [i] = _stat->create_variable("nb_inst_"+toString(i)); |
---|
45 | |
---|
46 | _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)); |
---|
47 | _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)); |
---|
48 | |
---|
49 | if (i == 0) |
---|
50 | expr_average_inst = "nb_inst_"+toString(i); |
---|
51 | else |
---|
52 | expr_average_inst = "+ nb_inst_"+toString(i) + " " +expr_average_inst; |
---|
53 | } |
---|
54 | |
---|
55 | _stat->create_expr_average_by_cycle("average_inst", expr_average_inst, "", _("Average instruction number in decod_queue by cycle (all context)")); |
---|
56 | _stat->create_expr_percent ("percent_use_inst" , "average_inst", toString(_param->_nb_instruction_in_queue), _("Percent decod_queue's occupation (all context)")); |
---|
57 | |
---|
58 | _stat->create_expr_average_by_cycle("average_use_queue", "use_queue", "", _("Average slot decod_queue occupation by cycle.")); |
---|
59 | _stat->create_expr_percent ("percent_use_queue", "average_use_queue", toString(_param->_nb_instruction_in_queue), _("Percent slot decod_queue occupation.")); |
---|
60 | |
---|
61 | log_end(Decod_queue,FUNCTION); |
---|
62 | }; |
---|
63 | |
---|
64 | }; // end namespace decod_queue |
---|
65 | }; // end namespace decod_unit |
---|
66 | }; // end namespace front_end |
---|
67 | }; // end namespace multi_front_end |
---|
68 | }; // end namespace core |
---|
69 | |
---|
70 | }; // end namespace behavioural |
---|
71 | }; // end namespace morpheo |
---|
72 | #endif |
---|