source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Read_unit_to_Execution_unit_allocation.cpp @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 9.9 KB
Line 
1/*
2 * $Id: Read_unit_to_Execution_unit_allocation.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Read_unit_to_Execution_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace network {
17namespace read_unit_to_execution_unit {
18
19
20
21#undef  FUNCTION
22#define FUNCTION "Read_unit_to_Execution_unit::allocation"
23  void Read_unit_to_Execution_unit::allocation (
24#ifdef STATISTICS
25                               morpheo::behavioural::Parameters_Statistics * param_statistics
26#else
27                               void
28#endif
29                               )
30  {
31    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
32
33    _component   = new Component (_usage);
34
35    Entity * entity = _component->set_entity (_name       
36                                              ,"Read_unit_to_Execution_unit"
37#ifdef POSITION
38                                              ,COMBINATORY
39#endif
40                                              );
41
42    _interfaces = entity->set_interfaces();
43
44    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
46      Interface * interface = _interfaces->set_interface(""
47#ifdef POSITION
48                                                         ,IN
49                                                         ,SOUTH,
50                                                         "Generalist interface"
51#endif
52                                                         );
53
54     in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
55     in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
56
57    // ~~~~~[ Interface "read_unit_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58     {
59       ALLOC2_INTERFACE("read_unit_out", IN, EAST, "Output of read_unit",_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
60
61       _ALLOC2_VALACK_IN ( in_READ_UNIT_OUT_VAL,VAL,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
62       _ALLOC2_VALACK_OUT(out_READ_UNIT_OUT_ACK,ACK,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
63       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_CONTEXT_ID           ,"CONTEXT_ID"           ,Tcontext_t        ,_param->_size_context_id       ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
64       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_FRONT_END_ID         ,"FRONT_END_ID"         ,Tcontext_t        ,_param->_size_front_end_id     ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
65       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_OOO_ENGINE_ID        ,"OOO_ENGINE_ID"        ,Tcontext_t        ,_param->_size_ooo_engine_id    ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
66       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_PACKET_ID            ,"PACKET_ID"            ,Tpacket_t         ,_param->_size_rob_ptr          ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
67       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_OPERATION            ,"OPERATION"            ,Toperation_t      ,_param->_size_operation        ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
68       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_TYPE                 ,"TYPE"                 ,Ttype_t           ,_param->_size_type             ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
69       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t        ,_param->_size_store_queue_ptr  ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
70       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr   ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
71       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_HAS_IMMEDIAT         ,"HAS_IMMEDIAT"         ,Tcontrol_t        ,1                              ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
72       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_IMMEDIAT             ,"IMMEDIAT"             ,Tgeneral_data_t   ,_param->_size_general_data     ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
73       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_DATA_RA              ,"DATA_RA"              ,Tgeneral_data_t   ,_param->_size_general_data     ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
74       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_DATA_RB              ,"DATA_RB"              ,Tgeneral_data_t   ,_param->_size_general_data     ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
75       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_DATA_RC              ,"DATA_RC"              ,Tspecial_data_t   ,_param->_size_special_data     ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
76       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_WRITE_RD             ,"WRITE_RD"             ,Tcontrol_t        ,1                              ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
77       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_NUM_REG_RD           ,"NUM_REG_RD"           ,Tgeneral_address_t,_param->_size_general_register ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
78       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_WRITE_RE             ,"WRITE_RE"             ,Tcontrol_t        ,1                              ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
79       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_NUM_REG_RE           ,"NUM_REG_RE"           ,Tspecial_address_t,_param->_size_special_register ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
80     }
81    // ~~~~~[ Interface "execute_unit_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82     {
83       ALLOC2_INTERFACE("execute_unit_in", OUT, WEST, "Input of execute_unit", _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
84       
85       _ALLOC2_VALACK_OUT(out_EXECUTE_UNIT_IN_VAL,VAL, _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
86       _ALLOC2_VALACK_IN ( in_EXECUTE_UNIT_IN_ACK,ACK, _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
87       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_CONTEXT_ID           ,"CONTEXT_ID"           ,Tcontext_t        ,_param->_size_context_id       , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
88       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_FRONT_END_ID         ,"FRONT_END_ID"         ,Tcontext_t        ,_param->_size_front_end_id     , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
89       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_OOO_ENGINE_ID        ,"OOO_ENGINE_ID"        ,Tcontext_t        ,_param->_size_ooo_engine_id    , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
90       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_PACKET_ID            ,"PACKET_ID"            ,Tpacket_t         ,_param->_size_rob_ptr          , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
91       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_OPERATION            ,"OPERATION"            ,Toperation_t      ,_param->_size_operation        , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
92       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_TYPE                 ,"TYPE"                 ,Ttype_t           ,_param->_size_type             , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
93       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_HAS_IMMEDIAT         ,"HAS_IMMEDIAT"         ,Tcontrol_t        ,1                              , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
94       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_DATA_RC              ,"DATA_RC"              ,Tspecial_data_t   ,_param->_size_special_data     , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
95       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_WRITE_RD             ,"WRITE_RD"             ,Tcontrol_t        ,1                              , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
96       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_WRITE_RE             ,"WRITE_RE"             ,Tcontrol_t        ,1                              , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
97       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_NUM_REG_RE           ,"NUM_REG_RE"           ,Tspecial_address_t,_param->_size_special_register , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
98       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t        ,_param->_size_store_queue_ptr  , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
99       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr   , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
100       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_IMMEDIAT             ,"IMMEDIAT"             ,Tgeneral_data_t   ,_param->_size_general_data     , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
101       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_DATA_RA              ,"DATA_RA"              ,Tgeneral_data_t   ,_param->_size_general_data     , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
102       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_DATA_RB              ,"DATA_RB"              ,Tgeneral_data_t   ,_param->_size_general_data     , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
103       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_NUM_REG_RD           ,"NUM_REG_RD"           ,Tgeneral_address_t,_param->_size_general_register , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
104     }
105
106    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
107     if (usage_is_set(_usage,USE_SYSTEMC))
108       {
109     _destination = new std::list<destination_t> ** [_param->_nb_read_unit];
110     for (uint32_t i=0; i<_param->_nb_read_unit; i++)
111       {
112         _destination [i] = new std::list<destination_t> * [_param->_nb_thread];
113         for (uint32_t j=0; j<_param->_nb_thread; j++)
114           {
115             _destination [i][j] = new std::list<destination_t> [_param->_nb_type];
116           }
117       }
118       }
119
120#ifdef POSITION
121     if (usage_is_set(_usage,USE_POSITION))
122       _component->generate_file();
123#endif
124
125    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
126  };
127
128}; // end namespace read_unit_to_execution_unit
129}; // end namespace network
130}; // end namespace execute_loop
131}; // end namespace multi_execute_loop
132}; // end namespace core
133
134}; // end namespace behavioural
135}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.