[2] | 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 | * |
---|
[77] | 7 | * [ Description ] |
---|
[2] | 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
[88] | 11 | #include "Common/include/Environment.h" |
---|
| 12 | #include "Behavioural/include/Parameters_test.h" |
---|
[72] | 13 | #include "Behavioural/include/Constants.h" |
---|
[78] | 14 | #include "Behavioural/include/Test.h" |
---|
[44] | 15 | #include "Common/include/ErrorMorpheo.h" |
---|
| 16 | #include "Common/include/ToString.h" |
---|
[62] | 17 | #include "Common/include/Log2.h" |
---|
[44] | 18 | #include "Common/include/Debug.h" |
---|
[88] | 19 | #include <stdint.h> |
---|
| 20 | #include <iostream> |
---|
| 21 | #include <math.h> |
---|
[2] | 22 | |
---|
| 23 | namespace morpheo { |
---|
| 24 | namespace behavioural { |
---|
[88] | 25 | |
---|
| 26 | #ifdef COPY |
---|
| 27 | #error "Need COPY macro" |
---|
| 28 | #endif |
---|
[2] | 29 | |
---|
[88] | 30 | #define COPY(param) do {duplicate(param); param->copy();} while (0) |
---|
[81] | 31 | |
---|
[2] | 32 | // Virtual Class - Interface of each component |
---|
| 33 | class Parameters |
---|
| 34 | { |
---|
[77] | 35 | // -----[ fields ]---------------------------------------------------- |
---|
[88] | 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; |
---|
[2] | 63 | |
---|
[88] | 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 | |
---|
[77] | 127 | // -----[ methods ]--------------------------------------------------- |
---|
[81] | 128 | public : Parameters (void); |
---|
| 129 | public : virtual ~Parameters (); |
---|
[2] | 130 | |
---|
| 131 | // methods to print and test parameters |
---|
[81] | 132 | public : virtual std::string print (uint32_t depth) = 0; |
---|
| 133 | public : virtual Parameters_test msg_error (void) = 0; |
---|
[2] | 134 | |
---|
[88] | 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 | |
---|
[2] | 141 | // methods to test |
---|
[81] | 142 | public : void test (void); |
---|
[2] | 143 | }; |
---|
| 144 | }; // end namespace behavioural |
---|
| 145 | }; // end namespace morpheo |
---|
| 146 | |
---|
| 147 | #endif |
---|