1 | /* |
---|
2 | * $Id: Free_List_unit_allocation.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_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 register_translation_unit { |
---|
18 | namespace free_list_unit { |
---|
19 | |
---|
20 | |
---|
21 | |
---|
22 | #undef FUNCTION |
---|
23 | #define FUNCTION "Free_List_unit::allocation" |
---|
24 | void Free_List_unit::allocation ( |
---|
25 | #ifdef STATISTICS |
---|
26 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
27 | #else |
---|
28 | void |
---|
29 | #endif |
---|
30 | ) |
---|
31 | { |
---|
32 | log_printf(FUNC,Free_List_unit,FUNCTION,"Begin"); |
---|
33 | |
---|
34 | _component = new Component (_usage); |
---|
35 | |
---|
36 | Entity * entity = _component->set_entity (_name |
---|
37 | ,"Free_List_unit" |
---|
38 | #ifdef POSITION |
---|
39 | ,COMBINATORY |
---|
40 | #endif |
---|
41 | ); |
---|
42 | |
---|
43 | _interfaces = entity->set_interfaces(); |
---|
44 | |
---|
45 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
46 | |
---|
47 | Interface * interface = _interfaces->set_interface("" |
---|
48 | #ifdef POSITION |
---|
49 | ,IN |
---|
50 | ,SOUTH, |
---|
51 | _("Generalist interface") |
---|
52 | #endif |
---|
53 | ); |
---|
54 | |
---|
55 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
56 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
57 | |
---|
58 | // ~~~~~[ interface : "pop" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
59 | { |
---|
60 | ALLOC1_INTERFACE_BEGIN("pop", IN, NORTH, _("New destination register"), _param->_nb_pop); |
---|
61 | |
---|
62 | ALLOC1_VALACK_IN ( in_POP_VAL ,VAL); |
---|
63 | ALLOC1_VALACK_OUT(out_POP_ACK ,ACK); |
---|
64 | ALLOC1_SIGNAL_IN ( in_POP_GPR_VAL ,"gpr_val" ,Tcontrol_t ,1 ); |
---|
65 | ALLOC1_SIGNAL_OUT(out_POP_GPR_NUM_REG,"gpr_num_reg",Tgeneral_address_t,_param->_size_general_register); |
---|
66 | ALLOC1_SIGNAL_IN ( in_POP_SPR_VAL ,"spr_val" ,Tcontrol_t ,1 ); |
---|
67 | ALLOC1_SIGNAL_OUT(out_POP_SPR_NUM_REG,"spr_num_reg",Tspecial_address_t,_param->_size_special_register); |
---|
68 | |
---|
69 | ALLOC1_INTERFACE_END(_param->_nb_pop); |
---|
70 | } |
---|
71 | |
---|
72 | // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
73 | { |
---|
74 | ALLOC1_INTERFACE_BEGIN("push_gpr", IN, NORTH, _("General register free"), _param->_nb_push); |
---|
75 | |
---|
76 | ALLOC1_VALACK_IN ( in_PUSH_GPR_VAL ,VAL); |
---|
77 | ALLOC1_VALACK_OUT(out_PUSH_GPR_ACK ,ACK); |
---|
78 | ALLOC1_SIGNAL_IN ( in_PUSH_GPR_NUM_REG,"num_reg",Tgeneral_address_t,_param->_size_general_register); |
---|
79 | |
---|
80 | ALLOC1_INTERFACE_END(_param->_nb_push); |
---|
81 | } |
---|
82 | |
---|
83 | // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
84 | { |
---|
85 | ALLOC1_INTERFACE_BEGIN("push_spr", IN, NORTH, _("General register free"), _param->_nb_push); |
---|
86 | |
---|
87 | ALLOC1_VALACK_IN ( in_PUSH_SPR_VAL ,VAL); |
---|
88 | ALLOC1_VALACK_OUT(out_PUSH_SPR_ACK ,ACK); |
---|
89 | ALLOC1_SIGNAL_IN ( in_PUSH_SPR_NUM_REG,"num_reg",Tspecial_address_t,_param->_size_special_register); |
---|
90 | |
---|
91 | ALLOC1_INTERFACE_END(_param->_nb_push); |
---|
92 | } |
---|
93 | |
---|
94 | // ~~~~~[ interface : "info" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
95 | #ifdef DEBUG_TEST |
---|
96 | { |
---|
97 | ALLOC0_INTERFACE_BEGIN("info",OUT, NORTH, _("Information")); |
---|
98 | |
---|
99 | ALLOC0_SIGNAL_OUT(out_INFO_NB_GPR_FREE,"nb_gpr_free",uint32_t,_param->_size_general_register+1); |
---|
100 | ALLOC0_SIGNAL_OUT(out_INFO_NB_SPR_FREE,"nb_spr_free",uint32_t,_param->_size_special_register+1); |
---|
101 | |
---|
102 | ALLOC0_INTERFACE_END(); |
---|
103 | } |
---|
104 | #endif |
---|
105 | |
---|
106 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
107 | { |
---|
108 | ALLOC1(_gpr_list,std::list<uint32_t>,_param->_nb_bank); |
---|
109 | ALLOC1(_spr_list,std::list<uint32_t>,_param->_nb_bank); |
---|
110 | |
---|
111 | ALLOC1(internal_POP_ACK ,Tcontrol_t,_param->_nb_pop); |
---|
112 | ALLOC1(internal_POP_GPR_BANK ,uint32_t ,_param->_nb_pop); |
---|
113 | ALLOC1(internal_POP_SPR_BANK ,uint32_t ,_param->_nb_pop); |
---|
114 | |
---|
115 | ALLOC1(internal_PUSH_GPR_ACK ,Tcontrol_t,_param->_nb_push); |
---|
116 | ALLOC1(internal_PUSH_SPR_ACK ,Tcontrol_t,_param->_nb_push); |
---|
117 | ALLOC1(internal_PUSH_GPR_BANK,uint32_t ,_param->_nb_push); |
---|
118 | ALLOC1(internal_PUSH_SPR_BANK,uint32_t ,_param->_nb_push); |
---|
119 | } |
---|
120 | |
---|
121 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
122 | _priority_gpr = new generic::priority::Priority (_name+"_priority_gpr", |
---|
123 | _param->_priority, |
---|
124 | _param->_nb_bank, |
---|
125 | _param->_nb_bank); |
---|
126 | |
---|
127 | _priority_spr = new generic::priority::Priority (_name+"_priority_spr", |
---|
128 | _param->_priority, |
---|
129 | _param->_nb_bank, |
---|
130 | _param->_nb_bank); |
---|
131 | |
---|
132 | #ifdef POSITION |
---|
133 | if (usage_is_set(_usage,USE_POSITION)) |
---|
134 | _component->generate_file(); |
---|
135 | #endif |
---|
136 | |
---|
137 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
138 | }; |
---|
139 | |
---|
140 | }; // end namespace free_list_unit |
---|
141 | }; // end namespace register_translation_unit |
---|
142 | }; // end namespace rename_unit |
---|
143 | }; // end namespace ooo_engine |
---|
144 | }; // end namespace multi_ooo_engine |
---|
145 | }; // end namespace core |
---|
146 | |
---|
147 | }; // end namespace behavioural |
---|
148 | }; // end namespace morpheo |
---|