source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Parameters.cpp @ 120

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

1) Context_state : Add statistics
2) Add configuration with multi front_end
3) Add optionnal pid at log filename

  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1/*
2 * $Id: Parameters.cpp 120 2009-05-26 19:01:47Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Parameters.h"
9#include "Common/include/Max.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace network {
17namespace read_unit_to_execution_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Read_unit_to_Execution_unit::Parameters"
22  Parameters::Parameters (uint32_t    nb_read_unit           ,
23                          uint32_t  * nb_read_unit_port      ,
24                          uint32_t    nb_execute_unit        ,
25                          uint32_t  * nb_execute_unit_port   ,
26                          uint32_t    nb_context             ,
27                          uint32_t    nb_front_end           ,
28                          uint32_t    nb_ooo_engine          ,
29                          uint32_t    nb_packet              ,
30                          uint32_t    size_general_data      ,
31                          uint32_t    size_special_data      ,
32                          uint32_t    nb_general_register    ,
33                          uint32_t    nb_special_register    ,
34                          uint32_t    size_store_queue       ,
35                          uint32_t    size_load_queue        ,
36                          Tpriority_t priority               ,
37                          bool    *** table_routing          ,
38                          bool     ** table_execute_type     ,
39                          bool     ** table_execute_thread   ,
40                          bool      * num_thread_valid       ,
41                          bool        is_toplevel            )
42  {
43    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
44
45    _nb_read_unit            = nb_read_unit        ;
46    _nb_read_unit_port       = nb_read_unit_port   ;   
47    _nb_execute_unit         = nb_execute_unit     ;
48    _nb_execute_unit_port    = nb_execute_unit_port;
49    _nb_context              = nb_context          ;
50    _nb_front_end            = nb_front_end        ;
51    _nb_ooo_engine           = nb_ooo_engine       ;
52    _nb_packet               = nb_packet           ;
53    _nb_general_register     = nb_general_register ;
54    _nb_special_register     = nb_special_register ;
55    _priority                = priority            ;
56    _table_routing           = table_routing       ;
57    _table_execute_type      = table_execute_type  ;
58    _table_execute_thread    = table_execute_thread;
59    _num_thread_valid        = num_thread_valid    ;
60
61    log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"  * table_routing [nb_read_unit][nb_execute_unit][nb_execute_unit_port]");
62    for (uint32_t i=0; i<_nb_read_unit; ++i)
63      for (uint32_t j=0; j<_nb_execute_unit; ++j)
64        for (uint32_t k=0; k<_nb_execute_unit_port[j]; ++k)
65          if (_table_routing [i][j][k])
66            log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"    [%d][%d][%d] -> true",i,j,k);
67
68    log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"  * table_execute_type [nb_execute_unit][nb_type]");
69    for (uint32_t i=0; i<_nb_execute_unit; ++i)
70      for (uint32_t j=0; j<_nb_type; ++j)
71        if (_table_execute_type [i][j])
72          log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"    [%d][%d] -> true",i,j);
73
74    log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"  * table_execute_thread [nb_execute_unit][nb_thread]");
75    for (uint32_t i=0; i<_nb_execute_unit; ++i)
76      for (uint32_t j=0; j<_nb_thread; ++j)
77        if (_table_execute_thread [i][j])
78          log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"    [%d][%d] -> true",i,j);
79
80    _max_nb_read_unit_port   = max<uint32_t>(_nb_read_unit_port, _nb_read_unit);
81    _max_nb_execute_unit_port= max<uint32_t>(_nb_execute_unit_port, _nb_execute_unit);
82
83    _nb_thread               = get_nb_thread (nb_context, nb_front_end, nb_ooo_engine);
84    _nb_load_store_unit      = 0;
85
86    for (uint32_t i=0; i<nb_execute_unit; i++)
87      {
88        if (table_execute_type[i][TYPE_MEMORY] == true)
89          _nb_load_store_unit ++;
90      }
91    // a execution_unit can't be a load_store unit and a functionnal unit
92    _nb_functionnal_unit = nb_execute_unit-_nb_load_store_unit;
93
94    test();
95
96    if (is_toplevel)
97      {
98        _size_context_id         = log2(nb_context         );
99        _size_front_end_id       = log2(nb_front_end       );
100        _size_ooo_engine_id      = log2(nb_ooo_engine      );
101        _size_rob_ptr            = log2(nb_packet          );
102        _size_general_register   = log2(nb_general_register);
103        _size_special_register   = log2(nb_special_register);
104        _size_general_data       = size_general_data   ;
105        _size_special_data       = size_special_data   ;
106        _size_store_queue_ptr    = log2(size_store_queue   );
107        _size_load_queue_ptr     = log2(size_load_queue    );
108       
109        _have_port_context_id    = _size_context_id    > 0;
110        _have_port_front_end_id  = _size_front_end_id  > 0;
111        _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
112        _have_port_rob_ptr       = _size_rob_ptr       > 0;
113        _have_port_load_queue_ptr= _size_load_queue_ptr> 0;
114       
115        copy();
116      }
117
118    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
119  };
120 
121// #undef  FUNCTION
122// #define FUNCTION "Read_unit_to_Execution_unit::Parameters (copy)"
123//   Parameters::Parameters (Parameters & param)
124//   {
125//     log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
126
127//     test();
128//     log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
129//   };
130
131#undef  FUNCTION
132#define FUNCTION "Read_unit_to_Execution_unit::~Parameters"
133  Parameters::~Parameters () 
134  {
135    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
136    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
137  };
138
139#undef  FUNCTION
140#define FUNCTION "Read_unit_to_Execution_unit::copy"
141  void Parameters::copy (void) 
142  {
143    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
144    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
145  };
146
147}; // end namespace read_unit_to_execution_unit
148}; // end namespace network
149}; // end namespace execute_loop
150}; // end namespace multi_execute_loop
151}; // end namespace core
152
153}; // end namespace behavioural
154}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.