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

Last change on this file since 88 was 88, checked in by rosiere, 16 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/*
2 * $Id: Queue_allocation.cpp 88 2008-12-10 18:31:39Z rosiere $
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    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    if (usage_is_set(_usage,USE_SYSTEMC))
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
84    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
85
86#ifdef POSITION
87    if (usage_is_set(_usage,USE_POSITION))
88      _component->generate_file();
89#endif
90
91    log_printf(FUNC,Queue,FUNCTION,"End");
92  };
93
94}; // end namespace queue
95}; // end namespace generic
96
97}; // end namespace behavioural
98}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.