/*
 * $Id: Rename_select_deallocation.cpp 112 2009-03-18 22:36:26Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.h"
#include "Behavioural/include/Allocation.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_ooo_engine {
namespace ooo_engine {
namespace rename_unit {
namespace rename_select {


#undef  FUNCTION
#define FUNCTION "Rename_select::deallocation"
  void Rename_select::deallocation (void)
  {
    log_printf(FUNC,Rename_select,FUNCTION,"Begin");

    if (usage_is_set(_usage,USE_SYSTEMC))
      {
	delete    in_CLOCK ;
	delete    in_NRESET;

        DELETE2_SIGNAL( in_RENAME_IN_VAL           ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1);
        DELETE2_SIGNAL(out_RENAME_IN_ACK           ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1);
        DELETE2_SIGNAL( in_RENAME_IN_FRONT_END_ID  ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_front_end_id          );
        DELETE2_SIGNAL( in_RENAME_IN_CONTEXT_ID    ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_context_id            );
        DELETE2_SIGNAL( in_RENAME_IN_DEPTH         ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_depth                 );
        DELETE2_SIGNAL( in_RENAME_IN_TYPE          ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_type                  );
        DELETE2_SIGNAL( in_RENAME_IN_OPERATION     ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_operation             );
        DELETE2_SIGNAL( in_RENAME_IN_NO_EXECUTE    ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
        DELETE2_SIGNAL( in_RENAME_IN_IS_DELAY_SLOT ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
#ifdef DEBUG
        DELETE2_SIGNAL( in_RENAME_IN_ADDRESS       ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_instruction_address   );
#endif
        DELETE2_SIGNAL( in_RENAME_IN_ADDRESS_NEXT  ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_instruction_address   );
        DELETE2_SIGNAL( in_RENAME_IN_HAS_IMMEDIAT  ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
        DELETE2_SIGNAL( in_RENAME_IN_IMMEDIAT      ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_general_data          );
        DELETE2_SIGNAL( in_RENAME_IN_READ_RA       ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
        DELETE2_SIGNAL( in_RENAME_IN_NUM_REG_RA    ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_general_register_logic);
        DELETE2_SIGNAL( in_RENAME_IN_READ_RB       ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
        DELETE2_SIGNAL( in_RENAME_IN_NUM_REG_RB    ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_general_register_logic);
        DELETE2_SIGNAL( in_RENAME_IN_READ_RC       ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
        DELETE2_SIGNAL( in_RENAME_IN_NUM_REG_RC    ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_special_register_logic);
        DELETE2_SIGNAL( in_RENAME_IN_WRITE_RD      ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
        DELETE2_SIGNAL( in_RENAME_IN_NUM_REG_RD    ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_general_register_logic);
        DELETE2_SIGNAL( in_RENAME_IN_WRITE_RE      ,_param->_nb_front_end, _param->_nb_inst_decod[it1],1                                   );
        DELETE2_SIGNAL( in_RENAME_IN_NUM_REG_RE    ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_special_register_logic);
        DELETE2_SIGNAL( in_RENAME_IN_EXCEPTION_USE ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_exception_use         );
        DELETE2_SIGNAL( in_RENAME_IN_EXCEPTION     ,_param->_nb_front_end, _param->_nb_inst_decod[it1],_param->_size_exception             );
      
        DELETE1_SIGNAL(out_RENAME_OUT_VAL           ,_param->_nb_inst_rename,1);
        DELETE1_SIGNAL( in_RENAME_OUT_ACK           ,_param->_nb_inst_rename,1);
        DELETE1_SIGNAL(out_RENAME_OUT_FRONT_END_ID  ,_param->_nb_inst_rename,_param->_size_front_end_id          );
        DELETE1_SIGNAL(out_RENAME_OUT_CONTEXT_ID    ,_param->_nb_inst_rename,_param->_size_context_id            );
        DELETE1_SIGNAL(out_RENAME_OUT_DEPTH         ,_param->_nb_inst_rename,_param->_size_depth                 );
        DELETE1_SIGNAL(out_RENAME_OUT_TYPE          ,_param->_nb_inst_rename,_param->_size_type                  );
        DELETE1_SIGNAL(out_RENAME_OUT_OPERATION     ,_param->_nb_inst_rename,_param->_size_operation             );
        DELETE1_SIGNAL(out_RENAME_OUT_NO_EXECUTE    ,_param->_nb_inst_rename,1                                   );
        DELETE1_SIGNAL(out_RENAME_OUT_IS_DELAY_SLOT ,_param->_nb_inst_rename,1                                   );
#ifdef DEBUG
        DELETE1_SIGNAL(out_RENAME_OUT_ADDRESS       ,_param->_nb_inst_rename,_param->_size_instruction_address   );
#endif
        DELETE1_SIGNAL(out_RENAME_OUT_ADDRESS_NEXT  ,_param->_nb_inst_rename,_param->_size_instruction_address   );
        DELETE1_SIGNAL(out_RENAME_OUT_HAS_IMMEDIAT  ,_param->_nb_inst_rename,1                                   );
        DELETE1_SIGNAL(out_RENAME_OUT_IMMEDIAT      ,_param->_nb_inst_rename,_param->_size_general_data          );
        DELETE1_SIGNAL(out_RENAME_OUT_READ_RA       ,_param->_nb_inst_rename,1                                   );
        DELETE1_SIGNAL(out_RENAME_OUT_NUM_REG_RA    ,_param->_nb_inst_rename,_param->_size_general_register_logic);
        DELETE1_SIGNAL(out_RENAME_OUT_READ_RB       ,_param->_nb_inst_rename,1                                   );
        DELETE1_SIGNAL(out_RENAME_OUT_NUM_REG_RB    ,_param->_nb_inst_rename,_param->_size_general_register_logic);
        DELETE1_SIGNAL(out_RENAME_OUT_READ_RC       ,_param->_nb_inst_rename,1                                   );
        DELETE1_SIGNAL(out_RENAME_OUT_NUM_REG_RC    ,_param->_nb_inst_rename,_param->_size_special_register_logic);
        DELETE1_SIGNAL(out_RENAME_OUT_WRITE_RD      ,_param->_nb_inst_rename,1                                   );
        DELETE1_SIGNAL(out_RENAME_OUT_NUM_REG_RD    ,_param->_nb_inst_rename,_param->_size_general_register_logic);
        DELETE1_SIGNAL(out_RENAME_OUT_WRITE_RE      ,_param->_nb_inst_rename,1                                   );
        DELETE1_SIGNAL(out_RENAME_OUT_NUM_REG_RE    ,_param->_nb_inst_rename,_param->_size_special_register_logic);
        DELETE1_SIGNAL(out_RENAME_OUT_EXCEPTION_USE ,_param->_nb_inst_rename,_param->_size_exception_use         );
        DELETE1_SIGNAL(out_RENAME_OUT_EXCEPTION     ,_param->_nb_inst_rename,_param->_size_exception             );

        DELETE2_SIGNAL( in_RETIRE_EVENT_STATE       ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state);
      }

    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
    delete _priority;
    delete _component;

    log_printf(FUNC,Rename_select,FUNCTION,"End");
  };

}; // end namespace rename_select
}; // end namespace rename_unit
}; // end namespace ooo_engine
}; // end namespace multi_ooo_engine
}; // end namespace core

}; // end namespace behavioural
}; // end namespace morpheo              
