source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp @ 4

Last change on this file since 4 was 4, checked in by rosiere, 17 years ago
File size: 4.9 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_PREDICTOR_0_ACK                   [i];
87        delete  in_BRANCH_COMPLETE_PREDICTOR_1_ACK                   [i];
88        }
89        delete  in_BRANCH_COMPLETE_PREDICTOR_2_ACK                   [i];
90        delete out_BRANCH_COMPLETE_ACK                               [i];
91 
92        if (_param._have_meta_predictor)
93        {
94        if (_param._predictor_0_have_bht)
95        delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY           [i];
96        if (_param._predictor_0_have_pht)
97        delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY           [i];
98        if (_param._predictor_1_have_bht)
99        delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY           [i];
100        if (_param._predictor_1_have_pht)
101        delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY           [i];
102        }
103        if (_param._predictor_2_have_bht)
104        delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY           [i];
105        if (_param._predictor_2_have_pht)
106        delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY           [i];
107        delete  in_BRANCH_COMPLETE_HISTORY                           [i];
108      }
109
110    if (_param._have_meta_predictor)
111    {
112    delete  in_BRANCH_COMPLETE_PREDICTOR_0_ACK         ;
113    delete  in_BRANCH_COMPLETE_PREDICTOR_1_ACK         ;
114    }                             
115    delete  in_BRANCH_COMPLETE_PREDICTOR_2_ACK         ;
116    delete out_BRANCH_COMPLETE_ACK                     ;
117    if (_param._have_meta_predictor)
118    {
119    if (_param._predictor_0_have_bht)
120    delete out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY ;
121    if (_param._predictor_0_have_pht)
122    delete out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY ;
123    if (_param._predictor_1_have_bht)
124    delete out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY ;
125    if (_param._predictor_1_have_pht)
126    delete out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY ;
127    }
128    if (_param._predictor_2_have_bht)
129    delete out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY ;
130    if (_param._predictor_2_have_pht)
131    delete out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ;
132    delete  in_BRANCH_COMPLETE_HISTORY                 ;
133
134    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
135
136    log_printf(FUNC,Meta_Predictor_Glue,"deallocation","End");
137  };
138
139}; // end namespace meta_predictor_glue
140}; // end namespace meta_predictor
141}; // end namespace predictor
142}; // end namespace stage_1_ifetch
143
144}; // end namespace behavioural
145}; // end namespace morpheo             
146#endif
Note: See TracBrowser for help on using the repository browser.