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