source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Parameters_print.cpp @ 82

Last change on this file since 82 was 82, checked in by rosiere, 16 years ago
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
  • Property svn:keywords set to Id
File size: 6.4 KB
Line 
1/*
2 * $Id: Parameters_print.cpp 82 2008-05-01 16:48:45Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/include/Parameters.h"
9#include "Behavioural/include/XML.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17
18
19#undef  FUNCTION
20#define FUNCTION "Prediction_unit::print"
21  std::string Parameters::print (uint32_t depth)
22  {
23    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
24
25    XML xml ("prediction_unit");
26
27    xml.balise_open("prediction_unit");
28    xml.singleton_begin("nb_context                            "); xml.attribut("value",toString(_nb_context                            )); xml.singleton_end();
29    xml.singleton_begin("nb_decod_unit                         "); xml.attribut("value",toString(_nb_decod_unit                         )); xml.singleton_end();
30    xml.singleton_begin("size_address                          "); xml.attribut("value",toString(_size_address                          )); xml.singleton_end();
31    xml.singleton_begin("nb_inst_branch_predict                "); xml.attribut("value",toString(_nb_inst_branch_predict                )); xml.singleton_end();
32    xml.singleton_begin("nb_inst_branch_decod                  "); xml.attribut("value",toString(_nb_inst_branch_decod                  )); xml.singleton_end();
33    xml.singleton_begin("nb_inst_branch_update                 "); xml.attribut("value",toString(_nb_inst_branch_update                 )); xml.singleton_end();
34    xml.singleton_begin("nb_inst_branch_complete               "); xml.attribut("value",toString(_nb_inst_branch_complete               )); xml.singleton_end();
35    xml.singleton_begin("btb_size_queue                        "); xml.attribut("value",toString(_btb_size_queue                        )); xml.singleton_end();
36    xml.singleton_begin("btb_associativity                     "); xml.attribut("value",toString(_btb_associativity                     )); xml.singleton_end();
37    xml.singleton_begin("btb_size_counter                      "); xml.attribut("value",toString(_btb_size_counter                      )); xml.singleton_end();
38    xml.singleton_begin("btb_victim_scheme                     "); xml.attribut("value",toString(_btb_victim_scheme                     )); xml.singleton_end();
39    xml.singleton_begin("dir_predictor_scheme                  "); xml.attribut("value",toString(_dir_predictor_scheme                  )); xml.singleton_end();
40    xml.comment("predictor_scheme : ");
41    xml.comment(" * predictor_never_take  : don't use \"predictor_{0,1,2}\" parameters.");
42    xml.comment(" * predictor_always_take : don't use \"predictor_{0,1,2}\" parameters.");
43    xml.comment(" * predictor_static      : don't use \"predictor_{0,1,2}\" parameters.");
44    xml.comment(" * predictor_last_take   : don't use \"predictor_{0,1,2}\" parameters.");
45    xml.comment(" * predictor_counter     :       use \"predictor_0\"       parameters.");
46    xml.comment(" * predictor_local       :       use \"predictor_0\"       parameters.");
47    xml.comment(" * predictor_global      :       use \"predictor_0\"       parameters.");
48    xml.comment(" * predictor_meta        :       use \"predictor_{0,1,2}\" parameters.");
49    xml.comment(" * predictor_custom      :       use \"predictor_{0,1,2}\" parameters.");
50    for (uint32_t i=0; i<3; i++)
51      {
52        xml.singleton_begin("dir_predictor_"+toString(i)+"_have_bht              "); xml.attribut("value",toString(_dir_have_bht               [i])); xml.singleton_end();
53        xml.singleton_begin("dir_predictor_"+toString(i)+"_bht_size_shifter      "); xml.attribut("value",toString(_dir_bht_size_shifter       [i])); xml.singleton_end();
54        xml.singleton_begin("dir_predictor_"+toString(i)+"_bht_nb_shifter        "); xml.attribut("value",toString(_dir_bht_nb_shifter         [i])); xml.singleton_end();
55        xml.singleton_begin("dir_predictor_"+toString(i)+"_have_pht              "); xml.attribut("value",toString(_dir_have_pht               [i])); xml.singleton_end();
56        xml.singleton_begin("dir_predictor_"+toString(i)+"_pht_size_counter      "); xml.attribut("value",toString(_dir_pht_size_counter       [i])); xml.singleton_end();
57        xml.singleton_begin("dir_predictor_"+toString(i)+"_pht_nb_counter        "); xml.attribut("value",toString(_dir_pht_nb_counter         [i])); xml.singleton_end();
58        xml.singleton_begin("dir_predictor_"+toString(i)+"_pht_size_address_share"); xml.attribut("value",toString(_dir_pht_size_address_share [i])); xml.singleton_end();
59      }
60
61    for (uint32_t i=0;i<_nb_context; i++)
62      {
63        xml. balise_open_begin("component");
64        xml.  attribut("type","context");
65        xml.  attribut("id"  ,toString(i));
66        xml. balise_open_end();
67        xml.  singleton_begin("nb_instruction                        "); xml.attribut("value",toString(_nb_instruction                     [i])); xml.singleton_end();
68        xml.  singleton_begin("ras_size_queue                        "); xml.attribut("value",toString(_ras_size_queue                     [i])); xml.singleton_end();
69        xml.  singleton_begin("upt_size_queue                        "); xml.attribut("value",toString(_upt_size_queue                     [i])); xml.singleton_end();
70        xml. balise_close();
71      }
72
73    for (uint32_t i=0;i<_nb_decod_unit; i++)
74      {
75        xml. balise_open_begin("component");
76        xml.  attribut("type","decod_unit");
77        xml.  attribut("id"  ,toString(i));
78        xml. balise_open_end();
79        xml.  singleton_begin("nb_inst_decod                         "); xml.attribut("value",toString(_nb_inst_decod                      [i])); xml.singleton_end();
80        xml. balise_close();
81      }
82
83
84    xml.balise_close();
85
86    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
87   
88    return xml.get_body(depth);
89  };
90
91#undef  FUNCTION
92#define FUNCTION "Prediction_unit::operator<<"
93  std::ostream& operator<< (std::ostream& output_stream ,
94                            morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::Parameters & x)
95  {
96    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
97
98    output_stream << x.print(0);
99   
100    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
101
102    return output_stream;
103  };
104
105}; // end namespace prediction_unit
106}; // end namespace front_end
107}; // end namespace multi_front_end
108}; // end namespace core
109
110}; // end namespace behavioural
111}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.