[2] | 1 | /* |
---|
| 2 | * $Id: Shifter_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Generic/Shifter/include/Shifter.h" |
---|
[112] | 9 | #include "Behavioural/include/Allocation.h" |
---|
[2] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace shifter { |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | void Shifter::allocation (void) |
---|
| 18 | { |
---|
[82] | 19 | _component = new Component (_usage); |
---|
[2] | 20 | |
---|
[42] | 21 | Entity * entity = _component->set_entity (_name |
---|
| 22 | ,"Shifter" |
---|
| 23 | #ifdef POSITION |
---|
| 24 | ,COMBINATORY |
---|
| 25 | #endif |
---|
| 26 | ); |
---|
| 27 | |
---|
| 28 | _interfaces = entity->set_interfaces(); |
---|
| 29 | |
---|
[2] | 30 | #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) |
---|
[42] | 31 | { |
---|
| 32 | Interface_fifo * interface = _interfaces->set_interface("" |
---|
| 33 | #ifdef POSITION |
---|
| 34 | , IN |
---|
| 35 | , SOUTH |
---|
[112] | 36 | , _("Generalist interface") |
---|
[2] | 37 | #endif |
---|
[42] | 38 | ); |
---|
| 39 | |
---|
| 40 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_NO); |
---|
| 41 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_NO); |
---|
| 42 | } |
---|
| 43 | #endif |
---|
[2] | 44 | |
---|
[42] | 45 | { |
---|
[112] | 46 | ALLOC1_INTERFACE_BEGIN("shifter", IN, SOUTH,_("Generalist interface"),_param->_nb_port); |
---|
| 47 | |
---|
| 48 | ALLOC1_SIGNAL_IN ( in_SHIFTER_DATA ,"data" ,Tdata_t ,_param->_size_data); |
---|
[82] | 49 | if (_param->_shift_value == 0) |
---|
[112] | 50 | ALLOC1_SIGNAL_IN ( in_SHIFTER_SHIFT ,"shift" ,Tshift_t ,_param->_size_shift); |
---|
| 51 | if (_param->_direction == external_direction) |
---|
| 52 | ALLOC1_SIGNAL_IN ( in_SHIFTER_DIRECTION ,"direction" ,Tdirection_t,1); |
---|
| 53 | if (_param->_rotate == external_rotate) |
---|
| 54 | ALLOC1_SIGNAL_IN ( in_SHIFTER_TYPE ,"type" ,Ttype_t ,1); |
---|
| 55 | if (_param->_carry == external_carry) |
---|
| 56 | ALLOC1_SIGNAL_IN ( in_SHIFTER_CARRY ,"carry" ,Tcarry_t ,1); |
---|
| 57 | if (_param->_carry == external_completion) |
---|
| 58 | { |
---|
[82] | 59 | if (_param->_type_completion_bool == true) |
---|
[112] | 60 | { |
---|
| 61 | ALLOC1_SIGNAL_IN ( in_SHIFTER_CARRY_IN ,"carry_in" ,Tcontrol_t ,1); |
---|
| 62 | } |
---|
[42] | 63 | else |
---|
[112] | 64 | { |
---|
| 65 | ALLOC1_SIGNAL_IN ( in_SHIFTER_COMPLETION ,"completion",Tdata_t ,_param->_size_data_completion); |
---|
| 66 | } |
---|
| 67 | } |
---|
| 68 | ALLOC1_SIGNAL_OUT(out_SHIFTER_DATA ,"data" ,Tdata_t ,_param->_size_data); |
---|
[42] | 69 | |
---|
[112] | 70 | ALLOC1_INTERFACE_END(_param->_nb_port); |
---|
[42] | 71 | } |
---|
[112] | 72 | |
---|
[42] | 73 | #ifdef POSITION |
---|
[88] | 74 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 75 | _component->generate_file(); |
---|
[42] | 76 | #endif |
---|
[2] | 77 | |
---|
| 78 | }; |
---|
[42] | 79 | |
---|
[2] | 80 | }; // end namespace shifter |
---|
| 81 | }; // end namespace generic |
---|
| 82 | }; // end namespace behavioural |
---|
| 83 | }; // end namespace morpheo |
---|