[78] | 1 | /* |
---|
| 2 | * $Id: Free_List_unit_allocation.cpp 112 2009-03-18 22:36:26Z 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, |
---|
[112] | 51 | _("Generalist interface") |
---|
[78] | 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 | { |
---|
[112] | 60 | ALLOC1_INTERFACE_BEGIN("pop", IN, NORTH, _("New destination register"), _param->_nb_pop); |
---|
[78] | 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); |
---|
[112] | 68 | |
---|
| 69 | ALLOC1_INTERFACE_END(_param->_nb_pop); |
---|
[78] | 70 | } |
---|
| 71 | |
---|
| 72 | // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | { |
---|
[112] | 74 | ALLOC1_INTERFACE_BEGIN("push_gpr", IN, NORTH, _("General register free"), _param->_nb_push); |
---|
[78] | 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); |
---|
[112] | 79 | |
---|
| 80 | ALLOC1_INTERFACE_END(_param->_nb_push); |
---|
[78] | 81 | } |
---|
| 82 | |
---|
| 83 | // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 84 | { |
---|
[112] | 85 | ALLOC1_INTERFACE_BEGIN("push_spr", IN, NORTH, _("General register free"), _param->_nb_push); |
---|
[78] | 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); |
---|
[112] | 90 | |
---|
| 91 | ALLOC1_INTERFACE_END(_param->_nb_push); |
---|
[78] | 92 | } |
---|
| 93 | |
---|
[88] | 94 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 95 | { |
---|
[112] | 96 | ALLOC1(_gpr_list,std::list<uint32_t>,_param->_nb_bank); |
---|
| 97 | ALLOC1(_spr_list,std::list<uint32_t>,_param->_nb_bank); |
---|
[78] | 98 | |
---|
[112] | 99 | ALLOC1(internal_POP_ACK ,Tcontrol_t,_param->_nb_pop); |
---|
| 100 | ALLOC1(internal_POP_GPR_BANK ,uint32_t ,_param->_nb_pop); |
---|
| 101 | ALLOC1(internal_POP_SPR_BANK ,uint32_t ,_param->_nb_pop); |
---|
[78] | 102 | |
---|
[112] | 103 | ALLOC1(internal_PUSH_GPR_ACK ,Tcontrol_t,_param->_nb_push); |
---|
| 104 | ALLOC1(internal_PUSH_SPR_ACK ,Tcontrol_t,_param->_nb_push); |
---|
| 105 | ALLOC1(internal_PUSH_GPR_BANK,uint32_t ,_param->_nb_push); |
---|
| 106 | ALLOC1(internal_PUSH_SPR_BANK,uint32_t ,_param->_nb_push); |
---|
[88] | 107 | } |
---|
[112] | 108 | |
---|
[88] | 109 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[109] | 110 | _priority_gpr = new generic::priority::Priority (_name+"_priority_gpr", |
---|
| 111 | _param->_priority, |
---|
| 112 | _param->_nb_bank, |
---|
| 113 | _param->_nb_bank); |
---|
[78] | 114 | |
---|
[109] | 115 | _priority_spr = new generic::priority::Priority (_name+"_priority_spr", |
---|
| 116 | _param->_priority, |
---|
| 117 | _param->_nb_bank, |
---|
| 118 | _param->_nb_bank); |
---|
| 119 | |
---|
[78] | 120 | #ifdef POSITION |
---|
[88] | 121 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 122 | _component->generate_file(); |
---|
[78] | 123 | #endif |
---|
| 124 | |
---|
| 125 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
| 126 | }; |
---|
| 127 | |
---|
| 128 | }; // end namespace free_list_unit |
---|
| 129 | }; // end namespace register_translation_unit |
---|
| 130 | }; // end namespace rename_unit |
---|
| 131 | }; // end namespace ooo_engine |
---|
| 132 | }; // end namespace multi_ooo_engine |
---|
| 133 | }; // end namespace core |
---|
| 134 | |
---|
| 135 | }; // end namespace behavioural |
---|
| 136 | }; // end namespace morpheo |
---|