[2] | 1 | /* |
---|
| 2 | * $Id: Counter_allocation.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
| 3 | * |
---|
[88] | 4 | * [ Description ] |
---|
[2] | 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Generic/Counter/include/Counter.h" |
---|
[112] | 9 | #include "Behavioural/include/Allocation.h" |
---|
[2] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace counter { |
---|
| 15 | |
---|
| 16 | void Counter::allocation (void) |
---|
| 17 | { |
---|
| 18 | log_printf(FUNC,Counter,"allocation","Begin"); |
---|
| 19 | |
---|
[82] | 20 | _component = new Component (_usage); |
---|
[42] | 21 | |
---|
| 22 | Entity * entity = _component->set_entity (_name |
---|
[113] | 23 | ,_param->_type |
---|
[42] | 24 | #ifdef POSITION |
---|
| 25 | ,COMBINATORY |
---|
[2] | 26 | #endif |
---|
[42] | 27 | ); |
---|
[2] | 28 | |
---|
[42] | 29 | _interfaces = entity->set_interfaces(); |
---|
[2] | 30 | |
---|
[88] | 31 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[42] | 32 | { |
---|
| 33 | Interface * interface = _interfaces->set_interface("" |
---|
| 34 | #ifdef POSITION |
---|
| 35 | , IN |
---|
| 36 | , SOUTH |
---|
[112] | 37 | , _("Generalist interface") |
---|
[42] | 38 | #endif |
---|
| 39 | ); |
---|
| 40 | |
---|
| 41 | in_CLOCK = interface->set_signal_clk ("clock" ,1,CLOCK_VHDL_NO); |
---|
| 42 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_NO); |
---|
| 43 | } |
---|
[2] | 44 | |
---|
[88] | 45 | // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[112] | 46 | { |
---|
[113] | 47 | ALLOC1_INTERFACE_BEGIN("counter", IN, SOUTH, _("Counter interface"), _param->_nb_port); |
---|
[42] | 48 | |
---|
[113] | 49 | ALLOC1_SIGNAL_IN ( in_COUNTER_DATA ,"data" ,Tdata_t ,_param->_size_data); |
---|
[112] | 50 | ALLOC1_SIGNAL_IN ( in_COUNTER_ADDSUB,"addsub",Tcontrol_t,1 ); |
---|
[113] | 51 | ALLOC1_SIGNAL_OUT(out_COUNTER_DATA ,"data" ,Tdata_t ,_param->_size_data); |
---|
[88] | 52 | |
---|
[113] | 53 | ALLOC1_INTERFACE_END(_param->_nb_port); |
---|
[112] | 54 | } |
---|
| 55 | |
---|
[42] | 56 | #ifdef POSITION |
---|
[88] | 57 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 58 | _component->generate_file(); |
---|
[42] | 59 | #endif |
---|
[2] | 60 | |
---|
[88] | 61 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[2] | 62 | log_printf(FUNC,Counter,"allocation","End"); |
---|
| 63 | }; |
---|
| 64 | |
---|
| 65 | }; // end namespace counter |
---|
| 66 | }; // end namespace generic |
---|
| 67 | |
---|
| 68 | }; // end namespace behavioural |
---|
| 69 | }; // end namespace morpheo |
---|