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

Last change on this file since 101 was 101, checked in by rosiere, 15 years ago

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1/*
2 * $Id: Queue_allocation.cpp 101 2009-01-15 17:19:08Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Queue/include/Queue.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace 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
24    _component   = new Component (_usage);
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,
41                                                         _("Generalist interface")
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    {
51      ALLOC0_INTERFACE("insert", IN, WEST, _("Interface of data write."));
52     
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);
56    }
57
58    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59    {
60      ALLOC0_INTERFACE("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
67    // ~~~~~[ Interface "slot" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68    {
69      ALLOC1_INTERFACE("slot", OUT, EAST, _("Internal slot."),_param->_nb_port_slot);
70     
71      ALLOC1_VALACK_OUT(out_SLOT_VAL  ,VAL);
72      ALLOC1_SIGNAL_OUT(out_SLOT_DATA ,"data",Tdata_t,_param->_size_data);
73    }
74
75    // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76    if (_param->_have_port_ptr)
77    {
78      ALLOC0_INTERFACE("ptr", OUT, EAST, _("Internal pointer."));
79     
80      if (_param->_have_port_ptr_write)
81      ALLOC0_SIGNAL_OUT(out_PTR_WRITE ,"write",Tptr_t,_param->_size_ptr);
82      if (_param->_have_port_ptr_read )
83      ALLOC0_SIGNAL_OUT(out_PTR_READ  ,"read" ,Tptr_t,_param->_size_ptr);
84    }
85     
86    if (usage_is_set(_usage,USE_SYSTEMC))
87      {
88    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
89    _queue_control = new morpheo::behavioural::generic::queue_control::Queue_Control::Queue_Control(_param->_size_queue);
90    _queue_data    = new Tdata_t [_param->_size_queue];
91      }
92
93    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
94
95#ifdef POSITION
96    if (usage_is_set(_usage,USE_POSITION))
97      _component->generate_file();
98#endif
99
100    log_printf(FUNC,Queue,FUNCTION,"End");
101  };
102
103}; // end namespace queue
104}; // end namespace generic
105
106}; // end namespace behavioural
107}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.