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

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

1) Bug fix (Operation, Instruction)
2) Modif Return Address Stack
3) Add Soft Test
4) Add Soc Test

  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1/*
2 * $Id: Queue_allocation.cpp 100 2009-01-08 13:06:27Z 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    if (usage_is_set(_usage,USE_SYSTEMC))
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
82    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
83
84#ifdef POSITION
85    if (usage_is_set(_usage,USE_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.