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

Last change on this file since 97 was 97, checked in by rosiere, 15 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: 7.5 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_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                          bool                is_toplevel)
39  {
40    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
41
42    _size_store_queue                      = size_store_queue       ;
43    _size_load_queue                       = size_load_queue        ;
44    _size_speculative_access_queue         = size_speculative_access_queue;
45    _nb_port_check                         = nb_port_check          ;
46    _speculative_load                      = speculative_load       ;
47    _nb_bypass_memory                      = nb_bypass_memory       ;
48    _nb_cache_port                         = nb_cache_port          ;
49    _nb_inst_memory                        = nb_inst_memory         ;
50    _nb_context                            = nb_context             ;
51    _nb_front_end                          = nb_front_end           ;
52    _nb_ooo_engine                         = nb_ooo_engine          ;
53    _nb_packet                             = nb_packet              ;
54    _nb_general_register                   = nb_general_register    ;
55    _nb_special_register                   = nb_special_register    ;
56   
57    _size_speculative_access_queue_ptr     = log2(size_speculative_access_queue);
58
59    _size_dcache_context_id                = log2(nb_context) + log2(nb_front_end) + log2(nb_ooo_engine);
60    _size_dcache_packet_id                 = (log2((size_store_queue>size_load_queue)?size_store_queue:size_load_queue))+1;
61
62    _have_port_dcache_context_id           = _size_dcache_context_id>0;
63
64    _mask_address_lsb                      = gen_mask<Tdcache_address_t>(log2(size_general_data/8));
65    _mask_address_msb                      = gen_mask<Tdcache_address_t>(size_general_data) << log2(size_general_data/8);
66
67    test();
68
69    if (is_toplevel)
70      {
71        _size_instruction_address              = size_general_data-2;
72        _size_context_id                       = log2(nb_context         );
73        _size_front_end_id                     = log2(nb_front_end       );
74        _size_ooo_engine_id                    = log2(nb_ooo_engine      );
75        _size_rob_ptr                          = log2(nb_packet          );
76        _size_general_register                 = log2(nb_general_register);
77        _size_special_register                 = log2(nb_special_register);
78        _size_store_queue_ptr                  = log2(size_store_queue   );
79        _size_load_queue_ptr                   = log2(size_load_queue    );
80        _size_general_data                     = size_general_data      ;
81        _size_special_data                     = size_special_data      ;
82
83        _have_port_context_id                  = _size_context_id    >0;
84        _have_port_front_end_id                = _size_front_end_id  >0;
85        _have_port_ooo_engine_id               = _size_ooo_engine_id >0;
86        _have_port_rob_ptr                     = _size_rob_ptr       >0;
87        _have_port_load_queue_ptr              = _size_load_queue_ptr>0;
88
89        copy();
90      }
91
92    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
93  };
94 
95// #undef  FUNCTION
96// #define FUNCTION "Load_store_unit::Parameters (copy)"
97//   Parameters::Parameters (Parameters & param):
98//     _size_store_queue        (param._size_store_queue       ),
99//     _size_load_queue         (param._size_load_queue        ),
100//     _size_speculative_access_queue (param._size_speculative_access_queue),
101//     _nb_port_check           (param._nb_port_check          ),
102//     _speculative_load        (param._speculative_load       ),
103//     _nb_bypass_memory        (param._nb_bypass_memory       ),
104//     _nb_cache_port           (param._nb_cache_port          ),
105//     _nb_inst_memory          (param._nb_inst_memory         ),
106//     _nb_context              (param._nb_context             ),
107//     _nb_front_end            (param._nb_front_end           ),
108//     _nb_ooo_engine           (param._nb_ooo_engine          ),
109//     _nb_packet               (param._nb_packet              ),
110//     _size_general_data       (param._size_general_data      ),
111//     _size_special_data       (param._size_special_data      ),
112//     _nb_general_register     (param._nb_general_register    ),
113//     _nb_special_register     (param._nb_special_register    ),
114
115//     _size_address_store_queue              (param._size_address_store_queue             ),
116//     _size_address_load_queue               (param._size_address_load_queue              ),
117//     _size_address_speculative_access_queue (param._size_address_speculative_access_queue),
118
119//     _size_context_id         (param._size_context_id        ),
120//     _size_front_end_id       (param._size_front_end_id      ),
121//     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
122//     _size_packet_id          (param._size_packet_id         ),
123//     _size_general_register   (param._size_general_register  ),
124//     _size_special_register   (param._size_special_register  ),
125//     _size_dcache_context_id  (param._size_dcache_context_id ),
126//     _size_dcache_packet_id   (param._size_dcache_packet_id  ),
127
128//     _have_port_context_id    (param._have_port_context_id   ),
129//     _have_port_front_end_id  (param._have_port_front_end_id ),
130//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
131//     _have_port_packet_id     (param._have_port_packet_id    ),
132//     _have_port_dcache_context_id(param._have_port_dcache_context_id),
133//     _have_port_load_queue_ptr(param._have_port_load_queue_ptr),
134
135//     _mask_address_lsb        (param._mask_address_lsb),
136//     _mask_address_msb        (param._mask_address_msb)
137//   {
138//     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
139//     test();
140//     log_printf(FUNC,Load_store_unit,FUNCTION,"End");
141//   };
142
143#undef  FUNCTION
144#define FUNCTION "Load_store_unit::~Parameters"
145  Parameters::~Parameters (void) 
146  {
147    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
148    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
149  };
150
151#undef  FUNCTION
152#define FUNCTION "Load_store_unit::copy"
153  void Parameters::copy (void) 
154  {
155    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
156    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
157  };
158
159}; // end namespace load_store_unit
160}; // end namespace execute_unit
161}; // end namespace multi_execute_unit
162}; // end namespace execute_loop
163}; // end namespace multi_execute_loop
164}; // end namespace core
165
166}; // end namespace behavioural
167}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.