source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Parameters.cpp @ 113

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

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1/*
2 * $Id: Parameters.cpp 113 2009-04-14 18:39:12Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Parameters.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_write_unit {
16namespace write_unit {
17namespace write_queue {
18
19
20#undef  FUNCTION
21#define FUNCTION "Write_queue::Parameters"
22  Parameters::Parameters (uint32_t size_queue         ,
23                          uint32_t nb_context         ,
24                          uint32_t nb_front_end       ,
25                          uint32_t nb_ooo_engine      ,
26                          uint32_t nb_packet          ,
27                          uint32_t size_general_data  ,
28                          uint32_t nb_general_register,
29                          uint32_t size_special_data  ,
30                          uint32_t nb_special_register,
31                          uint32_t nb_bypass_write    ,
32                          bool     is_toplevel):
33    behavioural::Parameters ("Write_queue")
34  {
35    log_printf(FUNC,Write_queue,FUNCTION,"Begin");
36
37    _size_queue              = size_queue         ;
38    _nb_context              = nb_context         ;
39    _nb_front_end            = nb_front_end       ;
40    _nb_ooo_engine           = nb_ooo_engine      ;
41    _nb_packet               = nb_packet          ;
42    _nb_general_register     = nb_general_register;
43    _nb_special_register     = nb_special_register;
44    _nb_bypass_write         = nb_bypass_write    ;
45
46    _nb_gpr_write            = 1;
47    _nb_spr_write            = 1;
48
49    test();
50
51    if (is_toplevel)
52      {
53        _size_instruction_address= size_general_data-2;
54        _size_context_id         = log2(_nb_context         );
55        _size_front_end_id       = log2(_nb_front_end       );
56        _size_ooo_engine_id      = log2(_nb_ooo_engine      );
57        _size_rob_ptr            = log2(_nb_packet          );
58        _size_general_register   = log2(_nb_general_register);
59        _size_special_register   = log2(_nb_special_register);
60        _size_general_data       = size_general_data  ;
61        _size_special_data       = size_special_data  ;
62       
63        _have_port_context_id    = _size_context_id    > 0;
64        _have_port_front_end_id  = _size_front_end_id  > 0;
65        _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
66        _have_port_rob_ptr       = _size_rob_ptr       > 0;
67
68        copy();
69      }
70
71    log_printf(FUNC,Write_queue,FUNCTION,"End");
72  };
73 
74// #undef  FUNCTION
75// #define FUNCTION "Write_queue::Parameters (copy)"
76//   Parameters::Parameters (Parameters & param):
77//     _size_queue              (param._size_queue             ),
78//     _nb_context              (param._nb_context             ),
79//     _nb_front_end            (param._nb_front_end           ),
80//     _nb_ooo_engine           (param._nb_ooo_engine          ),
81//     _nb_packet               (param._nb_packet              ),
82//     _size_general_data       (param._size_general_data      ),
83//     _nb_general_register     (param._nb_general_register    ),
84//     _size_special_data       (param._size_special_data      ),
85//     _nb_special_register     (param._nb_special_register    ),
86//     _nb_bypass_write         (param._nb_bypass_write        ),
87
88//     _nb_gpr_write            (param._nb_gpr_write           ),
89//     _nb_spr_write            (param._nb_spr_write           ),
90
91//     _size_context_id         (param._size_context_id        ),
92//     _size_front_end_id       (param._size_front_end_id      ),
93//     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
94//     _size_packet_id          (param._size_packet_id         ),
95//     _size_general_register   (param._size_general_register  ),
96//     _size_special_register   (param._size_special_register  ),
97
98//     _have_port_context_id    (param._have_port_context_id   ),
99//     _have_port_front_end_id  (param._have_port_front_end_id ),
100//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
101//     _have_port_packet_id     (param._have_port_packet_id    )
102//   {
103//     log_printf(FUNC,Write_queue,FUNCTION,"Begin");
104//     test();
105//     log_printf(FUNC,Write_queue,FUNCTION,"End");
106//   };
107
108#undef  FUNCTION
109#define FUNCTION "Write_queue::~Parameters"
110  Parameters::~Parameters (void) 
111  {
112    log_printf(FUNC,Write_queue,FUNCTION,"Begin");
113    log_printf(FUNC,Write_queue,FUNCTION,"End");
114  };
115
116#undef  FUNCTION
117#define FUNCTION "Write_queue::copy"
118  void Parameters::copy (void) 
119  {
120    log_printf(FUNC,Write_queue,FUNCTION,"Begin");
121
122    _size_internal_queue = 
123      ( _size_context_id          + 
124        _size_front_end_id        + 
125        _size_ooo_engine_id       + 
126        _size_rob_ptr             + 
127        1                         +
128        _size_general_register    +
129        _size_general_data        +
130        1                         +
131        _size_special_register    +
132        _size_special_data        +
133        _size_exception           +
134        1                         +
135        _size_instruction_address
136       );
137
138    log_printf(FUNC,Write_queue,FUNCTION,"End");
139  };
140
141}; // end namespace write_queue
142}; // end namespace write_unit
143}; // end namespace multi_write_unit
144}; // end namespace execute_loop
145}; // end namespace multi_execute_loop
146}; // end namespace core
147
148}; // end namespace behavioural
149}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.