[78] | 1 | /* |
---|
| 2 | * $Id: Stat_List_unit_allocation.cpp 121 2009-05-27 10:13:56Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/include/Stat_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 stat_list_unit { |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #undef FUNCTION |
---|
| 23 | #define FUNCTION "Stat_List_unit::allocation" |
---|
| 24 | void Stat_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,Stat_List_unit,FUNCTION,"Begin"); |
---|
| 33 | |
---|
| 34 | _component = new Component (_usage); |
---|
| 35 | |
---|
| 36 | Entity * entity = _component->set_entity (_name |
---|
| 37 | ,"Stat_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 "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 59 | { |
---|
[112] | 60 | ALLOC1_INTERFACE_BEGIN("insert",IN,SOUTH,_("Insert a renaming result"),_param->_nb_inst_insert); |
---|
[78] | 61 | |
---|
| 62 | ALLOC1_VALACK_IN ( in_INSERT_VAL ,VAL); |
---|
| 63 | ALLOC1_VALACK_OUT(out_INSERT_ACK ,ACK); |
---|
| 64 | ALLOC1_SIGNAL_IN ( in_INSERT_READ_RA ,"read_ra" ,Tcontrol_t ,1 ); |
---|
| 65 | ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RA_PHY ,"num_reg_ra_phy" ,Tgeneral_address_t,_param->_size_general_register); |
---|
| 66 | ALLOC1_SIGNAL_IN ( in_INSERT_READ_RB ,"read_rb" ,Tcontrol_t ,1 ); |
---|
| 67 | ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RB_PHY ,"num_reg_rb_phy" ,Tgeneral_address_t,_param->_size_general_register); |
---|
| 68 | ALLOC1_SIGNAL_IN ( in_INSERT_READ_RC ,"read_rc" ,Tcontrol_t ,1 ); |
---|
| 69 | ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RC_PHY ,"num_reg_rc_phy" ,Tspecial_address_t,_param->_size_special_register); |
---|
| 70 | ALLOC1_SIGNAL_IN ( in_INSERT_WRITE_RD ,"write_rd" ,Tcontrol_t ,1 ); |
---|
[117] | 71 | ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register); |
---|
[78] | 72 | ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RD_PHY_NEW,"num_reg_rd_phy_new",Tgeneral_address_t,_param->_size_general_register); |
---|
| 73 | ALLOC1_SIGNAL_IN ( in_INSERT_WRITE_RE ,"write_re" ,Tcontrol_t ,1 ); |
---|
[117] | 74 | ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register); |
---|
[78] | 75 | ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RE_PHY_NEW,"num_reg_re_phy_new",Tspecial_address_t,_param->_size_special_register); |
---|
[117] | 76 | |
---|
[112] | 77 | ALLOC1_INTERFACE_END(_param->_nb_inst_insert); |
---|
[78] | 78 | } |
---|
[117] | 79 | |
---|
[78] | 80 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 81 | { |
---|
[112] | 82 | ALLOC1_INTERFACE_BEGIN("retire",IN,NORTH,_("Retire a renaming result"),_param->_nb_inst_retire); |
---|
[117] | 83 | |
---|
[78] | 84 | ALLOC1_VALACK_IN ( in_RETIRE_VAL ,VAL); |
---|
| 85 | ALLOC1_VALACK_OUT(out_RETIRE_ACK ,ACK); |
---|
[112] | 86 | ALLOC1_SIGNAL_IN ( in_RETIRE_RESTORE ,"restore" ,Tcontrol_t ,1 ); |
---|
[121] | 87 | // ALLOC1_SIGNAL_IN ( in_RETIRE_READ_RA ,"read_ra" ,Tcontrol_t ,1 ); |
---|
| 88 | // ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RA_PHY ,"num_reg_ra_phy" ,Tgeneral_address_t,_param->_size_general_register); |
---|
| 89 | // ALLOC1_SIGNAL_IN ( in_RETIRE_READ_RB ,"read_rb" ,Tcontrol_t ,1 ); |
---|
| 90 | // ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RB_PHY ,"num_reg_rb_phy" ,Tgeneral_address_t,_param->_size_general_register); |
---|
| 91 | // ALLOC1_SIGNAL_IN ( in_RETIRE_READ_RC ,"read_rc" ,Tcontrol_t ,1 ); |
---|
| 92 | // ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RC_PHY ,"num_reg_rc_phy" ,Tspecial_address_t,_param->_size_special_register); |
---|
[78] | 93 | ALLOC1_SIGNAL_IN ( in_RETIRE_WRITE_RD ,"write_rd" ,Tcontrol_t ,1 ); |
---|
[88] | 94 | ALLOC1_SIGNAL_IN ( in_RETIRE_RESTORE_RD_PHY_OLD,"restore_rd_phy_old",Tcontrol_t ,1 ); |
---|
[78] | 95 | ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register); |
---|
| 96 | ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_NEW,"num_reg_rd_phy_new",Tgeneral_address_t,_param->_size_general_register); |
---|
| 97 | ALLOC1_SIGNAL_IN ( in_RETIRE_WRITE_RE ,"write_re" ,Tcontrol_t ,1 ); |
---|
[88] | 98 | ALLOC1_SIGNAL_IN ( in_RETIRE_RESTORE_RE_PHY_OLD,"restore_re_phy_old",Tcontrol_t ,1 ); |
---|
[78] | 99 | ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register); |
---|
| 100 | ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_NEW,"num_reg_re_phy_new",Tspecial_address_t,_param->_size_special_register); |
---|
[112] | 101 | |
---|
| 102 | ALLOC1_INTERFACE_END(_param->_nb_inst_retire); |
---|
[78] | 103 | } |
---|
| 104 | |
---|
| 105 | // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 106 | { |
---|
[112] | 107 | ALLOC1_INTERFACE_BEGIN("push_gpr",OUT,SOUTH,_("Free a general register"),_param->_nb_reg_free); |
---|
[78] | 108 | |
---|
| 109 | ALLOC1_VALACK_OUT(out_PUSH_GPR_VAL ,VAL); |
---|
| 110 | ALLOC1_VALACK_IN ( in_PUSH_GPR_ACK ,ACK); |
---|
| 111 | ALLOC1_SIGNAL_OUT(out_PUSH_GPR_NUM_REG,"num_reg",Tgeneral_address_t,_param->_size_general_register); |
---|
[112] | 112 | |
---|
| 113 | ALLOC1_INTERFACE_END(_param->_nb_reg_free); |
---|
[78] | 114 | } |
---|
| 115 | |
---|
| 116 | // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 117 | { |
---|
[112] | 118 | ALLOC1_INTERFACE_BEGIN("push_spr",OUT,SOUTH,_("Free a special register"),_param->_nb_reg_free); |
---|
[78] | 119 | |
---|
| 120 | ALLOC1_VALACK_OUT(out_PUSH_SPR_VAL ,VAL); |
---|
| 121 | ALLOC1_VALACK_IN ( in_PUSH_SPR_ACK ,ACK); |
---|
| 122 | ALLOC1_SIGNAL_OUT(out_PUSH_SPR_NUM_REG,"num_reg",Tspecial_address_t,_param->_size_special_register); |
---|
[112] | 123 | |
---|
| 124 | ALLOC1_INTERFACE_END(_param->_nb_reg_free); |
---|
[78] | 125 | } |
---|
| 126 | |
---|
[88] | 127 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 128 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 129 | { |
---|
[112] | 130 | ALLOC2(gpr_stat_list,stat_list_entry_t,_param->_nb_bank,_param->_nb_general_register_by_bank); |
---|
| 131 | ALLOC2(spr_stat_list,stat_list_entry_t,_param->_nb_bank,_param->_nb_special_register_by_bank); |
---|
| 132 | ALLOC1(internal_INSERT_ACK ,Tcontrol_t,_param->_nb_inst_insert); |
---|
| 133 | ALLOC1(internal_RETIRE_ACK ,Tcontrol_t,_param->_nb_inst_retire); |
---|
| 134 | ALLOC1(internal_PUSH_GPR_VAL ,Tcontrol_t,_param->_nb_reg_free); |
---|
| 135 | ALLOC1(internal_PUSH_GPR_NUM_BANK,uint32_t ,_param->_nb_reg_free); |
---|
[118] | 136 | ALLOC1(internal_PUSH_GPR_NUM_REG ,uint32_t ,_param->_nb_reg_free); |
---|
[112] | 137 | ALLOC1(internal_PUSH_SPR_VAL ,Tcontrol_t,_param->_nb_reg_free); |
---|
| 138 | ALLOC1(internal_PUSH_SPR_NUM_BANK,uint32_t ,_param->_nb_reg_free); |
---|
[118] | 139 | ALLOC1(internal_PUSH_SPR_NUM_REG ,uint32_t ,_param->_nb_reg_free); |
---|
[88] | 140 | } |
---|
[78] | 141 | |
---|
[88] | 142 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 143 | |
---|
[78] | 144 | #ifdef POSITION |
---|
[88] | 145 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 146 | _component->generate_file(); |
---|
[78] | 147 | #endif |
---|
| 148 | |
---|
| 149 | log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
| 150 | }; |
---|
| 151 | |
---|
| 152 | }; // end namespace stat_list_unit |
---|
| 153 | }; // end namespace register_translation_unit |
---|
| 154 | }; // end namespace rename_unit |
---|
| 155 | }; // end namespace ooo_engine |
---|
| 156 | }; // end namespace multi_ooo_engine |
---|
| 157 | }; // end namespace core |
---|
| 158 | |
---|
| 159 | }; // end namespace behavioural |
---|
| 160 | }; // end namespace morpheo |
---|