source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_allocation.cpp @ 67

Last change on this file since 67 was 67, checked in by rosiere, 17 years ago

Ajout d'un nouveau composant : fifo generic (un port lecture et un port ecriture).

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