- Timestamp:
- Mar 27, 2008, 11:04:49 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
r77 r78 14 14 #include "Behavioural/include/Environnement.h" 15 15 #include "Behavioural/include/Constants.h" 16 #include "Behavioural/include/Test.h" 16 17 #include "Common/include/ErrorMorpheo.h" 17 18 #include "Common/include/ToString.h" … … 22 23 namespace behavioural { 23 24 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 24 47 // Virtual Class - Interface of each component 25 48 class Parameters 26 49 { 27 50 // -----[ fields ]---------------------------------------------------- 28 public : static const uint32_t _nb_operation = MAX_OPERATION; 29 public : static const uint32_t _nb_type = MAX_TYPE; 30 public : static const uint32_t _size_operation = SIZE_OPERATION; 31 public : static const uint32_t _size_type = SIZE_TYPE; 32 public : static const uint32_t _size_exception = SIZE_EXCEPTION; 33 public : static const uint32_t _size_dcache_type = SIZE_DCACHE_TYPE; 34 public : static const uint32_t _size_dcache_error = SIZE_DCACHE_ERROR; 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; 35 75 36 76 // -----[ methods ]--------------------------------------------------- 37 public : Parameters(void);38 public : virtual ~Parameters ();77 public : Parameters (void); 78 public : virtual ~Parameters (); 39 79 40 80 // methods to print and test parameters 41 public : virtual std::string print (uint32_t depth) = 0;42 public : virtual std::stringmsg_error (void) = 0;81 public : virtual std::string print (uint32_t depth) = 0; 82 public : virtual Parameters_test msg_error (void) = 0; 43 83 44 84 // methods to generate configuration file 45 46 85 47 86 // methods to test 48 public : void test (void); 49 public : bool is_natural (double val ); 50 public : bool is_positive (double val ); 51 public : bool is_multiple (uint32_t val1, 52 uint32_t val2); 53 public : bool is_between_inclusive (uint32_t val, 54 uint32_t min, 55 uint32_t max); 56 public : bool is_between_exclusive (uint32_t val, 57 uint32_t min, 58 uint32_t max); 87 public : void test (void); 59 88 }; 60 61 89 }; // end namespace behavioural 62 90 }; // end namespace morpheo
Note: See TracChangeset
for help on using the changeset viewer.