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