source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Parameters.cpp @ 83

Last change on this file since 83 was 83, checked in by rosiere, 16 years ago

Add component : Context_State (manage miss prediction, exception , decod_enable, synchronisation instruction ...)

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/*
2 * $Id: Parameters.cpp 83 2008-05-09 18:00:21Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Parameters.h"
9#include "Common/include/Max.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace context_state {
17
18
19#undef  FUNCTION
20#define FUNCTION "Context_State::Parameters"
21  Parameters::Parameters (uint32_t   nb_context,
22                          uint32_t   nb_decod_unit,
23                          uint32_t   nb_ooo_engine,
24                          uint32_t   nb_inst_branch_complete,
25                          uint32_t * size_depth,               
26                          uint32_t   size_address,
27                          uint32_t * size_inst_decod,           
28                          uint32_t * size_inst_commit,         
29                          uint32_t * link_context_to_decod_unit,
30                          uint32_t * link_decod_unit_to_ooo_engine)
31  {
32    log_begin(Context_State,FUNCTION);
33
34    _nb_context                    = nb_context                   ;
35    _nb_decod_unit                 = nb_decod_unit                ;
36    _nb_ooo_engine                 = nb_ooo_engine                ;
37    _nb_inst_branch_complete       = nb_inst_branch_complete      ;
38    _size_depth                    = size_depth                   ;
39    _size_address                  = size_address                 ;
40    _size_inst_decod               = size_inst_decod              ;
41    _size_inst_commit              = size_inst_commit             ;
42    _link_context_to_decod_unit    = link_context_to_decod_unit   ;
43    _link_decod_unit_to_ooo_engine = link_decod_unit_to_ooo_engine;
44   
45    _size_context_id               = log2(_nb_context);
46    _size_max_depth                = max<uint32_t>(_size_depth,_nb_context);
47
48    _have_port_context_id          = (_size_context_id>0);
49    _have_port_max_depth           = (_size_max_depth >0);
50    _have_port_depth               = new bool [_nb_context];
51    for (uint32_t i=0; i<_nb_context; i++)
52      _have_port_depth [i] = (_size_depth [i] >0);
53   
54    test();
55    log_end(Context_State,FUNCTION);
56  };
57 
58// #undef  FUNCTION
59// #define FUNCTION "Context_State::Parameters (copy)"
60//   Parameters::Parameters (Parameters & param)
61//   {
62//     log_begin(Context_State,FUNCTION);
63//     test();
64//     log_end(Context_State,FUNCTION);
65//   };
66
67#undef  FUNCTION
68#define FUNCTION "Context_State::~Parameters"
69  Parameters::~Parameters () 
70  {
71    log_begin(Context_State,FUNCTION);
72    delete [] _have_port_depth;
73    log_end(Context_State,FUNCTION);
74  };
75
76}; // end namespace context_state
77}; // end namespace front_end
78}; // end namespace multi_front_end
79}; // end namespace core
80
81}; // end namespace behavioural
82}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.