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