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

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

1) Write queue with mealy
2) Network : fix bug
3) leak memory

  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1/*
2 * $Id: Parameters.cpp 115 2009-04-20 21:29:17Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Parameters.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_write_unit {
16namespace write_unit {
17namespace write_queue {
18
19
20#undef  FUNCTION
21#define FUNCTION "Write_queue::Parameters"
22  Parameters::Parameters (uint32_t              size_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                          Twrite_queue_scheme_t queue_scheme       ,
33                          bool                  is_toplevel        ):
34    behavioural::Parameters ("Write_queue")
35  {
36    log_printf(FUNC,Write_queue,FUNCTION,"Begin");
37
38    _size_queue              = size_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    _queue_scheme            = queue_scheme       ;
47
48    _nb_gpr_write            = 1;
49    _nb_spr_write            = 1;
50
51    test();
52
53    if (is_toplevel)
54      {
55        _size_instruction_address= size_general_data-2;
56        _size_context_id         = log2(_nb_context         );
57        _size_front_end_id       = log2(_nb_front_end       );
58        _size_ooo_engine_id      = log2(_nb_ooo_engine      );
59        _size_rob_ptr            = log2(_nb_packet          );
60        _size_general_register   = log2(_nb_general_register);
61        _size_special_register   = log2(_nb_special_register);
62        _size_general_data       = size_general_data  ;
63        _size_special_data       = size_special_data  ;
64       
65        _have_port_context_id    = _size_context_id    > 0;
66        _have_port_front_end_id  = _size_front_end_id  > 0;
67        _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
68        _have_port_rob_ptr       = _size_rob_ptr       > 0;
69
70        copy();
71      }
72
73    log_printf(FUNC,Write_queue,FUNCTION,"End");
74  };
75 
76// #undef  FUNCTION
77// #define FUNCTION "Write_queue::Parameters (copy)"
78//   Parameters::Parameters (Parameters & param):
79//     _size_queue              (param._size_queue             ),
80//     _nb_context              (param._nb_context             ),
81//     _nb_front_end            (param._nb_front_end           ),
82//     _nb_ooo_engine           (param._nb_ooo_engine          ),
83//     _nb_packet               (param._nb_packet              ),
84//     _size_general_data       (param._size_general_data      ),
85//     _nb_general_register     (param._nb_general_register    ),
86//     _size_special_data       (param._size_special_data      ),
87//     _nb_special_register     (param._nb_special_register    ),
88//     _nb_bypass_write         (param._nb_bypass_write        ),
89
90//     _nb_gpr_write            (param._nb_gpr_write           ),
91//     _nb_spr_write            (param._nb_spr_write           ),
92
93//     _size_context_id         (param._size_context_id        ),
94//     _size_front_end_id       (param._size_front_end_id      ),
95//     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
96//     _size_packet_id          (param._size_packet_id         ),
97//     _size_general_register   (param._size_general_register  ),
98//     _size_special_register   (param._size_special_register  ),
99
100//     _have_port_context_id    (param._have_port_context_id   ),
101//     _have_port_front_end_id  (param._have_port_front_end_id ),
102//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
103//     _have_port_packet_id     (param._have_port_packet_id    )
104//   {
105//     log_printf(FUNC,Write_queue,FUNCTION,"Begin");
106//     test();
107//     log_printf(FUNC,Write_queue,FUNCTION,"End");
108//   };
109
110#undef  FUNCTION
111#define FUNCTION "Write_queue::~Parameters"
112  Parameters::~Parameters (void) 
113  {
114    log_printf(FUNC,Write_queue,FUNCTION,"Begin");
115    log_printf(FUNC,Write_queue,FUNCTION,"End");
116  };
117
118#undef  FUNCTION
119#define FUNCTION "Write_queue::copy"
120  void Parameters::copy (void) 
121  {
122    log_printf(FUNC,Write_queue,FUNCTION,"Begin");
123
124    _size_internal_queue = 
125      ( _size_context_id          + 
126        _size_front_end_id        + 
127        _size_ooo_engine_id       + 
128        _size_rob_ptr             + 
129        1                         +
130        _size_general_register    +
131        _size_general_data        +
132        1                         +
133        _size_special_register    +
134        _size_special_data        +
135        _size_exception           +
136        1                         +
137        _size_instruction_address
138       );
139
140    log_printf(FUNC,Write_queue,FUNCTION,"End");
141  };
142
143}; // end namespace write_queue
144}; // end namespace write_unit
145}; // end namespace multi_write_unit
146}; // end namespace execute_loop
147}; // end namespace multi_execute_loop
148}; // end namespace core
149
150}; // end namespace behavioural
151}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.