1 | /* |
---|
2 | * $Id: Victim.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Victim/include/Victim.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace generic { |
---|
13 | namespace victim { |
---|
14 | |
---|
15 | |
---|
16 | #undef FUNCTION |
---|
17 | #define FUNCTION "Victim::Victim" |
---|
18 | Victim::Victim |
---|
19 | ( |
---|
20 | #ifdef SYSTEMC |
---|
21 | sc_module_name name, |
---|
22 | #else |
---|
23 | string name, |
---|
24 | #endif |
---|
25 | #ifdef STATISTICS |
---|
26 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
27 | #endif |
---|
28 | morpheo::behavioural::generic::victim::Parameters * param, |
---|
29 | morpheo::behavioural::Tusage_t usage |
---|
30 | ): |
---|
31 | _name (name) |
---|
32 | ,_param (param) |
---|
33 | ,_usage (usage) |
---|
34 | { |
---|
35 | log_printf(FUNC,Victim,FUNCTION,"Begin"); |
---|
36 | |
---|
37 | log_printf(INFO,Victim,FUNCTION,"Allocation"); |
---|
38 | |
---|
39 | allocation ( |
---|
40 | #ifdef STATISTICS |
---|
41 | param_statistics |
---|
42 | #endif |
---|
43 | ); |
---|
44 | |
---|
45 | #ifdef STATISTICS |
---|
46 | switch (_param->_victim_scheme) |
---|
47 | { |
---|
48 | // case VICTIM_RANDOM : _stat = _component_victim_random ->_stat; break; |
---|
49 | // case VICTIM_ROUND_ROBIN : _stat = _component_victim_round_robin ->_stat; break; |
---|
50 | // case VICTIM_NLU : _stat = _component_victim_nlu ->_stat; break; |
---|
51 | case VICTIM_PSEUDO_LRU : _stat = _component_victim_pseudo_lru ->_stat; break; |
---|
52 | // case VICTIM_LRU : _stat = _component_victim_lru ->_stat; break; |
---|
53 | // case VICTIM_FIFO : _stat = _component_victim_fifo ->_stat; break; |
---|
54 | default : break; |
---|
55 | } |
---|
56 | #endif |
---|
57 | |
---|
58 | log_printf(FUNC,Victim,FUNCTION,"End"); |
---|
59 | }; |
---|
60 | |
---|
61 | #undef FUNCTION |
---|
62 | #define FUNCTION "Victim::~Victim" |
---|
63 | Victim::~Victim (void) |
---|
64 | { |
---|
65 | log_printf(FUNC,Victim,FUNCTION,"Begin"); |
---|
66 | |
---|
67 | log_printf(INFO,Victim,FUNCTION,"Deallocation"); |
---|
68 | deallocation (); |
---|
69 | |
---|
70 | log_printf(FUNC,Victim,FUNCTION,"End"); |
---|
71 | }; |
---|
72 | |
---|
73 | }; // end namespace victim |
---|
74 | }; // end namespace generic |
---|
75 | |
---|
76 | }; // end namespace behavioural |
---|
77 | }; // end namespace morpheo |
---|