source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Parameters.cpp @ 135

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

1) Add Vhdl component
2) Inhib VHDL Seltest interface

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1/*
2 * $Id: Parameters.cpp 135 2009-07-17 08:59:05Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Parameters.h"
9#include "Common/include/Max.h"
10
11namespace morpheo {
12  namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace decod_unit {
17namespace decod_queue {
18
19
20#undef  FUNCTION
21#define FUNCTION "Decod_queue::Parameters"
22  Parameters::Parameters (uint32_t              nb_context          ,
23                          uint32_t              nb_inst_decod       ,
24                          uint32_t              size_queue          ,
25                          Tdecod_queue_scheme_t queue_scheme        ,
26                          uint32_t              size_general_data   ,
27                          uint32_t            * nb_branch_speculated,
28                          bool                  is_toplevel)
29  {
30    log_begin(Decod_queue,FUNCTION);
31
32    _nb_context              = nb_context              ;
33    _nb_inst_decod           = nb_inst_decod           ;
34    _size_queue              = size_queue/nb_inst_decod;
35    _queue_scheme            = queue_scheme            ;
36//  _size_general_data       = size_general_data       ;
37    _nb_branch_speculated    = nb_branch_speculated    ;
38    _nb_instruction_in_queue = size_queue              ;
39
40    _nb_bank                 = nb_inst_decod           ;
41
42    test();
43
44    _size_internal_queue = 
45      (1                            + // _val
46       _size_context_id             + // _context_id
47       _size_depth                  + // _depth
48       _size_type                   + // _type   
49       _size_operation              + // _operation
50       1                            + // _no_execute
51       1                            + // _is_delay_slot
52#ifdef DEBUG
53       _size_instruction_address    + // _address
54#endif
55       _size_instruction_address    + // _address_next
56       1                            + // _has_immediat
57       _size_general_data           + // _immediat
58       1                            + // _read_ra
59       _size_general_register_logic + // _num_reg_ra
60       1                            + // _read_rb
61       _size_general_register_logic + // _num_reg_rb
62       1                            + // _read_rc
63       _size_special_register_logic + // _num_reg_rc
64       1                            + // _write_rd
65       _size_general_register_logic + // _num_reg_rd
66       1                            + // _write_re
67       _size_special_register_logic + // _num_reg_re
68       _size_exception_use          + // _exception_use
69       _size_exception_decod          // _exception
70       ) * _nb_inst_decod;
71
72    if (is_toplevel)
73      {
74        _size_context_id          = log2(nb_context);
75        _size_nb_inst_decod       = log2(_size_queue)+1;
76        _size_depth               = log2(max<uint32_t>(_nb_branch_speculated,_nb_context));
77        _size_general_data        = size_general_data;
78        _size_instruction_address = size_general_data-2;
79
80        _have_port_context_id     = _size_context_id > 0;
81        _have_port_depth          = _size_depth > 0;
82
83        copy ();
84      }
85
86    log_end(Decod_queue,FUNCTION);
87  };
88 
89// #undef  FUNCTION
90// #define FUNCTION "Decod_queue::Parameters (copy)"
91//   Parameters::Parameters (Parameters & param)
92//   {
93//     log_begin(Decod_queue,FUNCTION);
94//     test();
95//     log_end(Decod_queue,FUNCTION);
96//   };
97
98#undef  FUNCTION
99#define FUNCTION "Decod_queue::~Parameters"
100  Parameters::~Parameters () 
101  {
102    log_begin(Decod_queue,FUNCTION);
103
104    log_end(Decod_queue,FUNCTION);
105  };
106
107#undef  FUNCTION
108#define FUNCTION "Decod_queue::copy"
109  void Parameters::copy (void) 
110  {
111    log_begin(Decod_queue,FUNCTION);
112
113    log_end(Decod_queue,FUNCTION);
114  };
115
116}; // end namespace decod_queue
117}; // end namespace decod_unit
118}; // end namespace front_end
119}; // end namespace multi_front_end
120}; // end namespace core
121
122}; // end namespace behavioural
123}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.