1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_instruction_Types_h |
---|
2 | #define morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_instruction_Types_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Types.h 137 2010-02-16 12:35:48Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #include "Common/include/BitManipulation.h" |
---|
12 | #include "Common/include/Log2.h" |
---|
13 | #include "Behavioural/include/Types.h" |
---|
14 | |
---|
15 | namespace morpheo { |
---|
16 | namespace behavioural { |
---|
17 | namespace core { |
---|
18 | namespace multi_front_end { |
---|
19 | namespace front_end { |
---|
20 | namespace decod_unit { |
---|
21 | namespace decod { |
---|
22 | |
---|
23 | typedef struct |
---|
24 | { |
---|
25 | // set by ifetch |
---|
26 | Tinstruction_t _instruction ; |
---|
27 | Tgeneral_data_t _address_previous ; |
---|
28 | Tgeneral_data_t _address ; |
---|
29 | Tgeneral_data_t _address_next ; // if event, is address_epcr |
---|
30 | Tcontext_t _context_id ; |
---|
31 | Tcontrol_t _is_delay_slot ; |
---|
32 | // Tbranch_state_t _branch_state ; |
---|
33 | // Tprediction_ptr_t _branch_update_prediction_id; |
---|
34 | |
---|
35 | // set by predictor |
---|
36 | // Tdepth_t _depth ; |
---|
37 | |
---|
38 | // set by decod |
---|
39 | #ifdef STATISTICS |
---|
40 | uint32_t _opcod ; |
---|
41 | #endif |
---|
42 | Ttype_t _type ; |
---|
43 | Toperation_t _operation ; |
---|
44 | Tcontrol_t _no_execute ; |
---|
45 | Tcontrol_t _has_immediat ; |
---|
46 | Tgeneral_data_t _immediat ; |
---|
47 | Tcontrol_t _read_ra ; |
---|
48 | Tgeneral_address_t _num_reg_ra ; |
---|
49 | Tcontrol_t _read_rb ; |
---|
50 | Tgeneral_address_t _num_reg_rb ; |
---|
51 | Tcontrol_t _read_rc ; |
---|
52 | Tspecial_address_t _num_reg_rc ; |
---|
53 | Tcontrol_t _write_rd ; |
---|
54 | Tgeneral_address_t _num_reg_rd ; |
---|
55 | Tcontrol_t _write_re ; |
---|
56 | Tspecial_address_t _num_reg_re ; |
---|
57 | Texception_t _exception_use ; |
---|
58 | Texception_t _exception ; |
---|
59 | Tbranch_condition_t _branch_condition ; |
---|
60 | // Tcontrol_t _branch_stack_write; |
---|
61 | Tcontrol_t _branch_direction ; |
---|
62 | Tevent_type_t _event_type ; |
---|
63 | } decod_instruction_t; |
---|
64 | |
---|
65 | class decod_param_t |
---|
66 | { |
---|
67 | public : uint32_t _size_data ; |
---|
68 | public : Tgeneral_data_t _mask_data ; |
---|
69 | public : Tgeneral_data_t _mask_shift; |
---|
70 | public : void (*** _function_decod ) (decod_instruction_t *, decod_param_t *); // [type][opcod] |
---|
71 | public : void (*** _function_custom) (decod_instruction_t *, decod_param_t *); // [type][opcod] |
---|
72 | |
---|
73 | public : decod_param_t (uint32_t size_data, |
---|
74 | void (*** function_decod ) (decod_instruction_t *, decod_param_t *), |
---|
75 | void (*** function_custom) (decod_instruction_t *, decod_param_t *)) |
---|
76 | { |
---|
77 | _size_data = size_data; |
---|
78 | _mask_data = gen_mask<Tgeneral_data_t> (size_data); |
---|
79 | _mask_shift = gen_mask<Tgeneral_data_t> (log2(size_data)); |
---|
80 | _function_decod = function_decod; |
---|
81 | _function_custom = function_custom; |
---|
82 | }; |
---|
83 | public : ~decod_param_t (void) |
---|
84 | { |
---|
85 | }; |
---|
86 | }; |
---|
87 | |
---|
88 | |
---|
89 | typedef void function_decod_t |
---|
90 | (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_instruction_t *, |
---|
91 | morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_param_t *); |
---|
92 | |
---|
93 | |
---|
94 | }; // end namespace decod |
---|
95 | }; // end namespace decod_unit |
---|
96 | }; // end namespace front_end |
---|
97 | }; // end namespace multi_front_end |
---|
98 | }; // end namespace core |
---|
99 | }; // end namespace behavioural |
---|
100 | }; // end namespace morpheo |
---|
101 | |
---|
102 | #endif |
---|