[72] | 1 | #ifndef morpheo_behavioural_SPR_access_mode_h |
---|
| 2 | #define morpheo_behavioural_SPR_access_mode_h |
---|
| 3 | |
---|
| 4 | #include "Common/include/BitManipulation.h" |
---|
| 5 | #include "Common/include/ErrorMorpheo.h" |
---|
| 6 | #include "Behavioural/include/Constants.h" |
---|
| 7 | #include "Behavioural/include/Types.h" |
---|
| 8 | |
---|
| 9 | namespace morpheo { |
---|
| 10 | namespace behavioural { |
---|
| 11 | |
---|
| 12 | typedef struct |
---|
| 13 | { |
---|
| 14 | Tgeneral_data_t _group; |
---|
| 15 | Tgeneral_data_t _register; |
---|
| 16 | } spr_address_t; |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | class SPR_access_mode |
---|
| 20 | { |
---|
| 21 | private : spr_access_mode_t ** _spr_generic; |
---|
| 22 | private : uint32_t * _max_register_by_group; |
---|
| 23 | |
---|
| 24 | public : SPR_access_mode(); |
---|
| 25 | public : ~SPR_access_mode(); |
---|
| 26 | |
---|
| 27 | public : spr_address_t translate_address (Tgeneral_data_t address); |
---|
| 28 | |
---|
| 29 | public : bool valid (uint32_t num_group, uint32_t num_reg); |
---|
| 30 | public : bool valid (spr_address_t address); |
---|
| 31 | public : bool read (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA); |
---|
| 32 | public : bool write (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA); |
---|
| 33 | |
---|
| 34 | public : void implement_group (uint32_t num_group, uint32_t nb_reg); |
---|
| 35 | public : uint32_t implement_group (uint32_t num_group); |
---|
| 36 | public : void change_mode (uint32_t num_group, uint32_t num_reg, spr_access_mode_t new_mode); |
---|
| 37 | }; |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | }; // end namespace behavioural |
---|
| 41 | }; // end namespace morpheo |
---|
| 42 | #endif |
---|
| 43 | |
---|