source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/src/Parameters.cpp @ 88

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

Almost complete design
with Test and test platform

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