[67] | 1 | /* |
---|
| 2 | * $Id: Queue_allocation.cpp 109 2009-02-16 20:28:31Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Generic/Queue/include/Queue.h" |
---|
[100] | 9 | #include "Behavioural/include/Allocation.h" |
---|
[67] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace queue { |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Queue::allocation" |
---|
| 20 | void Queue::allocation (void) |
---|
| 21 | { |
---|
| 22 | log_printf(FUNC,Queue,FUNCTION,"Begin"); |
---|
| 23 | |
---|
[68] | 24 | _component = new Component (_usage); |
---|
[67] | 25 | |
---|
| 26 | Entity * entity = _component->set_entity (_name |
---|
| 27 | ,"Queue" |
---|
| 28 | #ifdef POSITION |
---|
| 29 | ,COMBINATORY |
---|
| 30 | #endif |
---|
| 31 | ); |
---|
| 32 | |
---|
| 33 | _interfaces = entity->set_interfaces(); |
---|
| 34 | |
---|
| 35 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 36 | { |
---|
| 37 | Interface * interface = _interfaces->set_interface("" |
---|
| 38 | #ifdef POSITION |
---|
| 39 | ,IN |
---|
| 40 | ,SOUTH, |
---|
[100] | 41 | _("Generalist interface") |
---|
[67] | 42 | #endif |
---|
| 43 | ); |
---|
| 44 | |
---|
| 45 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
| 46 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 50 | { |
---|
[100] | 51 | ALLOC0_INTERFACE("insert", IN, WEST, _("Interface of data write.")); |
---|
[67] | 52 | |
---|
[100] | 53 | ALLOC0_VALACK_IN ( in_INSERT_VAL ,VAL); |
---|
| 54 | ALLOC0_VALACK_OUT(out_INSERT_ACK ,ACK); |
---|
| 55 | ALLOC0_SIGNAL_IN ( in_INSERT_DATA ,"data",Tdata_t,_param->_size_data); |
---|
[67] | 56 | } |
---|
[100] | 57 | |
---|
[67] | 58 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 59 | { |
---|
[100] | 60 | ALLOC0_INTERFACE("retire", OUT, EAST, _("Interface of data read.")); |
---|
[67] | 61 | |
---|
[100] | 62 | ALLOC0_VALACK_OUT(out_RETIRE_VAL ,VAL); |
---|
| 63 | ALLOC0_VALACK_IN ( in_RETIRE_ACK ,ACK); |
---|
| 64 | ALLOC0_SIGNAL_OUT(out_RETIRE_DATA ,"data",Tdata_t,_param->_size_data); |
---|
[67] | 65 | } |
---|
[100] | 66 | |
---|
| 67 | // ~~~~~[ Interface "slot" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 68 | { |
---|
[109] | 69 | ALLOC1_INTERFACE("slot", OUT, NORTH, _("Internal slot."),_param->_nb_port_slot); |
---|
[100] | 70 | |
---|
| 71 | ALLOC1_VALACK_OUT(out_SLOT_VAL ,VAL); |
---|
| 72 | ALLOC1_SIGNAL_OUT(out_SLOT_DATA ,"data",Tdata_t,_param->_size_data); |
---|
| 73 | } |
---|
[101] | 74 | |
---|
| 75 | // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 76 | if (_param->_have_port_ptr) |
---|
| 77 | { |
---|
[109] | 78 | ALLOC0_INTERFACE("ptr", OUT, SOUTH, _("Internal pointer.")); |
---|
[101] | 79 | |
---|
| 80 | if (_param->_have_port_ptr_write) |
---|
| 81 | ALLOC0_SIGNAL_OUT(out_PTR_WRITE ,"write",Tptr_t,_param->_size_ptr); |
---|
| 82 | if (_param->_have_port_ptr_read ) |
---|
| 83 | ALLOC0_SIGNAL_OUT(out_PTR_READ ,"read" ,Tptr_t,_param->_size_ptr); |
---|
| 84 | } |
---|
[67] | 85 | |
---|
[88] | 86 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 87 | { |
---|
[67] | 88 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 89 | _queue_control = new morpheo::behavioural::generic::queue_control::Queue_Control::Queue_Control(_param->_size_queue); |
---|
| 90 | _queue_data = new Tdata_t [_param->_size_queue]; |
---|
[88] | 91 | } |
---|
[67] | 92 | |
---|
| 93 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 94 | |
---|
| 95 | #ifdef POSITION |
---|
[88] | 96 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 97 | _component->generate_file(); |
---|
[67] | 98 | #endif |
---|
| 99 | |
---|
| 100 | log_printf(FUNC,Queue,FUNCTION,"End"); |
---|
| 101 | }; |
---|
| 102 | |
---|
| 103 | }; // end namespace queue |
---|
| 104 | }; // end namespace generic |
---|
| 105 | |
---|
| 106 | }; // end namespace behavioural |
---|
| 107 | }; // end namespace morpheo |
---|