source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.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: 5.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace stage_1_ifetch {
14namespace predictor {
15namespace meta_predictor {
16namespace meta_predictor_glue {
17
18
19  void Meta_Predictor_Glue::deallocation (void)
20  {
21    log_printf(FUNC,Meta_Predictor_Glue,"deallocation","Begin");
22
23#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
24    delete in_CLOCK;
25#endif
26
27    // Interface Predict
28    for (uint32_t i=0; i<_param._nb_prediction; i++)
29      {
30        if (_param._have_meta_predictor)
31        {
32        delete  in_PREDICT_PREDICTOR_0_ACK                   [i];
33        delete  in_PREDICT_PREDICTOR_1_ACK                   [i];
34        }
35        delete  in_PREDICT_PREDICTOR_2_ACK                   [i];
36        delete out_PREDICT_ACK                               [i];
37        if (_param._have_meta_predictor)
38        {
39        if (_param._predictor_0_have_bht)
40        delete  in_PREDICT_PREDICTOR_0_BHT_HISTORY           [i];
41        if (_param._predictor_0_have_pht)
42        delete  in_PREDICT_PREDICTOR_0_PHT_HISTORY           [i];
43        if (_param._predictor_1_have_bht)
44        delete  in_PREDICT_PREDICTOR_1_BHT_HISTORY           [i];
45        if (_param._predictor_1_have_pht)
46        delete  in_PREDICT_PREDICTOR_1_PHT_HISTORY           [i];
47        }
48        if (_param._predictor_2_have_bht)
49        delete  in_PREDICT_PREDICTOR_2_BHT_HISTORY           [i];
50        if (_param._predictor_2_have_pht)
51        delete  in_PREDICT_PREDICTOR_2_PHT_HISTORY           [i];
52        delete out_PREDICT_HISTORY                           [i];
53        delete out_PREDICT_DIRECTION                         [i];
54      }
55
56    if (_param._have_meta_predictor)
57    {
58    delete  in_PREDICT_PREDICTOR_0_ACK;
59    delete  in_PREDICT_PREDICTOR_1_ACK;
60    }                             
61    delete  in_PREDICT_PREDICTOR_2_ACK;
62    delete out_PREDICT_ACK            ;
63    if (_param._have_meta_predictor)
64    {
65    if (_param._predictor_0_have_bht)
66    delete  in_PREDICT_PREDICTOR_0_BHT_HISTORY;
67    if (_param._predictor_0_have_pht)
68    delete  in_PREDICT_PREDICTOR_0_PHT_HISTORY;
69    if (_param._predictor_1_have_bht)
70    delete  in_PREDICT_PREDICTOR_1_BHT_HISTORY;
71    if (_param._predictor_1_have_pht)
72    delete  in_PREDICT_PREDICTOR_1_PHT_HISTORY ;
73    }
74    if (_param._predictor_2_have_bht)
75    delete  in_PREDICT_PREDICTOR_2_BHT_HISTORY ;
76    if (_param._predictor_2_have_pht)
77    delete  in_PREDICT_PREDICTOR_2_PHT_HISTORY ;
78    delete out_PREDICT_HISTORY                 ;
79    delete out_PREDICT_DIRECTION               ;
80
81    // Interface Branch_complete
82    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
83      {
84        if (_param._have_meta_predictor)
85        {
86        delete  in_BRANCH_COMPLETE_VAL                               [i];
87        delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL                   [i];
88
89        delete  in_BRANCH_COMPLETE_PREDICTOR_0_ACK                   [i];
90        delete  in_BRANCH_COMPLETE_PREDICTOR_1_ACK                   [i];
91        }
92        delete  in_BRANCH_COMPLETE_PREDICTOR_2_ACK                   [i];
93        delete out_BRANCH_COMPLETE_ACK                               [i];
94 
95        if (_param._have_meta_predictor)
96        {
97        if (_param._predictor_0_have_bht)
98        delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY           [i];
99        if (_param._predictor_0_have_pht)
100        delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY           [i];
101        if (_param._predictor_1_have_bht)
102        delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY           [i];
103        if (_param._predictor_1_have_pht)
104        delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY           [i];
105        }
106        if (_param._predictor_2_have_bht)
107        delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY           [i];
108        if (_param._predictor_2_have_pht)
109        delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY           [i];
110        delete  in_BRANCH_COMPLETE_HISTORY                           [i];
111        if (_param._have_meta_predictor)
112          {
113        delete  in_BRANCH_COMPLETE_DIRECTION                         [i];
114        delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION             [i];
115          }
116      }
117
118    if (_param._have_meta_predictor)
119    {
120    delete  in_BRANCH_COMPLETE_VAL                     ;
121    delete out_BRANCH_COMPLETE_PREDICTOR_2_VAL         ;
122
123    delete  in_BRANCH_COMPLETE_PREDICTOR_0_ACK         ;
124    delete  in_BRANCH_COMPLETE_PREDICTOR_1_ACK         ;
125    }                             
126    delete  in_BRANCH_COMPLETE_PREDICTOR_2_ACK         ;
127    delete out_BRANCH_COMPLETE_ACK                     ;
128    if (_param._have_meta_predictor)
129    {
130    if (_param._predictor_0_have_bht)
131    delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY ;
132    if (_param._predictor_0_have_pht)
133    delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY ;
134    if (_param._predictor_1_have_bht)
135    delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY ;
136    if (_param._predictor_1_have_pht)
137    delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY ;
138    }
139    if (_param._predictor_2_have_bht)
140    delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY ;
141    if (_param._predictor_2_have_pht)
142    delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ;
143    delete  in_BRANCH_COMPLETE_HISTORY                 ;
144    if (_param._have_meta_predictor)
145      {
146    delete  in_BRANCH_COMPLETE_DIRECTION               ;
147    delete out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   ;
148      }
149    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
150
151    log_printf(FUNC,Meta_Predictor_Glue,"deallocation","End");
152  };
153
154}; // end namespace meta_predictor_glue
155}; // end namespace meta_predictor
156}; // end namespace predictor
157}; // end namespace stage_1_ifetch
158
159}; // end namespace behavioural
160}; // end namespace morpheo             
161#endif
Note: See TracBrowser for help on using the repository browser.