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

Last change on this file was 138, checked in by rosiere, 14 years ago

1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...

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