1 | /* |
---|
2 | * $Id: Special_Register_unit_deallocation.cpp 98 2008-12-31 10:18:08Z 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 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_ooo_engine { |
---|
15 | namespace ooo_engine { |
---|
16 | namespace 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 | delete [] internal_SPR_ACCESS_ACK; |
---|
62 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
63 | { |
---|
64 | delete [] internal_SPR_COMMIT_ACK [i]; |
---|
65 | delete [] internal_SPR_EVENT_ACK [i]; |
---|
66 | } |
---|
67 | delete [] internal_SPR_COMMIT_ACK; |
---|
68 | delete [] internal_SPR_EVENT_ACK; |
---|
69 | } |
---|
70 | |
---|
71 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
72 | |
---|
73 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
74 | { |
---|
75 | for (uint32_t j=0; j<_param->_nb_context[i]; j++) |
---|
76 | { |
---|
77 | for (uint32_t k=0; k<NB_GROUP; k++) |
---|
78 | { |
---|
79 | if (_spr [i][j][k] != NULL) |
---|
80 | { |
---|
81 | for (uint32_t l=0; l<NB_REG_GROUP[k]; l++) |
---|
82 | if (_spr [i][j][k][l] != NULL) |
---|
83 | delete _spr [i][j][k][l]; |
---|
84 | delete [] _spr [i][j][k]; |
---|
85 | } |
---|
86 | } |
---|
87 | delete [] _spr [i][j]; |
---|
88 | } |
---|
89 | delete [] _spr [i]; |
---|
90 | } |
---|
91 | delete [] _spr; |
---|
92 | |
---|
93 | for (uint32_t i=0; i<_param->_nb_front_end; i++) |
---|
94 | { |
---|
95 | for (uint32_t j=0; j<_param->_nb_context[i]; j++) |
---|
96 | delete _spr_access_mode [i][j]; |
---|
97 | delete [] _spr_access_mode [i]; |
---|
98 | } |
---|
99 | delete [] _spr_access_mode; |
---|
100 | |
---|
101 | delete _component; |
---|
102 | |
---|
103 | log_end(Special_Register_unit,FUNCTION); |
---|
104 | }; |
---|
105 | |
---|
106 | }; // end namespace special_register_unit |
---|
107 | }; // end namespace ooo_engine |
---|
108 | }; // end namespace multi_ooo_engine |
---|
109 | }; // end namespace core |
---|
110 | |
---|
111 | }; // end namespace behavioural |
---|
112 | }; // end namespace morpheo |
---|