source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Parameters.cpp @ 116

Last change on this file since 116 was 116, checked in by moulu, 15 years ago

1) added a generic multiplier (systemC isn't working with 8bits)
2) added a partial functionnal unit vhdl.

  • Property svn:keywords set to Id
File size: 6.6 KB
Line 
1/*
2 * $Id: Parameters.cpp 116 2009-04-30 13:51:41Z moulu $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/include/Parameters.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_execute_unit {
16namespace execute_unit {
17namespace functionnal_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Functionnal_unit::Parameters"
22  Parameters::Parameters (uint32_t           nb_context         ,
23                          uint32_t           nb_front_end       ,
24                          uint32_t           nb_ooo_engine      ,
25                          uint32_t           nb_packet          ,
26                          uint32_t           size_general_data  ,
27                          uint32_t           nb_general_register,
28                          uint32_t           size_special_data  ,
29                          uint32_t           nb_special_register,
30                          uint32_t           size_store_queue   ,
31                          uint32_t           size_load_queue    ,
32                          execute_timing_t** timing             ,
33                          morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void),
34                          bool               is_toplevel):
35    _functionnal_unit_scheme (FUNCTIONNAL_UNIT_SCHEME_GLOBAL_REGISTERFILE)
36  {
37    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
38
39    _nb_context              = nb_context            ;
40    _nb_front_end            = nb_front_end          ;
41    _nb_ooo_engine           = nb_ooo_engine         ;
42    _nb_packet               = nb_packet             ;
43//  _size_general_data       = size_general_data     ;
44//  _size_special_data       = size_special_data     ;
45//  _nb_general_register     = nb_general_register   ;
46//  _nb_special_register     = nb_special_register   ;
47//  _size_store_queue        = size_store_queue      ;
48//  _size_load_queue         = size_load_queue       ;
49
50//  _size_context_id         = log2(nb_context         );
51//  _size_front_end_id       = log2(nb_front_end       );
52//  _size_ooo_engine_id      = log2(nb_ooo_engine      );
53//  _size_packet_id          = log2(nb_packet          );
54//  _size_general_register   = log2(nb_general_register);
55//  _size_special_register   = log2(nb_special_register);
56
57//  _have_port_context_id    = _size_context_id    > 0;
58//  _have_port_front_end_id  = _size_front_end_id  > 0;
59//  _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
60//  _have_port_packet_id     = _size_packet_id     > 0;
61//  _have_port_load_queue_ptr= _size_load_queue    > 1;
62
63    _have_groupe_MAC         = ( (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MAC  ]._latence > 0) or
64                                 (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MACRC]._latence > 0) or
65                                 (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MSB  ]._latence > 0));
66
67    _timing                  = timing;
68
69    if (get_custom_information == NULL)
70      _get_custom_information = &(morpheo::behavioural::custom::default_get_custom_information);
71    else
72      _get_custom_information = get_custom_information;
73
74    test();
75
76    if (is_toplevel)
77      {
78        _size_instruction_address= size_general_data-2;
79        _size_context_id         = log2(nb_context         );
80        _size_front_end_id       = log2(nb_front_end       );
81        _size_ooo_engine_id      = log2(nb_ooo_engine      );
82        _size_rob_ptr            = log2(nb_packet          );
83        _size_general_register   = log2(nb_general_register);
84        _size_special_register   = log2(nb_special_register);
85
86        _size_general_data       = size_general_data     ;
87        _size_special_data       = size_special_data     ;
88        _size_general_register   = log2(nb_general_register);
89        _size_special_register   = log2(nb_special_register);
90
91        _size_load_queue_ptr     = log2(size_load_queue );
92        _size_store_queue_ptr    = log2(size_store_queue);
93   
94        _have_port_context_id    = _size_context_id    > 0;
95        _have_port_front_end_id  = _size_front_end_id  > 0;
96        _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
97        _have_port_rob_ptr       = _size_rob_ptr       > 0;
98        _have_port_load_queue_ptr= _size_load_queue_ptr> 0;
99
100        copy();
101      }
102
103    log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
104  };
105 
106// #undef  FUNCTION
107// #define FUNCTION "Functionnal_unit::Parameters (copy)"
108//   Parameters::Parameters (Parameters & param):
109//     _nb_context              (param._nb_context             ),
110//     _nb_front_end            (param._nb_front_end           ),
111//     _nb_ooo_engine           (param._nb_ooo_engine          ),
112//     _nb_packet               (param._nb_packet              ),
113//     _size_general_data       (param._size_general_data      ),
114//     _nb_general_register     (param._nb_general_register    ),
115//     _size_special_data       (param._size_special_data      ),
116//     _nb_special_register     (param._nb_special_register    ),
117//     _size_store_queue        (param._size_store_queue       ),
118//     _size_load_queue         (param._size_load_queue        ),
119
120//     _size_context_id         (param._size_context_id        ),
121//     _size_front_end_id       (param._size_front_end_id      ),
122//     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
123//     _size_packet_id          (param._size_packet_id         ),
124//     _size_general_register   (param._size_general_register  ),
125//     _size_special_register   (param._size_special_register  ),
126
127//     _have_port_context_id    (param._have_port_context_id   ),
128//     _have_port_front_end_id  (param._have_port_front_end_id ),
129//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
130//     _have_port_packet_id     (param._have_port_packet_id    ),
131//     _have_port_load_queue_ptr(param._have_port_load_queue_ptr),
132
133//     _have_groupe_MAC         (param._have_groupe_MAC        )
134//   {
135//     log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
136
137//     _timing                 = param._timing;
138//     _get_custom_information = param._get_custom_information;
139
140//     test();
141//     log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
142//   };
143
144#undef  FUNCTION
145#define FUNCTION "Functionnal_unit::~Parameters"
146  Parameters::~Parameters (void)
147  {
148    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
149    log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
150  };
151
152#undef  FUNCTION
153#define FUNCTION "Functionnal_unit::copy"
154  void Parameters::copy (void)
155  {
156    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
157    log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
158  };
159
160}; // end namespace functionnal_unit
161}; // end namespace execute_unit
162}; // end namespace multi_execute_unit
163}; // end namespace execute_loop
164}; // end namespace multi_execute_loop
165}; // end namespace core
166
167}; // end namespace behavioural
168}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.