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

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

1) Update Prediction Table : statistics
2) Size instruction address on 30 bits
3) Change Log File
4) Add debug_level in simulation configuration file

  • Property svn:keywords set to Id
File size: 6.3 KB
Line 
1/*
2 * $Id: Parameters.cpp 97 2008-12-19 15:34:00Z 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_instruction_address     = size_general_data-2;
76        _size_context_id              = log2(_nb_context         );
77        _size_front_end_id            = log2(_nb_front_end       );
78        _size_ooo_engine_id           = log2(_nb_ooo_engine      );
79        _size_rob_ptr                 = log2(_nb_packet          );
80        _size_general_register        = log2(_nb_general_register);
81        _size_special_register        = log2(_nb_special_register);
82        _size_general_data            = size_general_data  ;
83        _size_special_data            = size_special_data  ;
84       
85        _have_port_context_id         = _size_context_id    > 0;
86        _have_port_front_end_id       = _size_front_end_id  > 0;
87        _have_port_ooo_engine_id      = _size_ooo_engine_id > 0;
88        _have_port_rob_ptr            = _size_rob_ptr       > 0;
89
90        copy();
91      }
92
93    log_printf(FUNC,Write_unit,FUNCTION,"End");
94  };
95 
96// #undef  FUNCTION
97// #define FUNCTION "Write_unit::Parameters (copy)"
98//   Parameters::Parameters (Parameters & param):
99//     _size_write_queue        (param._size_write_queue       ),
100//     _size_execute_queue      (param._size_execute_queue     ),
101//     _nb_context              (param._nb_context             ),
102//     _nb_front_end            (param._nb_front_end           ),
103//     _nb_ooo_engine           (param._nb_ooo_engine          ),
104//     _nb_packet               (param._nb_packet              ),
105//     _size_general_data       (param._size_general_data      ),
106//     _nb_general_register     (param._nb_general_register    ),
107//     _size_special_data       (param._size_special_data      ),
108//     _nb_special_register     (param._nb_special_register    ),
109//     _nb_bypass_write         (param._nb_bypass_write        ),
110
111//     _nb_gpr_write            (param._nb_gpr_write           ),
112//     _nb_spr_write            (param._nb_spr_write           ),
113
114//     _size_context_id         (param._size_context_id        ),
115//     _size_front_end_id       (param._size_front_end_id      ),
116//     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
117//     _size_packet_id          (param._size_packet_id         ),
118//     _size_general_register   (param._size_general_register  ),
119//     _size_special_register   (param._size_special_register  ),
120
121//     _have_component_execute_queue (param._have_component_execute_queue),
122//     _have_port_context_id         (param._have_port_context_id        ),
123//     _have_port_front_end_id       (param._have_port_front_end_id      ),
124//     _have_port_ooo_engine_id      (param._have_port_ooo_engine_id     ),
125//     _have_port_packet_id          (param._have_port_packet_id         )
126//   {
127//     log_printf(FUNC,Write_unit,FUNCTION,"Begin");
128   
129//     _param_write_queue   = param._param_write_queue  ;
130//     _param_execute_queue = param._param_execute_queue;
131
132//     test();
133//     log_printf(FUNC,Write_unit,FUNCTION,"End");
134//   };
135
136#undef  FUNCTION
137#define FUNCTION "Write_unit::~Parameters"
138  Parameters::~Parameters (void)
139  {
140    log_printf(FUNC,Write_unit,FUNCTION,"Begin");
141
142    delete _param_write_queue;
143
144    if (_have_component_execute_queue)
145      delete _param_execute_queue;
146
147    log_printf(FUNC,Write_unit,FUNCTION,"End");
148  };
149
150#undef  FUNCTION
151#define FUNCTION "Write_unit::copy"
152  void Parameters::copy (void)
153  {
154    log_printf(FUNC,Write_unit,FUNCTION,"Begin");
155
156    COPY(_param_write_queue);
157    if (_have_component_execute_queue)
158    COPY(_param_execute_queue);
159
160    log_printf(FUNC,Write_unit,FUNCTION,"End");
161  };
162
163}; // end namespace write_unit
164}; // end namespace multi_write_unit
165}; // end namespace execute_loop
166}; // end namespace multi_execute_loop
167}; // end namespace core
168}; // end namespace behavioural
169}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.