[2] | 1 | #ifndef morpheo_behavioural_Parameters_h |
---|
| 2 | #define morpheo_behavioural_Parameters_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
[77] | 7 | * [ Description ] |
---|
[2] | 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include <stdint.h> |
---|
| 12 | #include <iostream> |
---|
| 13 | #include <math.h> |
---|
| 14 | #include "Behavioural/include/Environnement.h" |
---|
[72] | 15 | #include "Behavioural/include/Constants.h" |
---|
[78] | 16 | #include "Behavioural/include/Test.h" |
---|
[44] | 17 | #include "Common/include/ErrorMorpheo.h" |
---|
| 18 | #include "Common/include/ToString.h" |
---|
[62] | 19 | #include "Common/include/Log2.h" |
---|
[44] | 20 | #include "Common/include/Debug.h" |
---|
[2] | 21 | |
---|
| 22 | namespace morpheo { |
---|
| 23 | namespace behavioural { |
---|
| 24 | |
---|
[78] | 25 | class Parameters_test |
---|
| 26 | { |
---|
| 27 | private : std::string _component; |
---|
| 28 | protected : std::string _error; |
---|
| 29 | protected : std::string _warning; |
---|
| 30 | protected : std::string _information; |
---|
| 31 | |
---|
| 32 | public : Parameters_test (std::string component) |
---|
| 33 | { |
---|
| 34 | _component = component; |
---|
| 35 | _error = ""; |
---|
| 36 | _warning = ""; |
---|
| 37 | }; |
---|
| 38 | public : ~Parameters_test (void) {}; |
---|
| 39 | |
---|
| 40 | public : bool have_error (void) { return (_error.length() != 0);}; |
---|
| 41 | public : void error (std::string str) { _error += "[ ERROR ] <" + _component + "> " + str + "\n";} |
---|
| 42 | public : void warning (std::string str) { _warning += "[ WARNING ] <" + _component + "> " + str + "\n";} |
---|
| 43 | public : void information (std::string str) { _information += "[INFORMATION] <" + _component + "> " + str + "\n";} |
---|
| 44 | public : std::string print (void) { return _error + _warning + _information;}; |
---|
| 45 | }; |
---|
| 46 | |
---|
[2] | 47 | // Virtual Class - Interface of each component |
---|
| 48 | class Parameters |
---|
| 49 | { |
---|
[77] | 50 | // -----[ fields ]---------------------------------------------------- |
---|
[78] | 51 | public : static const uint32_t _size_instruction = 32; |
---|
| 52 | public : static const uint32_t _nb_operation = MAX_OPERATION; |
---|
| 53 | public : static const uint32_t _nb_type = MAX_TYPE; |
---|
| 54 | public : static const uint32_t _size_operation = SIZE_OPERATION; |
---|
| 55 | public : static const uint32_t _size_type = SIZE_TYPE; |
---|
| 56 | public : static const uint32_t _size_exception = SIZE_EXCEPTION; |
---|
| 57 | public : static const uint32_t _size_exception_use = SIZE_EXCEPTION_USE; |
---|
| 58 | public : static const uint32_t _size_exception_memory = SIZE_EXCEPTION_MEMORY; |
---|
| 59 | public : static const uint32_t _size_exception_custom = SIZE_EXCEPTION_CUSTOM; |
---|
| 60 | public : static const uint32_t _size_exception_alu = SIZE_EXCEPTION_ALU ; |
---|
| 61 | public : static const uint32_t _size_exception_decod = SIZE_EXCEPTION_DECOD ; |
---|
| 62 | public : static const uint32_t _size_exception_ifetch = SIZE_EXCEPTION_IFETCH; |
---|
| 63 | public : static const uint32_t _size_icache_type = SIZE_ICACHE_TYPE; |
---|
| 64 | public : static const uint32_t _size_icache_error = SIZE_ICACHE_ERROR; |
---|
| 65 | public : static const uint32_t _size_dcache_type = SIZE_DCACHE_TYPE; |
---|
| 66 | public : static const uint32_t _size_dcache_error = SIZE_DCACHE_ERROR; |
---|
| 67 | public : static const uint32_t _nb_general_register_logic = 32; |
---|
| 68 | public : static const uint32_t _nb_special_register_logic = NB_SPR_LOGIC; |
---|
| 69 | public : static const uint32_t _size_general_register_logic = 5; |
---|
| 70 | public : static const uint32_t _size_special_register_logic = LOG2_NB_SPR_LOGIC; |
---|
| 71 | public : static const uint32_t _size_event_state = SIZE_EVENT_STATE; |
---|
| 72 | public : static const uint32_t _size_event_type = SIZE_EVENT_TYPE; |
---|
| 73 | public : static const uint32_t _size_branch_state = SIZE_BRANCH_STATE; |
---|
| 74 | public : static const uint32_t _size_branch_condition = SIZE_BRANCH_CONDITION; |
---|
[2] | 75 | |
---|
[77] | 76 | // -----[ methods ]--------------------------------------------------- |
---|
[78] | 77 | public : Parameters (void); |
---|
| 78 | public : virtual ~Parameters (); |
---|
[2] | 79 | |
---|
| 80 | // methods to print and test parameters |
---|
[78] | 81 | public : virtual std::string print (uint32_t depth) = 0; |
---|
| 82 | public : virtual Parameters_test msg_error (void) = 0; |
---|
[2] | 83 | |
---|
| 84 | // methods to generate configuration file |
---|
| 85 | |
---|
| 86 | // methods to test |
---|
[78] | 87 | public : void test (void); |
---|
[2] | 88 | }; |
---|
| 89 | }; // end namespace behavioural |
---|
| 90 | }; // end namespace morpheo |
---|
| 91 | |
---|
| 92 | #endif |
---|