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

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

1) Fix bug (read unit, RAT -> write in R0, SPR desallocation ...)
2) Change VHDL Execute_queue -> use Generic/Queue?
3) Complete document on VHDL generation
4) Add soc test

  • Property svn:keywords set to Id
File size: 8.4 KB
Line 
1/*
2 * $Id: Update_Prediction_Table_deallocation.cpp 98 2008-12-31 10:18:08Z 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        delete []  in_PREDICT_VAL                 ;
33        delete [] out_PREDICT_ACK                 ;
34        if (_param->_have_port_context_id)
35        delete []  in_PREDICT_CONTEXT_ID          ;
36        delete []  in_PREDICT_BTB_ADDRESS_SRC     ;
37        delete []  in_PREDICT_BTB_ADDRESS_DEST    ;
38        delete []  in_PREDICT_BTB_CONDITION       ;
39        delete []  in_PREDICT_BTB_LAST_TAKE       ;
40        delete []  in_PREDICT_BTB_IS_ACCURATE     ;
41        if (_param->_have_port_history)
42        delete []  in_PREDICT_DIR_HISTORY         ;
43        delete []  in_PREDICT_RAS_ADDRESS         ;
44        delete []  in_PREDICT_RAS_INDEX           ;
45        if (_param->_have_port_depth)
46        delete [] out_PREDICT_UPDATE_PREDICTION_ID;
47       
48        // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49        delete []  in_DECOD_VAL                   ;
50        delete [] out_DECOD_ACK                   ;
51        if (_param->_have_port_context_id)
52        delete []  in_DECOD_CONTEXT_ID            ;
53        delete []  in_DECOD_BTB_ADDRESS_SRC       ;
54        delete []  in_DECOD_BTB_ADDRESS_DEST      ;
55        delete []  in_DECOD_BTB_CONDITION         ;
56        delete []  in_DECOD_BTB_LAST_TAKE         ;
57        delete []  in_DECOD_RAS_ADDRESS           ;
58        delete []  in_DECOD_RAS_INDEX             ;
59        delete []  in_DECOD_MISS_IFETCH           ;
60        delete []  in_DECOD_MISS_DECOD            ;
61        if (_param->_have_port_depth)
62        delete []  in_DECOD_UPDATE_PREDICTION_ID  ;
63//      if (_param->_have_port_depth)
64//      delete [] out_DECOD_DEPTH                 ;
65        delete []  in_DECOD_IS_ACCURATE           ;
66       
67        // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68        delete []  in_BRANCH_COMPLETE_VAL            ;
69        delete [] out_BRANCH_COMPLETE_ACK            ;
70        if (_param->_have_port_context_id)
71        delete []  in_BRANCH_COMPLETE_CONTEXT_ID     ;
72        if (_param->_have_port_depth)
73        delete []  in_BRANCH_COMPLETE_DEPTH          ;
74        delete []  in_BRANCH_COMPLETE_ADDRESS        ;
75        delete []  in_BRANCH_COMPLETE_NO_SEQUENCE    ;
76        delete [] out_BRANCH_COMPLETE_MISS_PREDICTION;
77        delete [] out_BRANCH_COMPLETE_TAKE           ;
78        delete [] out_BRANCH_COMPLETE_ADDRESS_SRC    ;
79        delete [] out_BRANCH_COMPLETE_ADDRESS_DEST   ;
80
81        // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82        DELETE1_SIGNAL(out_BRANCH_EVENT_VAL              ,_param->_nb_context,1);
83        DELETE1_SIGNAL( in_BRANCH_EVENT_ACK              ,_param->_nb_context,1);
84//      DELETE1_SIGNAL(out_BRANCH_EVENT_CONTEXT_ID       ,_param->_nb_context,_param->_size_context_id);
85        DELETE1_SIGNAL(out_BRANCH_EVENT_DEPTH            ,_param->_nb_context,_param->_size_depth);
86//      DELETE1_SIGNAL(out_BRANCH_EVENT_MISS_PREDICTION  ,_param->_nb_context,1);
87        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC      ,_param->_nb_context,_param->_size_instruction_address);
88        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST_VAL ,_param->_nb_context,1);
89        DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST     ,_param->_nb_context,_param->_size_instruction_address);
90
91        // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92        delete [] out_UPDATE_VAL                  ;
93        delete []  in_UPDATE_ACK                  ;
94        if (_param->_have_port_context_id)
95        delete [] out_UPDATE_CONTEXT_ID           ;
96        delete [] out_UPDATE_MISS_PREDICTION      ;
97        delete [] out_UPDATE_DIRECTION_GOOD       ;
98        delete [] out_UPDATE_BTB_VAL              ;
99        delete [] out_UPDATE_BTB_ADDRESS_SRC      ;
100        delete [] out_UPDATE_BTB_ADDRESS_DEST     ;
101        delete [] out_UPDATE_BTB_CONDITION        ;
102        delete [] out_UPDATE_DIR_VAL              ;
103        if (_param->_have_port_history)
104        delete [] out_UPDATE_DIR_HISTORY          ;
105        delete [] out_UPDATE_RAS_VAL              ;
106        delete [] out_UPDATE_RAS_FLUSH            ;
107        delete [] out_UPDATE_RAS_PUSH             ;
108        delete [] out_UPDATE_RAS_ADDRESS          ;
109        delete [] out_UPDATE_RAS_INDEX            ;
110        delete [] out_UPDATE_RAS_PREDICTION_IFETCH;
111
112        // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113        DELETE1_SIGNAL( in_EVENT_VAL    ,_param->_nb_context,1);
114        DELETE1_SIGNAL(out_EVENT_ACK    ,_param->_nb_context,1);
115        DELETE1_SIGNAL( in_EVENT_TYPE   ,_param->_nb_context,_param->_size_event_type );
116        DELETE1_SIGNAL( in_EVENT_DEPTH  ,_param->_nb_context,_param->_size_depth      );
117
118        // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119        DELETE1_SIGNAL(out_DEPTH_CURRENT      ,_param->_nb_context,_param->_size_depth);
120        DELETE1_SIGNAL(out_DEPTH_MIN          ,_param->_nb_context,_param->_size_depth);
121        DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth+1);
122
123        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124        DELETE1(internal_PREDICT_ACK                     ,_param->_nb_inst_predict);
125        DELETE1(internal_PREDICT_UPDATE_PREDICTION_ID    ,_param->_nb_inst_predict);
126        DELETE1(internal_DECOD_ACK                       ,_param->_nb_inst_decod);
127        DELETE1(internal_DECOD_UPT_PTR_WRITE             ,_param->_nb_inst_decod);
128        DELETE1(internal_BRANCH_COMPLETE_ACK             ,_param->_nb_inst_branch_complete);
129        DELETE1(internal_BRANCH_COMPLETE_MISS_PREDICTION ,_param->_nb_inst_branch_complete);
130        DELETE1(internal_BRANCH_COMPLETE_TAKE            ,_param->_nb_inst_branch_complete);
131        DELETE1(internal_BRANCH_COMPLETE_ADDRESS_DEST    ,_param->_nb_inst_branch_complete);
132        DELETE1(internal_BRANCH_EVENT_VAL                ,_param->_nb_context);
133        DELETE1(internal_BRANCH_EVENT_DEPTH              ,_param->_nb_context);
134        DELETE1(internal_UPDATE_VAL                      ,_param->_nb_inst_update);
135        DELETE1(internal_UPDATE_VAL_WITHOUT_ACK          ,_param->_nb_inst_update);
136        DELETE1(internal_UPDATE_CONTEXT_ID               ,_param->_nb_inst_update);
137        DELETE1(internal_UPDATE_FROM_UFPT                ,_param->_nb_inst_update);
138        DELETE1(internal_UPDATE_DEPTH                    ,_param->_nb_inst_update);
139        DELETE1(internal_UPDATE_RAS                      ,_param->_nb_inst_update);
140        DELETE1(internal_EVENT_ACK                       ,_param->_nb_context);
141       
142        // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
143        DELETE1(reg_IS_ACCURATE                  ,_param->_nb_context);
144       
145        DELETE2(reg_UPDATE_FETCH_PREDICTION_TABLE,_param->_nb_context,_param->_size_ufpt_queue[it1]);
146        DELETE1(reg_UFPT_BOTTOM                  ,_param->_nb_context);
147        DELETE1(reg_UFPT_TOP                     ,_param->_nb_context);
148        DELETE1(reg_UFPT_UPDATE                  ,_param->_nb_context);
149        DELETE1(reg_UFPT_NB_NEED_UPDATE          ,_param->_nb_context);
150       
151        DELETE2(reg_UPDATE_PREDICTION_TABLE      ,_param->_nb_context,_param->_size_upt_queue[it1]);
152        DELETE1(reg_UPT_BOTTOM                   ,_param->_nb_context);
153        DELETE1(reg_UPT_TOP                      ,_param->_nb_context);
154        DELETE1(reg_UPT_TOP_EVENT                ,_param->_nb_context);
155        DELETE1(reg_UPT_UPDATE                   ,_param->_nb_context);
156       
157        DELETE1(reg_EVENT_STATE                  ,_param->_nb_context);
158        DELETE1(reg_EVENT_DEPTH                  ,_param->_nb_context);
159        DELETE1(reg_EVENT_ADDRESS_SRC            ,_param->_nb_context);
160        DELETE1(reg_EVENT_ADDRESS_DEST_VAL       ,_param->_nb_context);
161        DELETE1(reg_EVENT_ADDRESS_DEST           ,_param->_nb_context);
162       }
163
164    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
165
166    delete _component;
167
168    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
169  };
170
171}; // end namespace update_prediction_table
172}; // end namespace prediction_unit
173}; // end namespace front_end
174}; // end namespace multi_front_end
175}; // end namespace core
176
177}; // end namespace behavioural
178}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.