source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_allocation.cpp @ 82

Last change on this file since 82 was 82, checked in by rosiere, 16 years ago
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
  • Property svn:keywords set to Id
File size: 8.2 KB
Line 
1/*
2 * $Id: Decod_queue_allocation.cpp 82 2008-05-01 16:48:45Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace decod_unit {
17namespace decod_queue {
18
19#undef  FUNCTION
20#define FUNCTION "Decod_queue::allocation"
21  void Decod_queue::allocation
22  (
23#ifdef STATISTICS
24   morpheo::behavioural::Parameters_Statistics * param_statistics
25#else
26   void
27#endif
28   )
29  {
30    log_begin(Decod_queue,FUNCTION);
31
32    _component   = new Component (_usage);
33
34    Entity * entity = _component->set_entity (_name       
35                                              ,"Decod_queue"
36#ifdef POSITION
37                                              ,COMBINATORY
38#endif
39                                              );
40
41    _interfaces = entity->set_interfaces();
42
43    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44    {
45      Interface * interface = _interfaces->set_interface(""
46#ifdef POSITION
47                                                         ,IN
48                                                         ,SOUTH,
49                                                         _("Generalist interface")
50#endif
51                                                         );
52     
53      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
54      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
55    }
56
57    // ~~~~~[ Interface : "decod_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58    {
59      ALLOC1_INTERFACE("decod_in",IN ,WEST,"Input of decod_queue", _param->_nb_inst_decod);
60
61      ALLOC1_VALACK_IN ( in_DECOD_IN_VAL            ,VAL);
62      ALLOC1_VALACK_OUT(out_DECOD_IN_ACK            ,ACK);
63      ALLOC1_SIGNAL_IN ( in_DECOD_IN_CONTEXT_ID     ,"context_id"   ,Tcontext_t         ,_param->_size_context_id            );
64      ALLOC1_SIGNAL_IN ( in_DECOD_IN_DEPTH          ,"depth"        ,Tdepth_t           ,_param->_size_depth                 );
65      ALLOC1_SIGNAL_IN ( in_DECOD_IN_TYPE           ,"type"         ,Ttype_t            ,_param->_size_type                  );
66      ALLOC1_SIGNAL_IN ( in_DECOD_IN_OPERATION      ,"operation"    ,Toperation_t       ,_param->_size_operation             );
67      ALLOC1_SIGNAL_IN ( in_DECOD_IN_IS_DELAY_SLOT  ,"is_delay_slot",Tcontrol_t         ,1                                   );
68      ALLOC1_SIGNAL_IN ( in_DECOD_IN_ADDRESS        ,"address"      ,Tgeneral_data_t    ,_param->_size_general_data          );
69      ALLOC1_SIGNAL_IN ( in_DECOD_IN_HAS_IMMEDIAT   ,"has_immediat" ,Tcontrol_t         ,1                                   );
70      ALLOC1_SIGNAL_IN ( in_DECOD_IN_IMMEDIAT       ,"immediat"     ,Tgeneral_data_t    ,_param->_size_general_data          );
71      ALLOC1_SIGNAL_IN ( in_DECOD_IN_READ_RA        ,"read_ra"      ,Tcontrol_t         ,1                                   );
72      ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RA     ,"num_reg_ra"   ,Tgeneral_address_t ,_param->_size_general_register_logic);
73      ALLOC1_SIGNAL_IN ( in_DECOD_IN_READ_RB        ,"read_rb"      ,Tcontrol_t         ,1                                   );
74      ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RB     ,"num_reg_rb"   ,Tgeneral_address_t ,_param->_size_general_register_logic);
75      ALLOC1_SIGNAL_IN ( in_DECOD_IN_READ_RC        ,"read_rc"      ,Tcontrol_t         ,1                                   );
76      ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RC     ,"num_reg_rc"   ,Tspecial_address_t ,_param->_size_special_register_logic);
77      ALLOC1_SIGNAL_IN ( in_DECOD_IN_WRITE_RD       ,"write_rd"     ,Tcontrol_t         ,1                                   );
78      ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RD     ,"num_reg_rd"   ,Tgeneral_address_t ,_param->_size_general_register_logic);
79      ALLOC1_SIGNAL_IN ( in_DECOD_IN_WRITE_RE       ,"write_re"     ,Tcontrol_t         ,1                                   );
80      ALLOC1_SIGNAL_IN ( in_DECOD_IN_NUM_REG_RE     ,"num_reg_re"   ,Tspecial_address_t ,_param->_size_special_register_logic);
81      ALLOC1_SIGNAL_IN ( in_DECOD_IN_EXCEPTION_USE  ,"exception_use",Texception_t       ,_param->_size_exception_use         );
82    }
83
84    // ~~~~~[ Interface : "decod_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85    {
86      ALLOC1_INTERFACE("decod_out",OUT,EAST,"Output of decod_queue", _param->_nb_inst_decod);
87
88      ALLOC1_VALACK_OUT(out_DECOD_OUT_VAL            ,VAL);
89      ALLOC1_VALACK_IN ( in_DECOD_OUT_ACK            ,ACK);
90      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_CONTEXT_ID     ,"context_id"   ,Tcontext_t         ,_param->_size_context_id            );
91      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_DEPTH          ,"depth"        ,Tdepth_t           ,_param->_size_depth                 );
92      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_TYPE           ,"type"         ,Ttype_t            ,_param->_size_type                  );
93      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_OPERATION      ,"operation"    ,Toperation_t       ,_param->_size_operation             );
94      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_IS_DELAY_SLOT  ,"is_delay_slot",Tcontrol_t         ,1                                   );
95      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_ADDRESS        ,"address"      ,Tgeneral_data_t    ,_param->_size_general_data          );
96      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_HAS_IMMEDIAT   ,"has_immediat" ,Tcontrol_t         ,1                                   );
97      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_IMMEDIAT       ,"immediat"     ,Tgeneral_data_t    ,_param->_size_general_data          );
98      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_READ_RA        ,"read_ra"      ,Tcontrol_t         ,1                                   );
99      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RA     ,"num_reg_ra"   ,Tgeneral_address_t ,_param->_size_general_register_logic);
100      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_READ_RB        ,"read_rb"      ,Tcontrol_t         ,1                                   );
101      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RB     ,"num_reg_rb"   ,Tgeneral_address_t ,_param->_size_general_register_logic);
102      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_READ_RC        ,"read_rc"      ,Tcontrol_t         ,1                                   );
103      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RC     ,"num_reg_rc"   ,Tspecial_address_t ,_param->_size_special_register_logic);
104      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_WRITE_RD       ,"write_rd"     ,Tcontrol_t         ,1                                   );
105      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RD     ,"num_reg_rd"   ,Tgeneral_address_t ,_param->_size_general_register_logic);
106      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_WRITE_RE       ,"write_re"     ,Tcontrol_t         ,1                                   );
107      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_NUM_REG_RE     ,"num_reg_re"   ,Tspecial_address_t ,_param->_size_special_register_logic);
108      ALLOC1_SIGNAL_OUT(out_DECOD_OUT_EXCEPTION_USE  ,"exception_use",Texception_t       ,_param->_size_exception_use         );
109    }
110
111    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
112    {
113      ALLOC1_INTERFACE("depth",IN ,NORTH,"Depth", _param->_nb_context);
114
115      ALLOC1_SIGNAL_IN ( in_DEPTH_TAIL     ,"tail"     ,Tdepth_t           ,_param->_size_depth  );
116      if (_param->_have_port_depth)
117      ALLOC1_SIGNAL_IN ( in_DEPTH_NB_BRANCH,"nb_branch",Tdepth_t           ,_param->_size_depth+1);
118    }
119
120    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
121    {
122      ALLOC1_INTERFACE("nb_inst",OUT,NORTH,"Instruction's number", _param->_nb_context);
123
124      ALLOC1_SIGNAL_OUT(out_NB_INST_ALL    ,"all"      ,Tcontext_t         ,_param->_size_nb_inst+1);
125    }
126
127    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
128    reg_QUEUE              = new std::list<decod_queue_entry_t*>;
129    reg_NB_INST            = new uint32_t   [_param->_nb_context];
130
131    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132    internal_DECOD_IN_ACK  = new Tcontrol_t [_param->_nb_inst_decod];
133    internal_DECOD_OUT_VAL = new Tcontrol_t [_param->_nb_inst_decod];
134    internal_DECOD_OUT_ACK = new Tcontrol_t [_param->_nb_inst_decod];
135   
136    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
137
138#ifdef POSITION
139    if (usage_is_set(_usage,USE_POSITION))
140      _component->generate_file();
141#endif
142
143    log_end(Decod_queue,FUNCTION);
144  };
145
146}; // end namespace decod_queue
147}; // end namespace decod_unit
148}; // end namespace front_end
149}; // end namespace multi_front_end
150}; // end namespace core
151
152}; // end namespace behavioural
153}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.