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