1 | /* |
---|
2 | * $Id: Load_Store_pointer_unit_allocation.cpp 122 2009-06-03 08:15:51Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_ooo_engine { |
---|
15 | namespace ooo_engine { |
---|
16 | namespace rename_unit { |
---|
17 | namespace load_store_pointer_unit { |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | #undef FUNCTION |
---|
22 | #define FUNCTION "Load_Store_pointer_unit::allocation" |
---|
23 | void Load_Store_pointer_unit::allocation ( |
---|
24 | #ifdef STATISTICS |
---|
25 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
26 | #else |
---|
27 | void |
---|
28 | #endif |
---|
29 | ) |
---|
30 | { |
---|
31 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin"); |
---|
32 | |
---|
33 | _component = new Component (_usage); |
---|
34 | |
---|
35 | Entity * entity = _component->set_entity (_name |
---|
36 | ,"Load_Store_pointer_unit" |
---|
37 | #ifdef POSITION |
---|
38 | ,COMBINATORY |
---|
39 | #endif |
---|
40 | ); |
---|
41 | |
---|
42 | _interfaces = entity->set_interfaces(); |
---|
43 | |
---|
44 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
45 | { |
---|
46 | Interface * interface = _interfaces->set_interface("" |
---|
47 | #ifdef POSITION |
---|
48 | ,IN |
---|
49 | ,SOUTH, |
---|
50 | "Generalist interface" |
---|
51 | #endif |
---|
52 | ); |
---|
53 | |
---|
54 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
55 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
56 | } |
---|
57 | |
---|
58 | // ~~~~~[ Interface : "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
59 | { |
---|
60 | ALLOC1_INTERFACE_BEGIN("insert", IN, EAST, _("insert to the re order buffer an instruction"), _param->_nb_inst_insert); |
---|
61 | |
---|
62 | ALLOC1_VALACK_IN ( in_INSERT_VAL ,VAL); |
---|
63 | ALLOC1_VALACK_OUT(out_INSERT_ACK ,ACK); |
---|
64 | ALLOC1_SIGNAL_IN ( in_INSERT_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); |
---|
65 | ALLOC1_SIGNAL_IN ( in_INSERT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
66 | ALLOC1_SIGNAL_IN ( in_INSERT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
67 | ALLOC1_SIGNAL_IN ( in_INSERT_OPERATION ,"operation" ,Toperation_t,_param->_size_operation ); |
---|
68 | ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); |
---|
69 | ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); |
---|
70 | ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1 ); |
---|
71 | ALLOC1_SIGNAL_OUT(out_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); |
---|
72 | |
---|
73 | ALLOC1_INTERFACE_END(_param->_nb_inst_insert); |
---|
74 | } |
---|
75 | |
---|
76 | // ~~~~~[ Interface : "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
77 | { |
---|
78 | ALLOC1_INTERFACE_BEGIN("retire", IN, EAST, _("retire from the re order buffer an instruction"), _param->_nb_inst_retire); |
---|
79 | |
---|
80 | ALLOC1_VALACK_IN ( in_RETIRE_VAL ,VAL); |
---|
81 | ALLOC1_VALACK_OUT(out_RETIRE_ACK ,ACK); |
---|
82 | ALLOC1_SIGNAL_IN ( in_RETIRE_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); |
---|
83 | ALLOC1_SIGNAL_IN ( in_RETIRE_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
84 | // ALLOC1_SIGNAL_IN ( in_RETIRE_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
85 | // ALLOC1_SIGNAL_IN ( in_RETIRE_OPERATION ,"operation" ,Toperation_t,_param->_size_operation ); |
---|
86 | ALLOC1_SIGNAL_IN ( in_RETIRE_USE_STORE_QUEUE ,"use_store_queue" ,Tcontrol_t ,1); |
---|
87 | ALLOC1_SIGNAL_IN ( in_RETIRE_USE_LOAD_QUEUE ,"use_load_queue" ,Tcontrol_t ,1); |
---|
88 | ALLOC1_SIGNAL_IN ( in_RETIRE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); |
---|
89 | ALLOC1_SIGNAL_IN ( in_RETIRE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); |
---|
90 | |
---|
91 | ALLOC1_INTERFACE_END(_param->_nb_inst_retire); |
---|
92 | } |
---|
93 | |
---|
94 | // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
95 | { |
---|
96 | ALLOC2_INTERFACE_BEGIN("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]); |
---|
97 | |
---|
98 | _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_VAL ,VAL,_param->_nb_front_end, _param->_nb_context[it1]); |
---|
99 | _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_ACK ,ACK,_param->_nb_front_end, _param->_nb_context[it1]); |
---|
100 | _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE ,"state" ,Tevent_state_t ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]); |
---|
101 | |
---|
102 | ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]); |
---|
103 | } |
---|
104 | |
---|
105 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
106 | { |
---|
107 | ALLOC1(reg_STORE_QUEUE_PTR_WRITE ,Tlsq_ptr_t ,_param->_nb_load_store_queue); |
---|
108 | ALLOC2(reg_STORE_QUEUE_PTR_READ ,Tlsq_ptr_t ,_param->_nb_front_end, _param->_nb_context[it1]); |
---|
109 | ALLOC2(reg_STORE_QUEUE_EMPTY ,bool ,_param->_nb_front_end, _param->_nb_context[it1]); |
---|
110 | ALLOC2(reg_STORE_QUEUE_USE ,bool ,_param->_nb_load_store_queue,_param->_size_store_queue [it1]); |
---|
111 | ALLOC1(reg_STORE_QUEUE_NB_USE ,Tlsq_ptr_t ,_param->_nb_load_store_queue); |
---|
112 | ALLOC1(reg_LOAD_QUEUE_PTR_WRITE ,Tlsq_ptr_t ,_param->_nb_load_store_queue); |
---|
113 | ALLOC2(reg_LOAD_QUEUE_USE ,bool ,_param->_nb_load_store_queue,_param->_size_load_queue [it1]); |
---|
114 | |
---|
115 | ALLOC1(internal_INSERT_ACK ,Tcontrol_t ,_param->_nb_inst_insert); |
---|
116 | ALLOC1(internal_INSERT_OPERATION_USE ,operation_use_t,_param->_nb_inst_insert); |
---|
117 | ALLOC1(internal_INSERT_LSQ ,uint32_t ,_param->_nb_inst_insert); |
---|
118 | ALLOC1(internal_INSERT_PTR ,Tlsq_ptr_t ,_param->_nb_inst_insert); |
---|
119 | |
---|
120 | ALLOC1(internal_RETIRE_ACK ,Tcontrol_t ,_param->_nb_inst_retire); |
---|
121 | ALLOC1(internal_RETIRE_OPERATION_USE ,operation_use_t,_param->_nb_inst_retire); |
---|
122 | ALLOC1(internal_RETIRE_LSQ ,uint32_t ,_param->_nb_inst_retire); |
---|
123 | ALLOC1(internal_RETIRE_PTR ,Tlsq_ptr_t ,_param->_nb_inst_retire); |
---|
124 | |
---|
125 | ALLOC2(internal_RETIRE_EVENT_ACK ,Tcontrol_t ,_param->_nb_front_end,_param->_nb_context[it1]); |
---|
126 | } |
---|
127 | |
---|
128 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
129 | |
---|
130 | #ifdef POSITION |
---|
131 | if (usage_is_set(_usage,USE_POSITION)) |
---|
132 | _component->generate_file(); |
---|
133 | #endif |
---|
134 | |
---|
135 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End"); |
---|
136 | }; |
---|
137 | |
---|
138 | }; // end namespace load_store_pointer_unit |
---|
139 | }; // end namespace rename_unit |
---|
140 | }; // end namespace ooo_engine |
---|
141 | }; // end namespace multi_ooo_engine |
---|
142 | }; // end namespace core |
---|
143 | |
---|
144 | }; // end namespace behavioural |
---|
145 | }; // end namespace morpheo |
---|