1 | /* |
---|
2 | * $Id: Address_management_allocation.cpp 135 2009-07-17 08:59:05Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/include/Address_management.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace ifetch_unit { |
---|
17 | namespace address_management { |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Address_management::allocation" |
---|
21 | void Address_management::allocation ( |
---|
22 | #ifdef STATISTICS |
---|
23 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
24 | #else |
---|
25 | void |
---|
26 | #endif |
---|
27 | ) |
---|
28 | { |
---|
29 | log_printf(FUNC,Address_management,FUNCTION,"Begin"); |
---|
30 | |
---|
31 | _component = new Component (_usage); |
---|
32 | |
---|
33 | Entity * entity = _component->set_entity (_name |
---|
34 | ,"Address_management" |
---|
35 | #ifdef POSITION |
---|
36 | ,COMBINATORY |
---|
37 | #endif |
---|
38 | ); |
---|
39 | |
---|
40 | _interfaces = entity->set_interfaces(); |
---|
41 | |
---|
42 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
43 | { |
---|
44 | Interface * interface = _interfaces->set_interface("" |
---|
45 | #ifdef POSITION |
---|
46 | ,IN |
---|
47 | ,SOUTH, |
---|
48 | "Generalist interface" |
---|
49 | #endif |
---|
50 | ); |
---|
51 | |
---|
52 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
53 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
54 | } |
---|
55 | |
---|
56 | // ~~~~~[ Interface : "address" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
57 | { |
---|
58 | ALLOC0_INTERFACE_BEGIN("address", OUT, SOUTH, _("Access at request icache.")); |
---|
59 | |
---|
60 | ALLOC0_VALACK_OUT (out_ADDRESS_VAL ,VAL); |
---|
61 | ALLOC0_VALACK_IN ( in_ADDRESS_ACK ,ACK); |
---|
62 | ALLOC0_SIGNAL_OUT (out_ADDRESS_INSTRUCTION_ADDRESS ,"instruction_address" ,Tgeneral_address_t,_param->_size_instruction_address ); |
---|
63 | ALLOC0_SIGNAL_OUT (out_ADDRESS_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr ); |
---|
64 | ALLOC0_SIGNAL_OUT (out_ADDRESS_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); |
---|
65 | ALLOC0_SIGNAL_OUT (out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); |
---|
66 | |
---|
67 | ALLOC0_INTERFACE_END(); |
---|
68 | } |
---|
69 | |
---|
70 | { |
---|
71 | ALLOC1_INTERFACE_BEGIN("address", OUT, SOUTH, _("Access at request icache."),_param->_nb_instruction); |
---|
72 | INTERFACE1_TEST(false,_param->_nb_instruction); |
---|
73 | |
---|
74 | ALLOC1_SIGNAL_OUT(out_ADDRESS_INSTRUCTION_ENABLE ,"instruction_enable" ,Tcontrol_t ,1); |
---|
75 | |
---|
76 | ALLOC1_INTERFACE_END(_param->_nb_instruction); |
---|
77 | } |
---|
78 | |
---|
79 | // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
80 | { |
---|
81 | ALLOC0_INTERFACE_BEGIN("predict", IN, NORTH, _("Request the prediction unit.")); |
---|
82 | |
---|
83 | ALLOC0_VALACK_OUT (out_PREDICT_VAL ,VAL); |
---|
84 | ALLOC0_VALACK_IN ( in_PREDICT_ACK ,ACK); |
---|
85 | ALLOC0_SIGNAL_OUT (out_PREDICT_PC_PREVIOUS ,"pc_previous" ,Tgeneral_address_t,_param->_size_instruction_address); |
---|
86 | ALLOC0_SIGNAL_OUT (out_PREDICT_PC_CURRENT ,"pc_current" ,Tgeneral_address_t,_param->_size_instruction_address); |
---|
87 | ALLOC0_SIGNAL_OUT (out_PREDICT_PC_CURRENT_IS_DS_TAKE ,"pc_current_is_ds_take" ,Tcontrol_t ,1); |
---|
88 | ALLOC0_SIGNAL_IN ( in_PREDICT_PC_NEXT ,"pc_next" ,Tgeneral_address_t,_param->_size_instruction_address); |
---|
89 | ALLOC0_SIGNAL_IN ( in_PREDICT_PC_NEXT_IS_DS_TAKE ,"pc_next_is_ds_take" ,Tcontrol_t ,1); |
---|
90 | // ALLOC0_SIGNAL_IN ( in_PREDICT_BRANCH_IS_CURRENT ,"branch_is_current" ,Tcontrol_t ,1); |
---|
91 | ALLOC0_SIGNAL_IN ( in_PREDICT_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state); |
---|
92 | ALLOC0_SIGNAL_IN ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); |
---|
93 | ALLOC0_SIGNAL_IN ( in_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr); |
---|
94 | |
---|
95 | ALLOC0_INTERFACE_END(); |
---|
96 | } |
---|
97 | { |
---|
98 | ALLOC1_INTERFACE_BEGIN("predict", IN, NORTH, _("Request the prediction unit."),_param->_nb_instruction); |
---|
99 | INTERFACE1_TEST(false,_param->_nb_instruction); |
---|
100 | |
---|
101 | ALLOC1_SIGNAL_IN (in_PREDICT_INSTRUCTION_ENABLE ,"instruction_enable" ,Tcontrol_t ,1); |
---|
102 | |
---|
103 | ALLOC1_INTERFACE_END(_param->_nb_instruction); |
---|
104 | } |
---|
105 | |
---|
106 | // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
107 | { |
---|
108 | ALLOC0_INTERFACE_BEGIN("event", IN, SOUTH, _("Event (miss, exception ...)")); |
---|
109 | |
---|
110 | ALLOC0_VALACK_IN ( in_EVENT_VAL ,VAL); |
---|
111 | ALLOC0_VALACK_OUT(out_EVENT_ACK ,ACK); |
---|
112 | ALLOC0_SIGNAL_IN ( in_EVENT_ADDRESS ,"address" ,Tgeneral_address_t,_param->_size_instruction_address); |
---|
113 | ALLOC0_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT ,"address_next" ,Tgeneral_address_t,_param->_size_instruction_address); |
---|
114 | ALLOC0_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT_VAL,"address_next_val",Tcontrol_t,1); |
---|
115 | ALLOC0_SIGNAL_IN ( in_EVENT_IS_DS_TAKE ,"is_ds_take" ,Tcontrol_t,1); |
---|
116 | |
---|
117 | ALLOC0_INTERFACE_END(); |
---|
118 | } |
---|
119 | |
---|
120 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
121 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
122 | { |
---|
123 | ALLOC1(reg_PC_ACCESS_INSTRUCTION_ENABLE ,Tcontrol_t,_param->_nb_instruction); |
---|
124 | ALLOC1(reg_PC_CURRENT_INSTRUCTION_ENABLE,Tcontrol_t,_param->_nb_instruction); |
---|
125 | ALLOC1(reg_PC_NEXT_INSTRUCTION_ENABLE ,Tcontrol_t,_param->_nb_instruction); |
---|
126 | } |
---|
127 | |
---|
128 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
129 | #ifdef POSITION |
---|
130 | if (usage_is_set(_usage,USE_POSITION)) |
---|
131 | _component->generate_file(); |
---|
132 | #endif |
---|
133 | |
---|
134 | log_printf(FUNC,Address_management,FUNCTION,"End"); |
---|
135 | }; |
---|
136 | |
---|
137 | }; // end namespace address_management |
---|
138 | }; // end namespace ifetch_unit |
---|
139 | }; // end namespace front_end |
---|
140 | }; // end namespace multi_front_end |
---|
141 | }; // end namespace core |
---|
142 | |
---|
143 | }; // end namespace behavioural |
---|
144 | }; // end namespace morpheo |
---|