[78] | 1 | /* |
---|
| 2 | * $Id: Sort_allocation.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Generic/Sort/include/Sort.h" |
---|
| 9 | #include "Behavioural/include/Allocation.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace sort { |
---|
| 15 | |
---|
| 16 | #undef FUNCTION |
---|
| 17 | #define FUNCTION "Sort::allocation" |
---|
| 18 | void Sort::allocation ( |
---|
| 19 | #ifdef STATISTICS |
---|
| 20 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 21 | #else |
---|
| 22 | void |
---|
| 23 | #endif |
---|
| 24 | ) |
---|
| 25 | { |
---|
| 26 | log_printf(FUNC,Sort,FUNCTION,"Begin"); |
---|
| 27 | |
---|
| 28 | _component = new Component (_usage); |
---|
| 29 | |
---|
| 30 | Entity * entity = _component->set_entity (_name |
---|
| 31 | ,"Sort" |
---|
| 32 | #ifdef POSITION |
---|
| 33 | ,COMBINATORY |
---|
| 34 | #endif |
---|
| 35 | ); |
---|
| 36 | |
---|
| 37 | _interfaces = entity->set_interfaces(); |
---|
| 38 | |
---|
| 39 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 40 | { |
---|
| 41 | Interface * interface = _interfaces->set_interface("" |
---|
| 42 | #ifdef POSITION |
---|
| 43 | ,IN |
---|
| 44 | ,SOUTH, |
---|
| 45 | "Generalist interface" |
---|
| 46 | #endif |
---|
| 47 | ); |
---|
| 48 | |
---|
| 49 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
| 50 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | // ~~~~~[ Interface : "input" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 54 | { |
---|
| 55 | ALLOC1_INTERFACE("input", IN, WEST, "List of data unsort",_param->_nb_input); |
---|
| 56 | |
---|
| 57 | ALLOC1_SIGNAL_IN(in_INPUT_VAL ,"val" , Tcontrol_t, 1); |
---|
| 58 | ALLOC1_SIGNAL_IN(in_INPUT_DATA,"data", Tdata_t , _param->_size_data); |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | // ~~~~~[ Interface : "output" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 62 | { |
---|
| 63 | ALLOC1_INTERFACE("output",OUT, EAST, "List of data sort",_param->_nb_output); |
---|
| 64 | |
---|
| 65 | ALLOC1_SIGNAL_OUT(out_OUTPUT_VAL ,"val" ,Tcontrol_t,1); |
---|
| 66 | if (_param->_have_port_index_out) |
---|
| 67 | ALLOC1_SIGNAL_OUT(out_OUTPUT_INDEX,"index",Taddress_t,_param->_size_address); |
---|
| 68 | if (_param->_have_port_data_out) |
---|
| 69 | ALLOC1_SIGNAL_OUT(out_OUTPUT_DATA ,"data" ,Tdata_t ,_param->_size_data ); |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | |
---|
| 74 | #ifdef POSITION |
---|
[88] | 75 | if (usage_is_set(_usage,USE_POSTION)) |
---|
| 76 | _component->generate_file(); |
---|
[78] | 77 | #endif |
---|
| 78 | |
---|
| 79 | log_printf(FUNC,Sort,FUNCTION,"End"); |
---|
| 80 | }; |
---|
| 81 | |
---|
| 82 | }; // end namespace sort |
---|
| 83 | }; // end namespace generic |
---|
| 84 | |
---|
| 85 | }; // end namespace behavioural |
---|
| 86 | }; // end namespace morpheo |
---|