source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp @ 128

Last change on this file since 128 was 128, checked in by rosiere, 15 years ago

1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script

  • Property svn:keywords set to Id
File size: 12.1 KB
Line 
1/*
2 * $Id: Update_Prediction_Table_deallocation.cpp 128 2009-06-26 08:43:23Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17namespace update_prediction_table {
18
19
20#undef  FUNCTION
21#define FUNCTION "Update_Prediction_Table::deallocation"
22  void Update_Prediction_Table::deallocation (void)
23  {
24    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
25
26    if (_usage & USE_SYSTEMC)
27      {
28        delete    in_CLOCK ;
29        delete    in_NRESET;
30
31        // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32        DELETE1_SIGNAL( in_PREDICT_VAL                 ,_param->_nb_inst_predict,1);
33        DELETE1_SIGNAL(out_PREDICT_ACK                 ,_param->_nb_inst_predict,1);
34        DELETE1_SIGNAL( in_PREDICT_CONTEXT_ID          ,_param->_nb_inst_predict,_param->_size_context_id);
35        DELETE1_SIGNAL(out_PREDICT_UPDATE_PREDICTION_ID,_param->_nb_inst_predict,_param->_size_depth);
36        DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_SRC     ,_param->_nb_inst_predict,_param->_size_instruction_address);
37        DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_DEST    ,_param->_nb_inst_predict,_param->_size_instruction_address);
38        DELETE1_SIGNAL( in_PREDICT_BTB_CONDITION       ,_param->_nb_inst_predict,_param->_size_branch_condition);
39        DELETE1_SIGNAL( in_PREDICT_BTB_LAST_TAKE       ,_param->_nb_inst_predict,1);
40        DELETE1_SIGNAL( in_PREDICT_BTB_IS_ACCURATE     ,_param->_nb_inst_predict,1);
41        DELETE1_SIGNAL( in_PREDICT_DIR_HISTORY         ,_param->_nb_inst_predict,_param->_size_history);
42        DELETE1_SIGNAL( in_PREDICT_RAS_ADDRESS         ,_param->_nb_inst_predict,_param->_size_instruction_address);
43        DELETE1_SIGNAL( in_PREDICT_RAS_INDEX           ,_param->_nb_inst_predict,_param->_max_size_ras_index);
44
45        // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46        DELETE1_SIGNAL( in_DECOD_VAL                 ,_param->_nb_inst_decod,1);
47        DELETE1_SIGNAL(out_DECOD_ACK                 ,_param->_nb_inst_decod,1);
48        DELETE1_SIGNAL( in_DECOD_CONTEXT_ID          ,_param->_nb_inst_decod,_param->_size_context_id);
49        DELETE1_SIGNAL( in_DECOD_BTB_ADDRESS_SRC     ,_param->_nb_inst_decod,_param->_size_instruction_address);
50        DELETE1_SIGNAL( in_DECOD_BTB_ADDRESS_DEST    ,_param->_nb_inst_decod,_param->_size_instruction_address);
51        DELETE1_SIGNAL( in_DECOD_BTB_CONDITION       ,_param->_nb_inst_decod,_param->_size_branch_condition);
52        DELETE1_SIGNAL( in_DECOD_BTB_LAST_TAKE       ,_param->_nb_inst_decod,1);
53        DELETE1_SIGNAL( in_DECOD_RAS_ADDRESS         ,_param->_nb_inst_decod,_param->_size_instruction_address);
54        DELETE1_SIGNAL( in_DECOD_RAS_INDEX           ,_param->_nb_inst_decod,_param->_max_size_ras_index);
55        DELETE1_SIGNAL( in_DECOD_MISS_IFETCH         ,_param->_nb_inst_decod,1);
56        DELETE1_SIGNAL( in_DECOD_MISS_DECOD          ,_param->_nb_inst_decod,1);
57        DELETE1_SIGNAL( in_DECOD_UPDATE_PREDICTION_ID,_param->_nb_inst_decod,_param->_size_depth);
58//      DELETE1_SIGNAL(out_DECOD_DEPTH               ,_param->_nb_inst_decod,_param->_size_depth);
59        DELETE1_SIGNAL( in_DECOD_IS_ACCURATE         ,_param->_nb_inst_decod,1);
60        DELETE1_SIGNAL(out_DECOD_CAN_CONTINUE        ,_param->_nb_inst_decod,1);
61
62        // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63        DELETE1_SIGNAL( in_BRANCH_COMPLETE_VAL            ,_param->_nb_inst_branch_complete,1);
64        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ACK            ,_param->_nb_inst_branch_complete,1);
65        DELETE1_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_ID     ,_param->_nb_inst_branch_complete,_param->_size_context_id);
66        DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete,_param->_size_depth);
67        DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
68        DELETE1_SIGNAL( in_BRANCH_COMPLETE_NO_SEQUENCE    ,_param->_nb_inst_branch_complete,1);
69        DELETE1_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete,1);
70//      DELETE1_SIGNAL(out_BRANCH_COMPLETE_TAKE           ,_param->_nb_inst_branch_complete,1);
71//      DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
72//      DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete,_param->_size_instruction_address);
73
74        // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75        DELETE1_SIGNAL(out_BRANCH_EVENT_VAL              ,_param->_nb_context,1);
76        DELETE1_SIGNAL( in_BRANCH_EVENT_ACK              ,_param->_nb_context,1);
77//      DELETE1_SIGNAL(out_BRANCH_EVENT_CONTEXT_ID       ,_param->_nb_context,_param->_size_context_id);
78        DELETE1_SIGNAL(out_BRANCH_EVENT_DEPTH            ,_param->_nb_context,_param->_size_depth);
79//      DELETE1_SIGNAL(out_BRANCH_EVENT_MISS_PREDICTION  ,_param->_nb_context,1);
80        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC      ,_param->_nb_context,_param->_size_instruction_address);
81        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST_VAL ,_param->_nb_context,1);
82        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST     ,_param->_nb_context,_param->_size_instruction_address);
83        DELETE1_SIGNAL(out_BRANCH_EVENT_CAN_CONTINUE     ,_param->_nb_context,1);
84
85        // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86        DELETE1_SIGNAL(out_UPDATE_VAL                  ,_param->_nb_inst_update,1);
87        DELETE1_SIGNAL( in_UPDATE_ACK                  ,_param->_nb_inst_update,1);
88        DELETE1_SIGNAL(out_UPDATE_CONTEXT_ID           ,_param->_nb_inst_update,_param->_size_context_id);
89        DELETE1_SIGNAL(out_UPDATE_MISS_PREDICTION      ,_param->_nb_inst_update,1);
90        DELETE1_SIGNAL(out_UPDATE_DIRECTION_GOOD       ,_param->_nb_inst_update,1);
91        DELETE1_SIGNAL(out_UPDATE_PREDICTION_IFETCH    ,_param->_nb_inst_update,1);
92        DELETE1_SIGNAL(out_UPDATE_BTB_VAL              ,_param->_nb_inst_update,1);
93        DELETE1_SIGNAL(out_UPDATE_BTB_ADDRESS_SRC      ,_param->_nb_inst_update,_param->_size_instruction_address);
94        DELETE1_SIGNAL(out_UPDATE_BTB_ADDRESS_DEST     ,_param->_nb_inst_update,_param->_size_instruction_address);
95        DELETE1_SIGNAL(out_UPDATE_BTB_CONDITION        ,_param->_nb_inst_update,_param->_size_branch_condition);
96        DELETE1_SIGNAL(out_UPDATE_DIR_VAL              ,_param->_nb_inst_update,1);
97        DELETE1_SIGNAL(out_UPDATE_DIR_HISTORY          ,_param->_nb_inst_update,_param->_size_history);
98        DELETE1_SIGNAL(out_UPDATE_RAS_VAL              ,_param->_nb_inst_update,1);
99        DELETE1_SIGNAL(out_UPDATE_RAS_FLUSH            ,_param->_nb_inst_update,1);
100        DELETE1_SIGNAL(out_UPDATE_RAS_PUSH             ,_param->_nb_inst_update,1);
101        DELETE1_SIGNAL(out_UPDATE_RAS_ADDRESS          ,_param->_nb_inst_update,_param->_size_instruction_address);
102        DELETE1_SIGNAL(out_UPDATE_RAS_INDEX            ,_param->_nb_inst_update,_param->_max_size_ras_index);
103
104        // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105        DELETE1_SIGNAL( in_EVENT_VAL    ,_param->_nb_context,1);
106        DELETE1_SIGNAL(out_EVENT_ACK    ,_param->_nb_context,1);
107        DELETE1_SIGNAL( in_EVENT_TYPE   ,_param->_nb_context,_param->_size_event_type );
108        DELETE1_SIGNAL( in_EVENT_DEPTH  ,_param->_nb_context,_param->_size_depth      );
109
110        // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111        DELETE1_SIGNAL(out_DEPTH_VAL          ,_param->_nb_context,1);
112        DELETE1_SIGNAL(out_DEPTH_CURRENT      ,_param->_nb_context,_param->_size_depth);
113        DELETE1_SIGNAL(out_DEPTH_MIN          ,_param->_nb_context,_param->_size_depth);
114        DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth);
115        DELETE1_SIGNAL(out_DEPTH_FULL         ,_param->_nb_context,1);
116
117        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118        DELETE1(internal_PREDICT_ACK                     ,_param->_nb_inst_predict);
119        DELETE1(internal_PREDICT_UPDATE_PREDICTION_ID    ,_param->_nb_inst_predict);
120        DELETE1(internal_DECOD_ACK                       ,_param->_nb_inst_decod);
121        DELETE1(internal_DECOD_UPT_PTR_WRITE             ,_param->_nb_inst_decod);
122        DELETE1(internal_BRANCH_COMPLETE_ACK             ,_param->_nb_inst_branch_complete);
123        DELETE1(internal_BRANCH_COMPLETE_MISS_PREDICTION ,_param->_nb_inst_branch_complete);
124        DELETE1(internal_BRANCH_COMPLETE_TAKE            ,_param->_nb_inst_branch_complete);
125        DELETE1(internal_BRANCH_COMPLETE_ADDRESS_DEST    ,_param->_nb_inst_branch_complete);
126        DELETE1(internal_BRANCH_EVENT_VAL                ,_param->_nb_context);
127        DELETE1(internal_BRANCH_EVENT_DEPTH              ,_param->_nb_context);
128        DELETE1(internal_UPDATE_VAL                      ,_param->_nb_inst_update);
129        DELETE1(internal_UPDATE_VAL_WITHOUT_ACK          ,_param->_nb_inst_update);
130        DELETE1(internal_UPDATE_CONTEXT_ID               ,_param->_nb_inst_update);
131        DELETE1(internal_UPDATE_FROM_UFPT                ,_param->_nb_inst_update);
132        DELETE1(internal_UPDATE_DEPTH                    ,_param->_nb_inst_update);
133        DELETE1(internal_UPDATE_RAS                      ,_param->_nb_inst_update);
134        DELETE1(internal_EVENT_ACK                       ,_param->_nb_context);
135       
136        // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
137        DELETE1(reg_IS_ACCURATE                  ,_param->_nb_context);
138       
139        DELETE2(reg_UPDATE_FETCH_PREDICTION_TABLE,_param->_nb_context,_param->_size_ufpt_queue[it1]);
140        DELETE1(reg_UFPT_BOTTOM                  ,_param->_nb_context);
141        DELETE1(reg_UFPT_TOP                     ,_param->_nb_context);
142        DELETE1(reg_UFPT_UPDATE                  ,_param->_nb_context);
143        DELETE1(reg_UFPT_NB_NEED_UPDATE          ,_param->_nb_context);
144        DELETE1(reg_UFPT_NB_UPDATE               ,_param->_nb_context);
145       
146        DELETE2(reg_UPDATE_PREDICTION_TABLE      ,_param->_nb_context,_param->_size_upt_queue[it1]);
147        DELETE1(reg_UPT_BOTTOM                   ,_param->_nb_context);
148        DELETE1(reg_UPT_TOP                      ,_param->_nb_context);
149        DELETE1(reg_UPT_TOP_EVENT                ,_param->_nb_context);
150        DELETE1(reg_UPT_UPDATE                   ,_param->_nb_context);
151        DELETE1(reg_UPT_EMPTY                    ,_param->_nb_context);
152       
153        DELETE1(reg_UFPT_EVENT_STATE             ,_param->_nb_context);
154        DELETE1(reg_UPT_EVENT_STATE              ,_param->_nb_context);
155
156//         DELETE1(reg_EVENT_VAL                    ,_param->_nb_context);
157        DELETE1(reg_EVENT_UPT_PTR                ,_param->_nb_context);
158        DELETE1(reg_EVENT_UPT_FULL               ,_param->_nb_context);
159
160//         DELETE1(reg_EVENT_STATE                  ,_param->_nb_context);
161//         DELETE1(reg_EVENT_IS_BRANCH              ,_param->_nb_context);
162        DELETE1(reg_EVENT_DEPTH                  ,_param->_nb_context);
163        DELETE1(reg_EVENT_ADDRESS_SRC            ,_param->_nb_context);
164        DELETE1(reg_EVENT_ADDRESS_DEST_VAL       ,_param->_nb_context);
165        DELETE1(reg_EVENT_ADDRESS_DEST           ,_param->_nb_context);
166        DELETE1(reg_EVENT_CAN_CONTINUE           ,_param->_nb_context);
167       }
168
169    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
170
171    delete _component;
172
173#if defined(DEBUG) and defined(DEBUG_Update_Prediction_Table) and (DEBUG_Update_Prediction_Table == true)
174    {
175      for (uint32_t i=0; i<_param->_nb_thread; ++i)
176        if (_param->_have_thread [i])
177          {
178            branchement_log_file [i].close();
179          }
180      delete [] branchement_log_file;
181    }
182#endif
183
184    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
185  };
186
187}; // end namespace update_prediction_table
188}; // end namespace prediction_unit
189}; // end namespace front_end
190}; // end namespace multi_front_end
191}; // end namespace core
192
193}; // end namespace behavioural
194}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.