/*
 * $Id: OOO_Engine_Glue_deallocation.cpp 122 2009-06-03 08:15:51Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/include/OOO_Engine_Glue.h"
#include "Behavioural/include/Allocation.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_ooo_engine {
namespace ooo_engine {
namespace ooo_engine_glue {


#undef  FUNCTION
#define FUNCTION "OOO_Engine_Glue::deallocation"
  void OOO_Engine_Glue::deallocation (void)
  {
    log_begin(OOO_Engine_Glue,FUNCTION);

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

        DELETE2_SIGNAL( in_RENAME_FRONT_END_ID                          ,_param->_nb_front_end,_param->_nb_inst_decod[it1],_param->_size_front_end_id    );
        DELETE2_SIGNAL(out_RENAME_RENAME_UNIT_FRONT_END_ID              ,_param->_nb_front_end,_param->_nb_inst_decod[it1],_param->_size_front_end_id    );

        DELETE1_SIGNAL(out_INSERT_VAL                                   ,_param->_sum_inst_insert,1                             );
        DELETE1_SIGNAL( in_INSERT_ACK                                   ,_param->_sum_inst_insert,1                             );
        DELETE1_SIGNAL(out_INSERT_RD_USE                                ,_param->_sum_inst_insert,1                             );
        DELETE1_SIGNAL(out_INSERT_RD_NUM_REG                            ,_param->_sum_inst_insert,_param->_size_general_register);
        DELETE1_SIGNAL(out_INSERT_RE_USE                                ,_param->_sum_inst_insert,1                             );
        DELETE1_SIGNAL(out_INSERT_RE_NUM_REG                            ,_param->_sum_inst_insert,_param->_size_general_register);

        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_VAL                       ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_RENAME_UNIT_ACK                       ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_FRONT_END_ID              ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_front_end_id    );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_CONTEXT_ID                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_context_id      );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_TYPE                      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_type            );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_OPERATION                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_operation       );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NO_EXECUTE                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_HAS_IMMEDIAT              ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_IMMEDIAT                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_data    );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE     ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY         ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_load_queue_ptr  );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_READ_RA                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NUM_REG_RA_PHY            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_READ_RB                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NUM_REG_RB_PHY            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_READ_RC                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NUM_REG_RC_PHY            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_WRITE_RD                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NUM_REG_RD_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NUM_REG_RD_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_WRITE_RE                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NUM_REG_RE_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);
        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_NUM_REG_RE_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);

        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_VAL                       ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_COMMIT_UNIT_ACK                       ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_FRONT_END_ID              ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_front_end_id    );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_CONTEXT_ID                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_context_id      );
//      DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_RENAME_UNIT_ID            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_rename_unit_id  );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_TYPE                      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_type            );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_OPERATION                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_operation       );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_STORE_QUEUE_PTR_WRITE     ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_LOAD_QUEUE_PTR_WRITE      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_load_queue_ptr  );
#ifdef DEBUG
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_READ_RA                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_NUM_REG_RA_PHY            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_READ_RB                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_NUM_REG_RB_PHY            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_READ_RC                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_NUM_REG_RC_PHY            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);
#endif
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_WRITE_RD                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_NUM_REG_RD_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_NUM_REG_RD_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_WRITE_RE                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_NUM_REG_RE_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);
        DELETE2_SIGNAL(out_INSERT_COMMIT_UNIT_NUM_REG_RE_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);

        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_VAL                       ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL( in_INSERT_ISSUE_QUEUE_ACK                       ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_FRONT_END_ID              ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_front_end_id    );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_CONTEXT_ID                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_context_id      );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_OPERATION                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_operation       );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_TYPE                      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_type            );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE     ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_load_queue_ptr  );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_HAS_IMMEDIAT              ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_IMMEDIAT                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_data    );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_READ_RA                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_NUM_REG_RA                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_READ_RB                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_NUM_REG_RB                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_READ_RC                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_NUM_REG_RC                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_WRITE_RD                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_NUM_REG_RD                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_register);
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_WRITE_RE                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
        DELETE2_SIGNAL(out_INSERT_ISSUE_QUEUE_NUM_REG_RE                ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_special_register);

//         DELETE1_SIGNAL(out_RETIRE_VAL                                   ,_param->_sum_inst_retire,1                             );
//         DELETE1_SIGNAL( in_RETIRE_ACK                                   ,_param->_sum_inst_retire,1                             );
//         DELETE1_SIGNAL(out_RETIRE_RD_OLD_USE                            ,_param->_sum_inst_retire,1                             );
//         DELETE1_SIGNAL(out_RETIRE_RD_OLD_NUM_REG                        ,_param->_sum_inst_retire,_param->_size_general_register);
//         DELETE1_SIGNAL(out_RETIRE_RD_NEW_USE                            ,_param->_sum_inst_retire,1                             );
//         DELETE1_SIGNAL(out_RETIRE_RD_NEW_NUM_REG                        ,_param->_sum_inst_retire,_param->_size_general_register);
//         DELETE1_SIGNAL(out_RETIRE_RE_OLD_USE                            ,_param->_sum_inst_retire,1                             );
//         DELETE1_SIGNAL(out_RETIRE_RE_OLD_NUM_REG                        ,_param->_sum_inst_retire,_param->_size_special_register);
//         DELETE1_SIGNAL(out_RETIRE_RE_NEW_USE                            ,_param->_sum_inst_retire,1                             );
//         DELETE1_SIGNAL(out_RETIRE_RE_NEW_NUM_REG                        ,_param->_sum_inst_retire,_param->_size_special_register);

//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_VAL                       ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL( in_RETIRE_RENAME_UNIT_ACK                       ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_FRONT_END_ID              ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_front_end_id    );
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_WRITE_RD                  ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_NUM_REG_RD_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register);
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_NUM_REG_RD_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register);
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_WRITE_RE                  ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_NUM_REG_RE_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register);
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_NUM_REG_RE_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register);
//         DELETE2_SIGNAL(out_RETIRE_RENAME_UNIT_EVENT_STATE               ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_event_state     );

//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_VAL                       ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL(out_RETIRE_COMMIT_UNIT_ACK                       ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_FRONT_END_ID              ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_front_end_id    );
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_WRITE_RD                  ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_NUM_REG_RD_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register);
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_NUM_REG_RD_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_general_register);
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_WRITE_RE                  ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],1                             );
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_NUM_REG_RE_PHY_OLD        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register);
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_NUM_REG_RE_PHY_NEW        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_special_register);
//         DELETE2_SIGNAL( in_RETIRE_COMMIT_UNIT_EVENT_STATE               ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_size_event_state     );

        DELETE2_SIGNAL(out_SPR_SR_IEE                                   ,_param->_nb_front_end,_param->_nb_context[it1],1                             );
        DELETE2_SIGNAL(out_SPR_SR_EPH                                   ,_param->_nb_front_end,_param->_nb_context[it1],1                             );
        DELETE2_SIGNAL(out_SPR_RENAME_UNIT_SR                           ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_spr             );
        DELETE2_SIGNAL(out_SPR_COMMIT_UNIT_SR_OVE                       ,_param->_nb_front_end,_param->_nb_context[it1],1                             );
        DELETE2_SIGNAL( in_SPR_SPECIAL_REGISTER_UNIT_SR                 ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_spr             );
      }

    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    

    delete _component;

    log_end(OOO_Engine_Glue,FUNCTION);
  };

}; // end namespace ooo_engine_glue
}; // end namespace ooo_engine
}; // end namespace multi_ooo_engine
}; // end namespace core

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