source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/src/Special_Register_unit_deallocation.cpp @ 115

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

1) Write queue with mealy
2) Network : fix bug
3) leak memory

  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1/*
2 * $Id: Special_Register_unit_deallocation.cpp 115 2009-04-20 21:29:17Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/include/Special_Register_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace special_register_unit {
17
18
19#undef  FUNCTION
20#define FUNCTION "Special_Register_unit::deallocation"
21  void Special_Register_unit::deallocation (void)
22  {
23    log_begin(Special_Register_unit,FUNCTION);
24
25    if (usage_is_set(_usage,USE_SYSTEMC))
26      {
27        delete    in_CLOCK ;
28        delete    in_NRESET;
29
30        DELETE1_SIGNAL( in_SPR_ACCESS_VAL          ,_param->_nb_inst_reexecute,1);
31        DELETE1_SIGNAL(out_SPR_ACCESS_ACK          ,_param->_nb_inst_reexecute,1);
32        DELETE1_SIGNAL( in_SPR_ACCESS_WEN          ,_param->_nb_inst_reexecute,1);
33        DELETE1_SIGNAL( in_SPR_ACCESS_CONTEXT_ID   ,_param->_nb_inst_reexecute,_param->_size_context_id  );
34        DELETE1_SIGNAL( in_SPR_ACCESS_FRONT_END_ID ,_param->_nb_inst_reexecute,_param->_size_front_end_id);
35        DELETE1_SIGNAL( in_SPR_ACCESS_NUM_GROUP    ,_param->_nb_inst_reexecute,_param->_size_special_address_group   );
36        DELETE1_SIGNAL( in_SPR_ACCESS_NUM_REG      ,_param->_nb_inst_reexecute,_param->_size_special_address_register);
37        DELETE1_SIGNAL( in_SPR_ACCESS_WDATA        ,_param->_nb_inst_reexecute,_param->_size_spr);
38        DELETE1_SIGNAL(out_SPR_ACCESS_RDATA        ,_param->_nb_inst_reexecute,_param->_size_spr);
39        DELETE1_SIGNAL(out_SPR_ACCESS_INVALID      ,_param->_nb_inst_reexecute,1);
40       
41        DELETE2_SIGNAL(out_SPR_READ_SR             ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_spr);
42       
43        DELETE2_SIGNAL( in_SPR_COMMIT_VAL          ,_param->_nb_front_end, _param->_nb_context[it1],1);
44        DELETE2_SIGNAL(out_SPR_COMMIT_ACK          ,_param->_nb_front_end, _param->_nb_context[it1],1);
45        DELETE2_SIGNAL( in_SPR_COMMIT_SR_F_VAL     ,_param->_nb_front_end, _param->_nb_context[it1],1);
46        DELETE2_SIGNAL( in_SPR_COMMIT_SR_F         ,_param->_nb_front_end, _param->_nb_context[it1],1);
47        DELETE2_SIGNAL( in_SPR_COMMIT_SR_CY_VAL    ,_param->_nb_front_end, _param->_nb_context[it1],1);
48        DELETE2_SIGNAL( in_SPR_COMMIT_SR_CY        ,_param->_nb_front_end, _param->_nb_context[it1],1);
49        DELETE2_SIGNAL( in_SPR_COMMIT_SR_OV_VAL    ,_param->_nb_front_end, _param->_nb_context[it1],1);
50        DELETE2_SIGNAL( in_SPR_COMMIT_SR_OV        ,_param->_nb_front_end, _param->_nb_context[it1],1);
51
52        DELETE2_SIGNAL( in_SPR_EVENT_VAL           ,_param->_nb_front_end, _param->_nb_context[it1],1);
53        DELETE2_SIGNAL(out_SPR_EVENT_ACK           ,_param->_nb_front_end, _param->_nb_context[it1],1);
54        DELETE2_SIGNAL( in_SPR_EVENT_EPCR          ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_spr);
55        DELETE2_SIGNAL( in_SPR_EVENT_EEAR_WEN      ,_param->_nb_front_end, _param->_nb_context[it1],1);
56        DELETE2_SIGNAL( in_SPR_EVENT_EEAR          ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_spr);
57        DELETE2_SIGNAL( in_SPR_EVENT_SR_DSX        ,_param->_nb_front_end, _param->_nb_context[it1],1);
58        DELETE2_SIGNAL( in_SPR_EVENT_SR_TO_ESR     ,_param->_nb_front_end, _param->_nb_context[it1],1);
59
60        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61        DELETE1(internal_SPR_ACCESS_ACK ,_param->_nb_inst_reexecute);
62        DELETE2(internal_SPR_COMMIT_ACK ,_param->_nb_front_end,_param->_nb_context [it1]);
63        DELETE2(internal_SPR_EVENT_ACK  ,_param->_nb_front_end,_param->_nb_context [it1]);
64      }
65
66    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
67
68    for (uint32_t i=0; i<_param->_nb_front_end; i++)
69      {
70        for (uint32_t j=0; j<_param->_nb_context[i]; j++)
71          {
72            for (uint32_t k=0; k<NB_GROUP; k++)
73              if (_spr [i][j][k] != NULL)
74                {
75                  for (uint32_t l=0; l<NB_REG_GROUP[k]; l++)
76                    if (_spr [i][j][k][l] != NULL)
77                      delete _spr [i][j][k][l];
78                  delete [] _spr [i][j][k];
79                }
80            delete [] _spr [i][j];
81          }     
82        delete [] _spr [i];
83      }
84    delete [] _spr;
85
86    for (uint32_t i=0; i<_param->_nb_front_end; i++)
87      {
88        for (uint32_t j=0; j<_param->_nb_context[i]; j++)
89          delete _spr_access_mode [i][j];
90        delete [] _spr_access_mode [i];
91      }
92    delete [] _spr_access_mode;
93
94    delete    _component;
95
96    log_end(Special_Register_unit,FUNCTION);
97  };
98
99}; // end namespace special_register_unit
100}; // end namespace ooo_engine
101}; // end namespace multi_ooo_engine
102}; // end namespace core
103
104}; // end namespace behavioural
105}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.