[10] | 1 | /* |
---|
| 2 | * $Id: Victim_Pseudo_LRU_allocation.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[15] | 8 | #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h" |
---|
[78] | 9 | #include "Behavioural/include/Allocation.h" |
---|
[10] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace victim { |
---|
[15] | 15 | namespace victim_pseudo_lru { |
---|
[10] | 16 | |
---|
[15] | 17 | void Victim_Pseudo_LRU::allocation (void) |
---|
[10] | 18 | { |
---|
[82] | 19 | _component = new Component (_usage); |
---|
[10] | 20 | |
---|
[75] | 21 | Entity * entity = _component->set_entity (_name |
---|
| 22 | ,"Select_Priority_Fixed" |
---|
| 23 | #ifdef POSITION |
---|
| 24 | ,COMBINATORY |
---|
| 25 | #endif |
---|
| 26 | ); |
---|
[10] | 27 | |
---|
[42] | 28 | _interfaces = entity->set_interfaces(); |
---|
[10] | 29 | |
---|
[42] | 30 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 31 | { |
---|
[75] | 32 | Interface_fifo * interface = _interfaces->set_interface("" |
---|
| 33 | #ifdef POSITION |
---|
| 34 | , IN ,WEST, "Generalist interface" |
---|
| 35 | #endif |
---|
| 36 | ); |
---|
[42] | 37 | |
---|
| 38 | in_CLOCK = interface->set_signal_clk ("clock" ,1); |
---|
| 39 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1); |
---|
| 40 | } |
---|
[10] | 41 | |
---|
[42] | 42 | // ~~~~~[ Interface : "access" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 43 | { |
---|
[78] | 44 | ALLOC1_INTERFACE("access",IN,WEST, "Access", _param->_nb_access); |
---|
[10] | 45 | |
---|
[78] | 46 | ALLOC1_VALACK_IN ( in_ACCESS_VAL ,VAL); |
---|
| 47 | ALLOC1_VALACK_OUT(out_ACCESS_ACK ,ACK); |
---|
| 48 | ALLOC1_SIGNAL_IN ( in_ACCESS_HIT ,"hit" ,Tcontrol_t,1); |
---|
| 49 | ALLOC1_SIGNAL_IN ( in_ACCESS_ADDRESS,"address",Taddress_t,log2(_param->_size_address)); |
---|
| 50 | ALLOC1_SIGNAL_IN ( in_ACCESS_ENTITY ,"entity" ,Tentity_t ,log2(_param->_nb_entity )); |
---|
| 51 | ALLOC1_SIGNAL_OUT(out_ACCESS_VICTIM ,"victim" ,Tentity_t ,log2(_param->_nb_entity )); |
---|
[42] | 52 | } |
---|
[10] | 53 | |
---|
[88] | 54 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 55 | { |
---|
[10] | 56 | // -----[ Register ]--------------------------------------------------- |
---|
[78] | 57 | reg_TABLE = new entry_t * [_param->_size_table]; |
---|
[10] | 58 | |
---|
[78] | 59 | for (uint32_t i=0; i<_param->_size_table; i++) |
---|
| 60 | reg_TABLE [i] = new entry_t (_param->_nb_entity); |
---|
[10] | 61 | |
---|
| 62 | // -----[ Internal ]--------------------------------------------------- |
---|
[78] | 63 | internal_ACCESS_ACK = new Tcontrol_t [_param->_nb_access]; |
---|
| 64 | internal_ACCESS_VICTIM = new Tentity_t [_param->_nb_access]; |
---|
[88] | 65 | } |
---|
[42] | 66 | |
---|
| 67 | #ifdef POSITION |
---|
[88] | 68 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 69 | _component->generate_file(); |
---|
[42] | 70 | #endif |
---|
[10] | 71 | }; |
---|
| 72 | |
---|
[15] | 73 | }; // end namespace victim_pseudo_lru |
---|
[10] | 74 | }; // end namespace victim |
---|
| 75 | }; // end namespace generic |
---|
| 76 | |
---|
| 77 | }; // end namespace behavioural |
---|
| 78 | }; // end namespace morpheo |
---|