source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 7.5 KB
Line 
1#ifndef morpheo_behavioural_Parameters_h
2#define morpheo_behavioural_Parameters_h
3
4/*
5 * $Id: Parameters.h 88 2008-12-10 18:31:39Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Common/include/Environment.h"
12#include "Behavioural/include/Parameters_test.h"
13#include "Behavioural/include/Constants.h"
14#include "Behavioural/include/Test.h"
15#include "Common/include/ErrorMorpheo.h"
16#include "Common/include/ToString.h"
17#include "Common/include/Log2.h"
18#include "Common/include/Debug.h"
19#include <stdint.h>
20#include <iostream>
21#include <math.h>
22
23namespace morpheo     {
24namespace behavioural {
25 
26#ifdef COPY
27#error "Need COPY macro"
28#endif
29
30#define COPY(param) do {duplicate(param); param->copy();} while (0)
31
32  // Virtual Class - Interface of each component
33  class Parameters
34  {
35    // -----[ fields ]----------------------------------------------------
36  public   : static const uint32_t   _size_instruction              = 32;
37  public   : static const uint32_t   _size_spr                      = 32;
38  public   : static const uint32_t   _nb_operation                  = MAX_OPERATION;
39  public   : static const uint32_t   _nb_type                       = MAX_TYPE;
40  public   : static const uint32_t   _size_operation                = SIZE_OPERATION;
41  public   : static const uint32_t   _size_type                     = SIZE_TYPE;     
42  public   : static const uint32_t   _size_exception                = SIZE_EXCEPTION;
43  public   : static const uint32_t   _size_exception_use            = SIZE_EXCEPTION_USE;
44  public   : static const uint32_t   _size_exception_memory         = SIZE_EXCEPTION_MEMORY;
45  public   : static const uint32_t   _size_exception_custom         = SIZE_EXCEPTION_CUSTOM;
46  public   : static const uint32_t   _size_exception_alu            = SIZE_EXCEPTION_ALU   ;
47  public   : static const uint32_t   _size_exception_decod          = SIZE_EXCEPTION_DECOD ;
48  public   : static const uint32_t   _size_exception_ifetch         = SIZE_EXCEPTION_IFETCH;
49  public   : static const uint32_t   _size_icache_type              = SIZE_ICACHE_TYPE;
50  public   : static const uint32_t   _size_icache_error             = SIZE_ICACHE_ERROR;
51  public   : static const uint32_t   _size_dcache_type              = SIZE_DCACHE_TYPE;
52  public   : static const uint32_t   _size_dcache_error             = SIZE_DCACHE_ERROR;
53  public   : static const uint32_t   _nb_general_register_logic     = 32;
54  public   : static const uint32_t   _nb_special_register_logic     = NB_SPR_LOGIC;
55  public   : static const uint32_t   _size_general_register_logic   = 5;
56  public   : static const uint32_t   _size_special_register_logic   = LOG2_NB_SPR_LOGIC;
57  public   : static const uint32_t   _size_special_address_group    = 5;
58  public   : static const uint32_t   _size_special_address_register = 11;
59  public   : static const uint32_t   _size_event_state              = SIZE_EVENT_STATE;
60  public   : static const uint32_t   _size_event_type               = SIZE_EVENT_TYPE;
61  public   : static const uint32_t   _size_branch_state             = SIZE_BRANCH_STATE;
62  public   : static const uint32_t   _size_branch_condition         = SIZE_BRANCH_CONDITION;
63
64  public   : static const uint32_t   _shift_spr_num_group           = _size_special_address_register;
65  public   : static const uint32_t   _mask_spr_num_group            = 0x1f ; //        1_1111
66  public   : static const uint32_t   _mask_spr_num_reg              = 0x7ff; // 111_1111_1111
67
68    // simulation
69  public  :               uint64_t   _simulation_nb_cyle                    ;
70  public  :               uint64_t   _simulation_nb_instruction             ;
71
72    // parameters depends
73  public   :              uint32_t   _size_context_id                       ;
74  public   :              bool       _have_port_context_id                  ;
75
76  public   :              uint32_t   _size_front_end_id                     ;
77  public   :              bool       _have_port_front_end_id                ;
78
79  public   :              uint32_t   _size_ooo_engine_id                    ;
80  public   :              bool       _have_port_ooo_engine_id               ;
81                         
82  public   :              uint32_t   _size_instruction_address              ;
83//public   :              bool       _have_port_instruction_address         ; // always true
84
85  public   :              uint32_t   _size_data_address                     ;
86//public   :              bool       _have_port_data_address                ; // always true
87
88  public   :              uint32_t   _size_nb_inst_decod                    ;
89//public   :              bool       _have_port_nb_inst_decod               ; // always true
90
91  public   :              uint32_t   _size_nb_inst_commit                   ;
92//public   :              bool       _have_port_nb_inst_commit              ; // always true
93                         
94  public   :              uint32_t   _size_depth                            ;
95  public   :              bool       _have_port_depth                       ;
96                         
97  public   :              uint32_t   _size_ifetch_queue_ptr                 ;
98  public   :              bool       _have_port_ifetch_queue_ptr            ;
99                         
100  public   :              uint32_t   _size_inst_ifetch_ptr                  ; // nb_inst_fetch
101  public   :              bool       _have_port_inst_ifetch_ptr             ;
102                         
103//public   :              uint32_t   _size_branch_update_prediction_id      ; // = size_depth
104//public   :              bool       _have_port_branch_update_prediction_id ; // = size_depth
105
106  public   :              uint32_t   _size_rob_ptr                          ;
107  public   :              bool       _have_port_rob_ptr                     ;
108
109  public   :              uint32_t   _size_load_queue_ptr                   ;
110  public   :              bool       _have_port_load_queue_ptr              ;
111
112  public   :              uint32_t   _size_store_queue_ptr                  ;
113//public   :              bool       _have_port_store_queue_ptr             ; // always true (min = 1)
114
115  public   :              uint32_t   _size_general_data                     ;
116//public   :              bool       _have_port_general_data                ; // always true
117                         
118  public   :              uint32_t   _size_special_data                     ;
119//public   :              bool       _have_port_special_data                ; // always true
120 
121  public   :              uint32_t   _size_general_register                 ;
122//public   :              bool       _have_port_general_register            ; // always true
123
124  public   :              uint32_t   _size_special_register                 ;
125//public   :              bool       _have_port_special_register            ; // always true
126
127    // -----[ methods ]---------------------------------------------------
128  public   :                            Parameters (void);
129  public   : virtual                   ~Parameters ();
130       
131    // methods to print and test parameters
132  public   : virtual std::string        print       (uint32_t depth) = 0;
133  public   : virtual Parameters_test    msg_error   (void) = 0;
134
135    // methods to copy depends parameters
136    // (these parameters can't be static : because can have multi instance of toplevel)
137  public   : virtual void               copy        (void) = 0; 
138//public   :         void               copy        (Parameters * param);
139  public   :         void               duplicate   (Parameters * param);
140
141    // methods to test
142  public   :         void               test        (void);
143  };
144}; // end namespace behavioural         
145}; // end namespace morpheo             
146
147#endif
Note: See TracBrowser for help on using the repository browser.