[67] | 1 | /* |
---|
| 2 | * $Id: Queue_allocation.cpp 112 2009-03-18 22:36:26Z 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 | { |
---|
[112] | 51 | ALLOC0_INTERFACE_BEGIN("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); |
---|
[112] | 56 | |
---|
| 57 | ALLOC0_INTERFACE_END(); |
---|
[67] | 58 | } |
---|
[100] | 59 | |
---|
[67] | 60 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 61 | { |
---|
[112] | 62 | ALLOC0_INTERFACE_BEGIN("retire", OUT, EAST, _("Interface of data read.")); |
---|
[67] | 63 | |
---|
[100] | 64 | ALLOC0_VALACK_OUT(out_RETIRE_VAL ,VAL); |
---|
| 65 | ALLOC0_VALACK_IN ( in_RETIRE_ACK ,ACK); |
---|
| 66 | ALLOC0_SIGNAL_OUT(out_RETIRE_DATA ,"data",Tdata_t,_param->_size_data); |
---|
[112] | 67 | |
---|
| 68 | ALLOC0_INTERFACE_END(); |
---|
[67] | 69 | } |
---|
[100] | 70 | |
---|
| 71 | // ~~~~~[ Interface "slot" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 72 | { |
---|
[112] | 73 | ALLOC1_INTERFACE_BEGIN("slot", OUT, NORTH, _("Internal slot."),_param->_nb_port_slot); |
---|
[100] | 74 | |
---|
| 75 | ALLOC1_VALACK_OUT(out_SLOT_VAL ,VAL); |
---|
| 76 | ALLOC1_SIGNAL_OUT(out_SLOT_DATA ,"data",Tdata_t,_param->_size_data); |
---|
[112] | 77 | |
---|
| 78 | ALLOC1_INTERFACE_END(_param->_nb_port_slot); |
---|
[100] | 79 | } |
---|
[101] | 80 | |
---|
| 81 | // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 82 | if (_param->_have_port_ptr) |
---|
| 83 | { |
---|
[112] | 84 | ALLOC0_INTERFACE_BEGIN("ptr", OUT, SOUTH, _("Internal pointer.")); |
---|
[101] | 85 | |
---|
| 86 | if (_param->_have_port_ptr_write) |
---|
| 87 | ALLOC0_SIGNAL_OUT(out_PTR_WRITE ,"write",Tptr_t,_param->_size_ptr); |
---|
| 88 | if (_param->_have_port_ptr_read ) |
---|
| 89 | ALLOC0_SIGNAL_OUT(out_PTR_READ ,"read" ,Tptr_t,_param->_size_ptr); |
---|
[112] | 90 | |
---|
| 91 | ALLOC0_INTERFACE_END(); |
---|
[101] | 92 | } |
---|
[67] | 93 | |
---|
[88] | 94 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 95 | { |
---|
[67] | 96 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 97 | _queue_control = new morpheo::behavioural::generic::queue_control::Queue_Control::Queue_Control(_param->_size_queue); |
---|
| 98 | _queue_data = new Tdata_t [_param->_size_queue]; |
---|
[88] | 99 | } |
---|
[67] | 100 | |
---|
| 101 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 102 | |
---|
| 103 | #ifdef POSITION |
---|
[88] | 104 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 105 | _component->generate_file(); |
---|
[67] | 106 | #endif |
---|
| 107 | |
---|
| 108 | log_printf(FUNC,Queue,FUNCTION,"End"); |
---|
| 109 | }; |
---|
| 110 | |
---|
| 111 | }; // end namespace queue |
---|
| 112 | }; // end namespace generic |
---|
| 113 | |
---|
| 114 | }; // end namespace behavioural |
---|
| 115 | }; // end namespace morpheo |
---|