source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters.cpp @ 124

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

1) Add test and configuration
2) Fix Bug
3) Add log file in load store unit
4) Fix Bug in environment

  • Property svn:keywords set to Id
File size: 7.9 KB
Line 
1/*
2 * $Id: Parameters.cpp 124 2009-06-17 12:11:25Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_execute_unit {
16namespace execute_unit {
17namespace load_store_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Load_store_unit::Parameters"
22  Parameters::Parameters (uint32_t            size_store_queue       ,
23                          uint32_t            size_load_queue        ,
24                          uint32_t            size_speculative_access_queue,
25                          uint32_t            nb_port_check          ,
26                          Tspeculative_load_t speculative_load       ,
27                          uint32_t            nb_bypass_memory       ,
28                          uint32_t            nb_cache_port          ,
29                          uint32_t            nb_inst_memory         ,
30                          uint32_t            nb_context             ,
31                          uint32_t            nb_front_end           ,
32                          uint32_t            nb_ooo_engine          ,
33                          uint32_t            nb_packet              ,
34                          uint32_t            size_general_data      ,
35                          uint32_t            size_special_data      ,
36                          uint32_t            nb_general_register    ,
37                          uint32_t            nb_special_register    ,
38                          uint32_t            nb_thread              ,
39                          bool              * num_thread_valid       , //[nb_thread]
40                          bool                is_toplevel)
41  {
42    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
43
44    _size_store_queue                      = size_store_queue       ;
45    _size_load_queue                       = size_load_queue        ;
46    _size_speculative_access_queue         = size_speculative_access_queue;
47    _nb_port_check                         = nb_port_check          ;
48    _speculative_load                      = speculative_load       ;
49    _nb_bypass_memory                      = nb_bypass_memory       ;
50    _nb_cache_port                         = nb_cache_port          ;
51    _nb_inst_memory                        = nb_inst_memory         ;
52    _nb_context                            = nb_context             ;
53    _nb_front_end                          = nb_front_end           ;
54    _nb_ooo_engine                         = nb_ooo_engine          ;
55    _nb_packet                             = nb_packet              ;
56    _nb_general_register                   = nb_general_register    ;
57    _nb_special_register                   = nb_special_register    ;
58    _nb_thread                             = nb_thread              ;
59    _num_thread_valid                      = num_thread_valid       ;
60   
61    _size_speculative_access_queue_ptr     = log2(size_speculative_access_queue);
62
63    _size_dcache_context_id                = log2(nb_context) + log2(nb_front_end) + log2(nb_ooo_engine);
64    _size_dcache_packet_id                 = log2((size_store_queue>size_load_queue)?size_store_queue:size_load_queue)+1;
65    _have_port_dcache_context_id           = _size_dcache_context_id>0;
66
67    _mask_address_lsb                      = gen_mask<Tdcache_address_t>(log2(size_general_data/8));
68    _mask_address_msb                      = gen_mask<Tdcache_address_t>(size_general_data) << log2(size_general_data/8);
69    _mask_check_hit_byte                   = 0;
70
71    for (uint32_t i=0; i<(size_general_data>>3) /*8*/; ++i)
72      _mask_check_hit_byte |= (1<<i);
73
74    test();
75
76    if (is_toplevel)
77      {
78        _size_instruction_address              = size_general_data-2;
79        _size_context_id                       = log2(nb_context         );
80        _size_front_end_id                     = log2(nb_front_end       );
81        _size_ooo_engine_id                    = log2(nb_ooo_engine      );
82        _size_rob_ptr                          = log2(nb_packet          );
83        _size_general_register                 = log2(nb_general_register);
84        _size_special_register                 = log2(nb_special_register);
85        _size_store_queue_ptr                  = log2(size_store_queue   );
86        _size_load_queue_ptr                   = log2(size_load_queue    );
87        _size_general_data                     = size_general_data      ;
88        _size_special_data                     = size_special_data      ;
89
90        _have_port_context_id                  = _size_context_id    >0;
91        _have_port_front_end_id                = _size_front_end_id  >0;
92        _have_port_ooo_engine_id               = _size_ooo_engine_id >0;
93        _have_port_rob_ptr                     = _size_rob_ptr       >0;
94        _have_port_load_queue_ptr              = _size_load_queue_ptr>0;
95
96        copy();
97      }
98
99    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
100  };
101 
102// #undef  FUNCTION
103// #define FUNCTION "Load_store_unit::Parameters (copy)"
104//   Parameters::Parameters (Parameters & param):
105//     _size_store_queue        (param._size_store_queue       ),
106//     _size_load_queue         (param._size_load_queue        ),
107//     _size_speculative_access_queue (param._size_speculative_access_queue),
108//     _nb_port_check           (param._nb_port_check          ),
109//     _speculative_load        (param._speculative_load       ),
110//     _nb_bypass_memory        (param._nb_bypass_memory       ),
111//     _nb_cache_port           (param._nb_cache_port          ),
112//     _nb_inst_memory          (param._nb_inst_memory         ),
113//     _nb_context              (param._nb_context             ),
114//     _nb_front_end            (param._nb_front_end           ),
115//     _nb_ooo_engine           (param._nb_ooo_engine          ),
116//     _nb_packet               (param._nb_packet              ),
117//     _size_general_data       (param._size_general_data      ),
118//     _size_special_data       (param._size_special_data      ),
119//     _nb_general_register     (param._nb_general_register    ),
120//     _nb_special_register     (param._nb_special_register    ),
121
122//     _size_address_store_queue              (param._size_address_store_queue             ),
123//     _size_address_load_queue               (param._size_address_load_queue              ),
124//     _size_address_speculative_access_queue (param._size_address_speculative_access_queue),
125
126//     _size_context_id         (param._size_context_id        ),
127//     _size_front_end_id       (param._size_front_end_id      ),
128//     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
129//     _size_packet_id          (param._size_packet_id         ),
130//     _size_general_register   (param._size_general_register  ),
131//     _size_special_register   (param._size_special_register  ),
132//     _size_dcache_context_id  (param._size_dcache_context_id ),
133//     _size_dcache_packet_id   (param._size_dcache_packet_id  ),
134
135//     _have_port_context_id    (param._have_port_context_id   ),
136//     _have_port_front_end_id  (param._have_port_front_end_id ),
137//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
138//     _have_port_packet_id     (param._have_port_packet_id    ),
139//     _have_port_dcache_context_id(param._have_port_dcache_context_id),
140//     _have_port_load_queue_ptr(param._have_port_load_queue_ptr),
141
142//     _mask_address_lsb        (param._mask_address_lsb),
143//     _mask_address_msb        (param._mask_address_msb)
144//   {
145//     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
146//     test();
147//     log_printf(FUNC,Load_store_unit,FUNCTION,"End");
148//   };
149
150#undef  FUNCTION
151#define FUNCTION "Load_store_unit::~Parameters"
152  Parameters::~Parameters (void) 
153  {
154    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
155
156    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
157  };
158
159#undef  FUNCTION
160#define FUNCTION "Load_store_unit::copy"
161  void Parameters::copy (void) 
162  {
163    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
164    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
165  };
166
167}; // end namespace load_store_unit
168}; // end namespace execute_unit
169}; // end namespace multi_execute_unit
170}; // end namespace execute_loop
171}; // end namespace multi_execute_loop
172}; // end namespace core
173
174}; // end namespace behavioural
175}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.