[112] | 1 | /* |
---|
| 2 | * $Id: Comparator_allocation.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Generic/Comparator/include/Comparator.h" |
---|
| 9 | #include "Behavioural/include/Allocation.h" |
---|
| 10 | #include "Common/include/Max.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace generic { |
---|
| 15 | namespace comparator { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Comparator::allocation" |
---|
| 21 | void Comparator::allocation ( |
---|
| 22 | #ifdef STATISTICS |
---|
| 23 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 24 | #else |
---|
| 25 | void |
---|
| 26 | #endif |
---|
| 27 | ) |
---|
| 28 | { |
---|
| 29 | log_begin(Comparator,FUNCTION); |
---|
| 30 | |
---|
| 31 | _component = new Component (_usage); |
---|
| 32 | |
---|
| 33 | Entity * entity = _component->set_entity (_name |
---|
| 34 | ,"Comparator" |
---|
| 35 | #ifdef POSITION |
---|
| 36 | ,COMBINATORY |
---|
| 37 | #endif |
---|
| 38 | ); |
---|
| 39 | |
---|
| 40 | _interfaces = entity->set_interfaces(); |
---|
| 41 | |
---|
| 42 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 43 | { |
---|
| 44 | Interface * interface = _interfaces->set_interface("" |
---|
| 45 | #ifdef POSITION |
---|
| 46 | ,IN |
---|
| 47 | ,SOUTH, |
---|
| 48 | _("Generalist interface") |
---|
| 49 | #endif |
---|
| 50 | ); |
---|
| 51 | |
---|
| 52 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
| 53 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
| 54 | } |
---|
[113] | 55 | |
---|
| 56 | // ~~~~~[ Interface : "compare" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 57 | { |
---|
| 58 | ALLOC0_INTERFACE_BEGIN("compare",IN,SOUTH,_("Compare interface")); |
---|
| 59 | |
---|
| 60 | ALLOC0_SIGNAL_IN ( in_COMPARE_DATA_0,"DATA_0",Tdata_t ,_param->_size_data); |
---|
| 61 | ALLOC0_SIGNAL_IN ( in_COMPARE_DATA_1,"DATA_1",Tdata_t ,_param->_size_data); |
---|
| 62 | ALLOC0_SIGNAL_OUT(out_COMPARE_TEST ,"TEST" ,Tcontrol_t,1); |
---|
| 63 | |
---|
| 64 | ALLOC0_INTERFACE_END(); |
---|
| 65 | } |
---|
| 66 | |
---|
[112] | 67 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 68 | |
---|
| 69 | #ifdef POSITION |
---|
| 70 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 71 | _component->generate_file(); |
---|
| 72 | #endif |
---|
| 73 | |
---|
| 74 | log_end(Comparator,FUNCTION); |
---|
| 75 | }; |
---|
| 76 | |
---|
| 77 | }; // end namespace comparator |
---|
| 78 | }; // end namespace generic |
---|
| 79 | |
---|
| 80 | }; // end namespace behavioural |
---|
| 81 | }; // end namespace morpheo |
---|