1 | /* |
---|
2 | * $Id: Victim_deallocation.cpp 131 2009-07-08 18:40:08Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Victim/include/Victim.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace generic { |
---|
14 | namespace victim { |
---|
15 | |
---|
16 | |
---|
17 | #undef FUNCTION |
---|
18 | #define FUNCTION "Victim::deallocation" |
---|
19 | void Victim::deallocation (void) |
---|
20 | { |
---|
21 | log_printf(FUNC,Victim,FUNCTION,"Begin"); |
---|
22 | |
---|
23 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
24 | switch (_param->_victim_scheme) |
---|
25 | { |
---|
26 | // case VICTIM_RANDOM : delete _component_victim_random ; break; |
---|
27 | // case VICTIM_ROUND_ROBIN : delete _component_victim_round_robin; break; |
---|
28 | // case VICTIM_NLU : delete _component_victim_nlu ; break; |
---|
29 | case VICTIM_PSEUDO_LRU : delete _component_victim_pseudo_lru ; break; |
---|
30 | // case VICTIM_LRU : delete _component_victim_lru ; break; |
---|
31 | // case VICTIM_FIFO : delete _component_victim_fifo ; break; |
---|
32 | default : break; |
---|
33 | } |
---|
34 | |
---|
35 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
36 | { |
---|
37 | #ifdef SYSTEMCASS_SPECIFIC |
---|
38 | delete in_CLOCK ; |
---|
39 | delete in_NRESET; |
---|
40 | |
---|
41 | for (uint32_t i=0; i<_param->_nb_access; ++i) |
---|
42 | { |
---|
43 | delete in_ACCESS_VAL [i]; |
---|
44 | delete out_ACCESS_ACK [i]; |
---|
45 | if (_param->_have_port_address) |
---|
46 | delete in_ACCESS_ADDRESS[i]; |
---|
47 | delete in_ACCESS_HIT [i]; |
---|
48 | delete in_ACCESS_ENTITY [i]; |
---|
49 | delete out_ACCESS_VICTIM [i]; |
---|
50 | } |
---|
51 | |
---|
52 | delete [] in_ACCESS_VAL ; |
---|
53 | delete [] out_ACCESS_ACK ; |
---|
54 | if (_param->_have_port_address) |
---|
55 | delete [] in_ACCESS_ADDRESS; |
---|
56 | delete [] in_ACCESS_HIT ; |
---|
57 | delete [] in_ACCESS_ENTITY ; |
---|
58 | delete [] out_ACCESS_VICTIM ; |
---|
59 | #endif |
---|
60 | } |
---|
61 | |
---|
62 | log_printf(FUNC,Victim,FUNCTION,"End"); |
---|
63 | }; |
---|
64 | |
---|
65 | }; // end namespace victim |
---|
66 | }; // end namespace generic |
---|
67 | |
---|
68 | }; // end namespace behavioural |
---|
69 | }; // end namespace morpheo |
---|