[10] | 1 | /* |
---|
| 2 | * $Id: Select_Priority_Fixed_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[15] | 8 | #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h" |
---|
[112] | 9 | #include "Behavioural/include/Allocation.h" |
---|
[10] | 10 | |
---|
[31] | 11 | namespace morpheo{ |
---|
[10] | 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace select { |
---|
[15] | 15 | namespace select_priority_fixed { |
---|
[10] | 16 | |
---|
[15] | 17 | void Select_Priority_Fixed::allocation (void) |
---|
[10] | 18 | { |
---|
[15] | 19 | log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin"); |
---|
[10] | 20 | |
---|
[57] | 21 | _component = new Component (_usage); |
---|
[42] | 22 | |
---|
| 23 | Entity * entity = _component->set_entity (_name |
---|
[57] | 24 | ,"Select_Priority_Fixed" |
---|
[31] | 25 | #ifdef POSITION |
---|
[42] | 26 | ,COMBINATORY |
---|
| 27 | #endif |
---|
| 28 | ); |
---|
[41] | 29 | |
---|
[31] | 30 | _interfaces = entity->set_interfaces(); |
---|
| 31 | |
---|
[88] | 32 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[29] | 33 | |
---|
[42] | 34 | Interface_fifo * interface = _interfaces->set_interface("" |
---|
| 35 | #ifdef POSITION |
---|
| 36 | ,IN |
---|
| 37 | ,WEST |
---|
[112] | 38 | ,_("Generalist interface") |
---|
[42] | 39 | #endif |
---|
| 40 | ); |
---|
[31] | 41 | |
---|
[42] | 42 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_NO); |
---|
[57] | 43 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_NO); |
---|
[112] | 44 | |
---|
| 45 | { |
---|
| 46 | ALLOC1_INTERFACE_BEGIN("",IN,SOUTH,_("select interface"),_param->_nb_entity); |
---|
[10] | 47 | |
---|
[112] | 48 | ALLOC1_SIGNAL_IN ( in_VAL ,"val" ,Tcontrol_t,1); |
---|
| 49 | if (_param->_encoding_one_hot) |
---|
| 50 | ALLOC1_SIGNAL_OUT(out_ACK ,"ack" ,Tcontrol_t,1); |
---|
[57] | 51 | |
---|
[112] | 52 | ALLOC1_INTERFACE_END(_param->_nb_entity); |
---|
| 53 | } |
---|
[10] | 54 | |
---|
[112] | 55 | if (_param->_encoding_compact) |
---|
| 56 | { |
---|
| 57 | ALLOC0_INTERFACE_BEGIN("",OUT,SOUTH,_("select interface")); |
---|
[29] | 58 | |
---|
[112] | 59 | ALLOC0_SIGNAL_OUT(out_ENTITY ,"entity" ,Tentity_t ,_param->_size_entity); |
---|
| 60 | ALLOC0_SIGNAL_OUT(out_ENTITY_ACK,"entity_ack",Tcontrol_t,1); |
---|
[10] | 61 | |
---|
[112] | 62 | ALLOC0_INTERFACE_END(); |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 66 | |
---|
[31] | 67 | #ifdef POSITION |
---|
[88] | 68 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 69 | _component->generate_file(); |
---|
[31] | 70 | #endif |
---|
| 71 | |
---|
[15] | 72 | log_printf(FUNC,Select_Priority_Fixed,"allocation","End"); |
---|
[10] | 73 | }; |
---|
| 74 | |
---|
[15] | 75 | }; // end namespace select_priority_fixed |
---|
[10] | 76 | }; // end namespace select |
---|
| 77 | }; // end namespace generic |
---|
| 78 | }; // end namespace behavioural |
---|
| 79 | }; // end namespace morpheo |
---|