source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Parameters_print.cpp @ 5

Last change on this file since 5 was 5, checked in by rosiere, 17 years ago

Ajout du composant Meta_Predictor

File size: 6.5 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Parameters.h"
9#include "Behavioural/include/XML.h"
10using namespace std;
11
12namespace morpheo                    {
13namespace behavioural {
14namespace stage_1_ifetch {
15namespace predictor {
16namespace meta_predictor {
17
18
19  string Parameters::print (uint32_t depth)
20  {
21    log_printf(FUNC,Meta_Predictor,"print","Begin");
22
23    uint32_t size_predictor_0 = _predictor_0_bht_size_shifter*_predictor_0_bht_nb_shifter+_predictor_0_pht_size_counter*_predictor_0_pht_nb_counter;
24    uint32_t size_predictor_1 = _predictor_1_bht_size_shifter*_predictor_1_bht_nb_shifter+_predictor_1_pht_size_counter*_predictor_1_pht_nb_counter;
25    uint32_t size_predictor_2 = _predictor_2_bht_size_shifter*_predictor_2_bht_nb_shifter+_predictor_2_pht_size_counter*_predictor_2_pht_nb_counter;
26    uint32_t size_predictor   = size_predictor_0+size_predictor_1+size_predictor_2;
27
28    XML xml ("meta_predictor");
29    xml.balise_open("meta_predictor");
30
31    xml.  text("");
32    xml.  comment("size predictor   : "+toString(size_predictor  )+" bits");
33    xml.  comment("size predictor_0 : "+toString(size_predictor_0)+" bits");
34    xml.  comment("size predictor_1 : "+toString(size_predictor_1)+" bits");
35    xml.  comment("size predictor_2 : "+toString(size_predictor_2)+" bits");
36    xml.  text("");
37
38    xml.  singleton_begin("have_meta_predictor               ");               
39    xml.    attribut("value",toString(_have_meta_predictor               ));
40    xml.  singleton_end();
41
42    xml.  singleton_begin("predictor_0_have_bht              ");               
43    xml.    attribut("value",toString(_predictor_0_have_bht              ));
44    xml.  singleton_end();
45    xml.  singleton_begin("predictor_0_bht_size_shifter      ");       
46    xml.    attribut("value",toString(_predictor_0_bht_size_shifter      ));
47    xml.  singleton_end();
48    xml.  singleton_begin("predictor_0_bht_nb_shifter        ");       
49    xml.    attribut("value",toString(_predictor_0_bht_nb_shifter        ));
50    xml.  singleton_end();
51    xml.  singleton_begin("predictor_0_have_pht              ");             
52    xml.    attribut("value",toString(_predictor_0_have_pht              ));
53    xml.  singleton_end();
54    xml.  singleton_begin("predictor_0_pht_size_counter      ");     
55    xml.    attribut("value",toString(_predictor_0_pht_size_counter      ));
56    xml.  singleton_end();
57    xml.  singleton_begin("predictor_0_pht_nb_counter        ");       
58    xml.    attribut("value",toString(_predictor_0_pht_nb_counter        ));
59    xml.  singleton_end();
60    xml.  singleton_begin("predictor_0_pht_size_address_share");
61    xml.    attribut("value",toString(_predictor_0_pht_size_address_share));
62    xml.  singleton_end();
63
64    xml.  singleton_begin("predictor_1_have_bht              ");               
65    xml.    attribut("value",toString(_predictor_1_have_bht              ));
66    xml.  singleton_end();
67    xml.  singleton_begin("predictor_1_bht_size_shifter      ");       
68    xml.    attribut("value",toString(_predictor_1_bht_size_shifter      ));
69    xml.  singleton_end();
70    xml.  singleton_begin("predictor_1_bht_nb_shifter        ");       
71    xml.    attribut("value",toString(_predictor_1_bht_nb_shifter        ));
72    xml.  singleton_end();
73    xml.  singleton_begin("predictor_1_have_pht              ");             
74    xml.    attribut("value",toString(_predictor_1_have_pht              ));
75    xml.  singleton_end();
76    xml.  singleton_begin("predictor_1_pht_size_counter      ");     
77    xml.    attribut("value",toString(_predictor_1_pht_size_counter      ));
78    xml.  singleton_end();
79    xml.  singleton_begin("predictor_1_pht_nb_counter        ");       
80    xml.    attribut("value",toString(_predictor_1_pht_nb_counter        ));
81    xml.  singleton_end();
82    xml.  singleton_begin("predictor_1_pht_size_address_share");
83    xml.    attribut("value",toString(_predictor_1_pht_size_address_share));
84    xml.  singleton_end();
85   
86    xml.  singleton_begin("predictor_2_have_bht              ");               
87    xml.    attribut("value",toString(_predictor_2_have_bht              ));
88    xml.  singleton_end();
89    xml.  singleton_begin("predictor_2_bht_size_shifter      ");       
90    xml.    attribut("value",toString(_predictor_2_bht_size_shifter      ));
91    xml.  singleton_end();
92    xml.  singleton_begin("predictor_2_bht_nb_shifter        ");       
93    xml.    attribut("value",toString(_predictor_2_bht_nb_shifter        ));
94    xml.  singleton_end();
95    xml.  singleton_begin("predictor_2_have_pht              ");             
96    xml.    attribut("value",toString(_predictor_2_have_pht              ));
97    xml.  singleton_end();
98    xml.  singleton_begin("predictor_2_pht_size_counter      ");     
99    xml.    attribut("value",toString(_predictor_2_pht_size_counter      ));
100    xml.  singleton_end();
101    xml.  singleton_begin("predictor_2_pht_nb_counter        ");       
102    xml.    attribut("value",toString(_predictor_2_pht_nb_counter        ));
103    xml.  singleton_end();
104    xml.  singleton_begin("predictor_2_pht_size_address_share");
105    xml.    attribut("value",toString(_predictor_2_pht_size_address_share));
106    xml.  singleton_end();
107       
108    xml.  singleton_begin("size_address                      ");                     
109    xml.    attribut("value",toString(_size_address          ));
110    xml.  singleton_end();
111    xml.  singleton_begin("nb_prediction                     ");                     
112    xml.    attribut("value",toString(_nb_prediction         ));
113    xml.  singleton_end();
114    xml.  singleton_begin("nb_branch_complete                ");               
115    xml.    attribut("value",toString(_nb_branch_complete    ));
116    xml.  singleton_end();
117   
118    if (_have_meta_predictor)
119      {
120    xml.  text(_param_two_level_branch_predictor_0->print(depth+1));
121    xml.  text(_param_two_level_branch_predictor_1->print(depth+1));
122      }
123    xml.  text(_param_two_level_branch_predictor_2->print(depth+1));
124    xml.  text(_param_meta_predictor_glue         ->print(depth+1));
125
126    xml.balise_close();
127
128    log_printf(FUNC,Meta_Predictor,"print","End");
129   
130    return xml.get_body(depth);
131  };
132
133  ostream& operator<< (ostream& output_stream ,
134                       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Parameters & x)
135  {
136    output_stream << x.print(0);
137   
138    return output_stream;
139  };
140
141}; // end namespace meta_predictor
142}; // end namespace predictor
143}; // end namespace stage_1_ifetch
144}; // end namespace behavioural
145}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.