source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 17.1 KB
Line 
1/*
2 * $Id: Commit_unit_deallocation.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace commit_unit {
17
18
19#undef  FUNCTION
20#define FUNCTION "Commit_unit::deallocation"
21  void Commit_unit::deallocation (void)
22  {
23    log_begin(Commit_unit,FUNCTION);
24
25    if (usage_is_set(_usage,USE_SYSTEMC))
26      {
27        delete    in_CLOCK ;
28        delete    in_NRESET;
29
30        DELETE2_SIGNAL( in_INSERT_VAL                     ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
31        DELETE2_SIGNAL(out_INSERT_ACK                     ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
32        DELETE2_SIGNAL( in_INSERT_FRONT_END_ID            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_front_end_id          );
33        DELETE2_SIGNAL( in_INSERT_CONTEXT_ID              ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_context_id            );
34        DELETE2_SIGNAL(out_INSERT_PACKET_ID               ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_rob_ptr               );
35//      DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_ID          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_rename_unit_id        );
36        DELETE2_SIGNAL( in_INSERT_DEPTH                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_depth                 );
37        DELETE2_SIGNAL( in_INSERT_TYPE                    ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_type                  );
38        DELETE2_SIGNAL( in_INSERT_OPERATION               ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_operation             );
39        DELETE2_SIGNAL( in_INSERT_NO_EXECUTE              ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
40        DELETE2_SIGNAL( in_INSERT_IS_DELAY_SLOT           ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
41        DELETE2_SIGNAL( in_INSERT_ADDRESS                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_instruction_address               );
42        DELETE2_SIGNAL( in_INSERT_EXCEPTION               ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_exception             );
43        DELETE2_SIGNAL( in_INSERT_EXCEPTION_USE           ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_exception             );
44        DELETE2_SIGNAL( in_INSERT_STORE_QUEUE_PTR_WRITE   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr       );
45        DELETE2_SIGNAL( in_INSERT_LOAD_QUEUE_PTR_WRITE    ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_load_queue_ptr        );
46        DELETE2_SIGNAL( in_INSERT_READ_RA                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
47        DELETE2_SIGNAL( in_INSERT_NUM_REG_RA_LOG          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register_logic);
48        DELETE2_SIGNAL( in_INSERT_NUM_REG_RA_PHY          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register      );
49        DELETE2_SIGNAL( in_INSERT_READ_RB                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
50        DELETE2_SIGNAL( in_INSERT_NUM_REG_RB_LOG          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register_logic);
51        DELETE2_SIGNAL( in_INSERT_NUM_REG_RB_PHY          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register      );
52        DELETE2_SIGNAL( in_INSERT_READ_RC                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
53        DELETE2_SIGNAL( in_INSERT_NUM_REG_RC_LOG          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register_logic);
54        DELETE2_SIGNAL( in_INSERT_NUM_REG_RC_PHY          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register      );
55        DELETE2_SIGNAL( in_INSERT_WRITE_RD                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
56        DELETE2_SIGNAL( in_INSERT_NUM_REG_RD_LOG          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register_logic);
57        DELETE2_SIGNAL( in_INSERT_NUM_REG_RD_PHY_OLD      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register      );
58        DELETE2_SIGNAL( in_INSERT_NUM_REG_RD_PHY_NEW      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register      );
59        DELETE2_SIGNAL( in_INSERT_WRITE_RE                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                                   );
60        DELETE2_SIGNAL( in_INSERT_NUM_REG_RE_LOG          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register_logic);
61        DELETE2_SIGNAL( in_INSERT_NUM_REG_RE_PHY_OLD      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register      );
62        DELETE2_SIGNAL( in_INSERT_NUM_REG_RE_PHY_NEW      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register      );
63
64        DELETE2_SIGNAL(out_RETIRE_VAL                     ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
65        DELETE2_SIGNAL( in_RETIRE_ACK                     ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
66        DELETE2_SIGNAL(out_RETIRE_FRONT_END_ID            ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_front_end_id          ); 
67        DELETE2_SIGNAL(out_RETIRE_CONTEXT_ID              ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_context_id            );   
68//      DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_ID          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_rename_unit_id        );
69        DELETE2_SIGNAL(out_RETIRE_EVENT_STATE             ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_event_state           );
70        DELETE2_SIGNAL(out_RETIRE_USE_STORE_QUEUE         ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
71        DELETE2_SIGNAL(out_RETIRE_USE_LOAD_QUEUE          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
72        DELETE2_SIGNAL(out_RETIRE_STORE_QUEUE_PTR_WRITE   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_store_queue_ptr       );
73        DELETE2_SIGNAL(out_RETIRE_LOAD_QUEUE_PTR_WRITE    ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_load_queue_ptr        );
74        DELETE2_SIGNAL(out_RETIRE_READ_RA                 ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
75        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RA_PHY          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register      );
76        DELETE2_SIGNAL(out_RETIRE_READ_RB                 ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
77        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RB_PHY          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register      );
78        DELETE2_SIGNAL(out_RETIRE_READ_RC                 ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
79        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RC_PHY          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register      );
80        DELETE2_SIGNAL(out_RETIRE_WRITE_RD                ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
81        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RD_LOG          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register_logic);
82        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RD_PHY_OLD      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register      );
83        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RD_PHY_NEW      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register      );
84        DELETE2_SIGNAL(out_RETIRE_WRITE_RE                ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                                   );
85        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RE_LOG          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register_logic);
86        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RE_PHY_OLD      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register      );
87        DELETE2_SIGNAL(out_RETIRE_NUM_REG_RE_PHY_NEW      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register      );
88
89        DELETE1_SIGNAL( in_COMMIT_VAL               ,_param->_nb_inst_commit,1                             );
90        DELETE1_SIGNAL(out_COMMIT_ACK               ,_param->_nb_inst_commit,1                             );
91        DELETE1_SIGNAL( in_COMMIT_WEN               ,_param->_nb_inst_commit,1                             );
92        DELETE1_SIGNAL( in_COMMIT_PACKET_ID         ,_param->_nb_inst_commit,_param->_size_rob_ptr         );
93//      DELETE1_SIGNAL( in_COMMIT_OPERATION         ,_param->_nb_inst_commit,_param->_size_operation       );
94//      DELETE1_SIGNAL( in_COMMIT_TYPE              ,_param->_nb_inst_commit,_param->_size_type            );
95        DELETE1_SIGNAL( in_COMMIT_FLAGS             ,_param->_nb_inst_commit,_param->_size_general_data    );
96        DELETE1_SIGNAL( in_COMMIT_EXCEPTION         ,_param->_nb_inst_commit,_param->_size_exception       );
97        DELETE1_SIGNAL( in_COMMIT_NO_SEQUENCE       ,_param->_nb_inst_commit,1                             );
98        DELETE1_SIGNAL( in_COMMIT_ADDRESS           ,_param->_nb_inst_commit,_param->_size_instruction_address         );
99        DELETE1_SIGNAL(out_COMMIT_NUM_REG_RD        ,_param->_nb_inst_commit,_param->_size_general_register+_param->_size_rename_unit_id);
100
101        DELETE1_SIGNAL(out_REEXECUTE_VAL                  ,_param->_nb_inst_reexecute,1                            );
102        DELETE1_SIGNAL( in_REEXECUTE_ACK                  ,_param->_nb_inst_reexecute,1                            );
103        DELETE1_SIGNAL(out_REEXECUTE_CONTEXT_ID           ,_param->_nb_inst_reexecute,_param->_size_context_id     );
104        DELETE1_SIGNAL(out_REEXECUTE_FRONT_END_ID         ,_param->_nb_inst_reexecute,_param->_size_front_end_id   );
105        DELETE1_SIGNAL(out_REEXECUTE_PACKET_ID            ,_param->_nb_inst_reexecute,_param->_size_rob_ptr        );
106        DELETE1_SIGNAL(out_REEXECUTE_OPERATION            ,_param->_nb_inst_reexecute,_param->_size_operation      );
107        DELETE1_SIGNAL(out_REEXECUTE_TYPE                 ,_param->_nb_inst_reexecute,_param->_size_type           );
108        DELETE1_SIGNAL(out_REEXECUTE_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_reexecute,_param->_size_store_queue_ptr);
109
110        DELETE1_SIGNAL(out_BRANCH_COMPLETE_VAL            ,_param->_nb_inst_branch_complete,1                         );
111        DELETE1_SIGNAL( in_BRANCH_COMPLETE_ACK            ,_param->_nb_inst_branch_complete,1                         );
112        DELETE1_SIGNAL(out_BRANCH_COMPLETE_CONTEXT_ID     ,_param->_nb_inst_branch_complete,_param->_size_context_id  );
113        DELETE1_SIGNAL(out_BRANCH_COMPLETE_FRONT_END_ID   ,_param->_nb_inst_branch_complete,_param->_size_front_end_id);
114        DELETE1_SIGNAL(out_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete,_param->_size_depth       );
115        DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete,_param->_size_instruction_address     );
116        DELETE1_SIGNAL(out_BRANCH_COMPLETE_FLAG           ,_param->_nb_inst_branch_complete,1                         );
117        DELETE1_SIGNAL( in_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete,1                         );
118
119        DELETE_SIGNAL (out_UPDATE_VAL                      ,1                         );
120        DELETE_SIGNAL ( in_UPDATE_ACK                      ,1                         );
121        DELETE_SIGNAL (out_UPDATE_CONTEXT_ID               ,_param->_size_context_id  );
122        DELETE_SIGNAL (out_UPDATE_FRONT_END_ID             ,_param->_size_front_end_id);
123        DELETE_SIGNAL (out_UPDATE_DEPTH                    ,_param->_size_depth       );
124        DELETE_SIGNAL (out_UPDATE_TYPE                     ,_param->_size_event_type  );
125        DELETE_SIGNAL (out_UPDATE_IS_DELAY_SLOT            ,1                         );
126        DELETE_SIGNAL (out_UPDATE_ADDRESS                  ,_param->_size_instruction_address     );
127        DELETE_SIGNAL (out_UPDATE_ADDRESS_EPCR             ,_param->_size_instruction_address     );
128        DELETE_SIGNAL (out_UPDATE_ADDRESS_EEAR_VAL         ,1                         );
129        DELETE_SIGNAL (out_UPDATE_ADDRESS_EEAR             ,_param->_size_instruction_address     );
130
131        DELETE2_SIGNAL( in_EVENT_VAL                       ,_param->_nb_front_end, _param->_nb_context[it1],1                    );
132        DELETE2_SIGNAL(out_EVENT_ACK                       ,_param->_nb_front_end, _param->_nb_context[it1],1                    );
133        DELETE2_SIGNAL( in_EVENT_ADDRESS                   ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_instruction_address);
134        DELETE2_SIGNAL( in_EVENT_ADDRESS_NEXT              ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_instruction_address); 
135        DELETE2_SIGNAL( in_EVENT_ADDRESS_NEXT_VAL          ,_param->_nb_front_end, _param->_nb_context[it1],1                    );
136        DELETE2_SIGNAL( in_EVENT_IS_DS_TAKE                ,_param->_nb_front_end, _param->_nb_context[it1],1                    );
137
138        DELETE2_SIGNAL(out_NB_INST_COMMIT_ALL             ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_nb_inst_commit);
139        DELETE2_SIGNAL(out_NB_INST_COMMIT_MEM             ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_nb_inst_commit);
140
141        DELETE2_SIGNAL( in_DEPTH_MIN                      ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_depth  );
142        DELETE2_SIGNAL( in_DEPTH_MAX                      ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_depth+1);
143
144        DELETE2_SIGNAL( in_SPR_READ_SR_OVE                ,_param->_nb_front_end, _param->_nb_context[it1],1);
145
146        DELETE2_SIGNAL(out_SPR_WRITE_VAL                  ,_param->_nb_front_end, _param->_nb_context[it1],1);
147        DELETE2_SIGNAL( in_SPR_WRITE_ACK                  ,_param->_nb_front_end, _param->_nb_context[it1],1);
148        DELETE2_SIGNAL(out_SPR_WRITE_SR_F_VAL             ,_param->_nb_front_end, _param->_nb_context[it1],1);
149        DELETE2_SIGNAL(out_SPR_WRITE_SR_F                 ,_param->_nb_front_end, _param->_nb_context[it1],1);
150        DELETE2_SIGNAL(out_SPR_WRITE_SR_CY_VAL            ,_param->_nb_front_end, _param->_nb_context[it1],1);
151        DELETE2_SIGNAL(out_SPR_WRITE_SR_CY                ,_param->_nb_front_end, _param->_nb_context[it1],1);
152        DELETE2_SIGNAL(out_SPR_WRITE_SR_OV_VAL            ,_param->_nb_front_end, _param->_nb_context[it1],1);
153        DELETE2_SIGNAL(out_SPR_WRITE_SR_OV                ,_param->_nb_front_end, _param->_nb_context[it1],1);
154
155        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
156        delete [] internal_BANK_INSERT_VAL            ;
157        delete [] internal_BANK_INSERT_NUM_RENAME_UNIT;
158        delete [] internal_BANK_INSERT_NUM_INST       ;
159       
160        delete [] internal_BANK_COMMIT_VAL            ;
161        delete [] internal_BANK_COMMIT_NUM_INST       ;
162        delete [] internal_BANK_COMMIT_ENTRY          ;
163       
164        delete [] internal_BANK_RETIRE_VAL            ;
165        delete [] internal_BANK_RETIRE_NUM_RENAME_UNIT;
166        delete [] internal_BANK_RETIRE_NUM_INST       ;
167       
168        delete [] internal_REEXECUTE_VAL              ;
169        delete [] internal_REEXECUTE_NUM_BANK         ;
170       
171        delete [] internal_BRANCH_COMPLETE_VAL        ;
172        delete [] internal_BRANCH_COMPLETE_NUM_BANK   ;
173       
174        for (uint32_t i=0; i<_param->_nb_front_end; i++)
175          delete [] internal_EVENT_ACK [i];
176        delete [] internal_EVENT_ACK;
177       
178        // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
179        for (uint32_t i=0; i<_param->_nb_front_end; i++)
180          {
181            delete [] reg_NB_INST_COMMIT_ALL [i];
182            delete [] reg_NB_INST_COMMIT_MEM [i];
183          }
184        delete [] reg_NB_INST_COMMIT_ALL;
185        delete [] reg_NB_INST_COMMIT_MEM;
186       
187        delete [] reg_BANK_PTR;
188       
189        delete [] _rob;
190      }
191
192    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
193
194    delete _priority_insert;
195
196    delete _component;
197
198    log_end(Commit_unit,FUNCTION);
199  };
200
201}; // end namespace commit_unit
202}; // end namespace ooo_engine
203}; // end namespace multi_ooo_engine
204}; // end namespace core
205
206}; // end namespace behavioural
207}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.