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 | class spr_address_t |
---|
13 | { |
---|
14 | public : Tgeneral_data_t _group; |
---|
15 | public : Tgeneral_data_t _register; |
---|
16 | |
---|
17 | public : spr_address_t (void) {}; |
---|
18 | public : spr_address_t (Tgeneral_data_t grp, |
---|
19 | Tgeneral_data_t reg) |
---|
20 | { |
---|
21 | _group = grp; |
---|
22 | _register = reg; |
---|
23 | }; |
---|
24 | }; |
---|
25 | |
---|
26 | class SPR_access_mode |
---|
27 | { |
---|
28 | private : spr_access_mode_t ** _spr_generic ; //[NB_GROUP][NB_REG_GROUP] |
---|
29 | private : uint32_t * _max_register_by_group; //[NB_GROUP] |
---|
30 | |
---|
31 | public : SPR_access_mode(); |
---|
32 | public : ~SPR_access_mode(); |
---|
33 | |
---|
34 | public : spr_address_t translate_address (Tgeneral_data_t address); |
---|
35 | |
---|
36 | public : bool valid (uint32_t num_group, uint32_t num_reg); |
---|
37 | public : bool valid (spr_address_t address); |
---|
38 | public : bool exist (uint32_t num_group, uint32_t num_reg); |
---|
39 | public : bool exist (spr_address_t address); |
---|
40 | public : bool read (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA); |
---|
41 | public : bool write (spr_address_t address, Tcontrol_t SM, Tcontrol_t SUMRA); |
---|
42 | public : spr_access_mode_t get_mode (uint32_t num_group, uint32_t num_reg); |
---|
43 | public : spr_access_mode_t get_mode (spr_address_t address); |
---|
44 | |
---|
45 | public : void implement_group (uint32_t num_group, uint32_t nb_reg); |
---|
46 | public : uint32_t implement_group (uint32_t num_group); |
---|
47 | public : void change_mode (uint32_t num_group, uint32_t num_reg, spr_access_mode_t new_mode); |
---|
48 | public : void invalid_register(uint32_t num_group, uint32_t num_reg); |
---|
49 | }; |
---|
50 | |
---|
51 | |
---|
52 | }; // end namespace behavioural |
---|
53 | }; // end namespace morpheo |
---|
54 | #endif |
---|
55 | |
---|