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

Last change on this file since 113 was 113, checked in by rosiere, 15 years ago

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

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