[10] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
[15] | 9 | #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.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 | |
---|
[29] | 32 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 33 | |
---|
[42] | 34 | Interface_fifo * interface = _interfaces->set_interface("" |
---|
| 35 | #ifdef POSITION |
---|
| 36 | ,IN |
---|
| 37 | ,WEST |
---|
| 38 | ,"Generalist interface" |
---|
| 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); |
---|
[10] | 44 | |
---|
[57] | 45 | in_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_entity]; |
---|
| 46 | if (_param->_encoding_one_hot) |
---|
| 47 | out_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_entity]; |
---|
| 48 | |
---|
| 49 | for (uint32_t i=0; i<_param->_nb_entity; i++) |
---|
[10] | 50 | { |
---|
[42] | 51 | in_VAL [i] = interface->set_signal_in <Tcontrol_t> ("val_"+toString(i),1); |
---|
[57] | 52 | if (_param->_encoding_one_hot) |
---|
[42] | 53 | out_ACK [i] = interface->set_signal_out <Tcontrol_t> ("ack_"+toString(i),1); |
---|
[10] | 54 | } |
---|
| 55 | |
---|
[57] | 56 | if (_param->_encoding_compact) |
---|
[10] | 57 | { |
---|
[57] | 58 | out_ENTITY = interface->set_signal_out <Tentity_t > ("entity" , _param->_size_entity); |
---|
[42] | 59 | out_ENTITY_ACK = interface->set_signal_out <Tcontrol_t> ("entity_ack", 1); |
---|
[10] | 60 | } |
---|
[29] | 61 | |
---|
[10] | 62 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 63 | |
---|
[31] | 64 | #ifdef POSITION |
---|
[42] | 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 |
---|
| 76 | #endif |
---|