1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Queue/include/Queue.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace generic { |
---|
13 | namespace queue { |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | #undef FUNCTION |
---|
18 | #define FUNCTION "Queue::allocation" |
---|
19 | void Queue::allocation (void) |
---|
20 | { |
---|
21 | log_printf(FUNC,Queue,FUNCTION,"Begin"); |
---|
22 | |
---|
23 | _component = new Component (_usage); |
---|
24 | |
---|
25 | Entity * entity = _component->set_entity (_name |
---|
26 | ,"Queue" |
---|
27 | #ifdef POSITION |
---|
28 | ,COMBINATORY |
---|
29 | #endif |
---|
30 | ); |
---|
31 | |
---|
32 | _interfaces = entity->set_interfaces(); |
---|
33 | |
---|
34 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
35 | { |
---|
36 | Interface * interface = _interfaces->set_interface("" |
---|
37 | #ifdef POSITION |
---|
38 | ,IN |
---|
39 | ,SOUTH, |
---|
40 | "Generalist interface" |
---|
41 | #endif |
---|
42 | ); |
---|
43 | |
---|
44 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
45 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
46 | } |
---|
47 | |
---|
48 | // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
49 | { |
---|
50 | Interface_fifo * interface = _interfaces->set_interface("insert" |
---|
51 | #ifdef POSITION |
---|
52 | ,IN |
---|
53 | ,WEST |
---|
54 | ,"Insertion of data" |
---|
55 | #endif |
---|
56 | ); |
---|
57 | |
---|
58 | in_INSERT_VAL = interface->set_signal_valack_in (VAL); |
---|
59 | out_INSERT_ACK = interface->set_signal_valack_out(ACK); |
---|
60 | in_INSERT_DATA = interface->set_signal_in <Tdata_t> ("data", _param->_size_data); |
---|
61 | } |
---|
62 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
63 | { |
---|
64 | Interface_fifo * interface = _interfaces->set_interface("retire" |
---|
65 | #ifdef POSITION |
---|
66 | ,IN |
---|
67 | ,EAST |
---|
68 | ,"Retire of data" |
---|
69 | #endif |
---|
70 | ); |
---|
71 | |
---|
72 | out_RETIRE_VAL = interface->set_signal_valack_out(VAL); |
---|
73 | in_RETIRE_ACK = interface->set_signal_valack_in (ACK); |
---|
74 | out_RETIRE_DATA = interface->set_signal_out <Tdata_t> ("data", _param->_size_data); |
---|
75 | } |
---|
76 | |
---|
77 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
78 | _queue_control = new morpheo::behavioural::generic::queue_control::Queue_Control::Queue_Control(_param->_size_queue); |
---|
79 | _queue_data = new Tdata_t [_param->_size_queue]; |
---|
80 | |
---|
81 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
82 | |
---|
83 | #ifdef POSITION |
---|
84 | _component->generate_file(); |
---|
85 | #endif |
---|
86 | |
---|
87 | log_printf(FUNC,Queue,FUNCTION,"End"); |
---|
88 | }; |
---|
89 | |
---|
90 | }; // end namespace queue |
---|
91 | }; // end namespace generic |
---|
92 | |
---|
93 | }; // end namespace behavioural |
---|
94 | }; // end namespace morpheo |
---|