1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id$ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace generic { |
---|
14 | namespace victim { |
---|
15 | namespace victim_pseudo_lru { |
---|
16 | |
---|
17 | void Victim_Pseudo_LRU::allocation (void) |
---|
18 | { |
---|
19 | in_CLOCK = new SC_CLOCK ("in_CLOCK"); |
---|
20 | in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); |
---|
21 | |
---|
22 | // -----[ Interface access ]------------------------------------------- |
---|
23 | in_ACCESS_VAL = new SC_IN (Tcontrol_t) * [_param._nb_access]; |
---|
24 | out_ACCESS_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_access]; |
---|
25 | if (_param._size_table>1) |
---|
26 | in_ACCESS_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_access]; |
---|
27 | out_ACCESS_ENTITY = new SC_OUT(Tentity_t ) * [_param._nb_access]; |
---|
28 | |
---|
29 | for (uint32_t i=0; i<_param._nb_access; i++) |
---|
30 | { |
---|
31 | string rename; |
---|
32 | |
---|
33 | rename = "in_ACCESS_VAL[" + toString(i) + "]"; |
---|
34 | in_ACCESS_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
35 | |
---|
36 | rename = "out_ACCESS_ACK[" + toString(i) + "]"; |
---|
37 | out_ACCESS_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
38 | |
---|
39 | if (_param._size_table>1) |
---|
40 | { |
---|
41 | rename = "in_ACCESS_ADDRESS[" + toString(i) + "]"; |
---|
42 | in_ACCESS_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
43 | } |
---|
44 | rename = "out_ACCESS_ENTITY[" + toString(i) + "]"; |
---|
45 | out_ACCESS_ENTITY [i] = new SC_OUT(Tentity_t ) (rename.c_str()); |
---|
46 | } |
---|
47 | |
---|
48 | // -----[ Interface update ]------------------------------------------- |
---|
49 | in_UPDATE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_update]; |
---|
50 | out_UPDATE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_update]; |
---|
51 | if (_param._size_table>1) |
---|
52 | in_UPDATE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_update]; |
---|
53 | in_UPDATE_ENTITY = new SC_IN (Tentity_t ) * [_param._nb_update]; |
---|
54 | |
---|
55 | for (uint32_t i=0; i<_param._nb_update; i++) |
---|
56 | { |
---|
57 | string rename; |
---|
58 | |
---|
59 | rename = "in_UPDATE_VAL[" + toString(i) + "]"; |
---|
60 | in_UPDATE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
61 | |
---|
62 | rename = "out_UPDATE_ACK[" + toString(i) + "]";; |
---|
63 | out_UPDATE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
64 | |
---|
65 | if (_param._size_table>1) |
---|
66 | { |
---|
67 | rename = "in_UPDATE_ADDRESS[" + toString(i) + "]"; |
---|
68 | in_UPDATE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
69 | } |
---|
70 | |
---|
71 | rename = "in_UPDATE_ENTITY[" + toString(i) + "]"; |
---|
72 | in_UPDATE_ENTITY [i] = new SC_IN (Tentity_t ) (rename.c_str()); |
---|
73 | } |
---|
74 | |
---|
75 | // -----[ Register ]--------------------------------------------------- |
---|
76 | reg_TABLE = new entry_t * [_param._size_table]; |
---|
77 | |
---|
78 | for (uint32_t i=0; i<_param._size_table; i++) |
---|
79 | reg_TABLE [i] = new entry_t (_param._nb_entity); |
---|
80 | |
---|
81 | // -----[ Internal ]--------------------------------------------------- |
---|
82 | internal_ACCESS_ENTITY = new Tentity_t [_param._nb_entity]; |
---|
83 | }; |
---|
84 | |
---|
85 | }; // end namespace victim_pseudo_lru |
---|
86 | }; // end namespace victim |
---|
87 | }; // end namespace generic |
---|
88 | |
---|
89 | }; // end namespace behavioural |
---|
90 | }; // end namespace morpheo |
---|
91 | #endif |
---|