/*
 * $Id: Register_unit_Glue_deallocation.cpp 88 2008-12-10 18:31:39Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace register_unit {
namespace register_unit_glue {


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

    if (usage_is_set(_usage,USE_VHDL))
      {
//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    delete    in_CLOCK ;
//#endif
    delete    in_NRESET;

    // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    delete []  in_GPR_READ_VAL               ;
    delete [] out_GPR_READ_ACK               ;
    if (_param->_have_port_ooo_engine_id == true)
    delete []  in_GPR_READ_OOO_ENGINE_ID     ;
    delete [] out_GPR_READ_DATA              ;
    delete [] out_GPR_READ_DATA_VAL          ;

    delete [] out_GPR_READ_REGISTERFILE_VAL  ;
    delete []  in_GPR_READ_REGISTERFILE_ACK  ;
    delete []  in_GPR_READ_REGISTERFILE_DATA ;

    delete [] out_GPR_READ_STATUS_VAL        ;
    delete []  in_GPR_READ_STATUS_ACK        ;
    delete []  in_GPR_READ_STATUS_DATA_VAL   ;


    // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    delete []  in_SPR_READ_VAL               ;
    delete [] out_SPR_READ_ACK               ;
    if (_param->_have_port_ooo_engine_id == true)
    delete []  in_SPR_READ_OOO_ENGINE_ID     ;
    delete [] out_SPR_READ_DATA              ;
    delete [] out_SPR_READ_DATA_VAL          ;

    delete [] out_SPR_READ_REGISTERFILE_VAL  ;
    delete []  in_SPR_READ_REGISTERFILE_ACK  ;
    delete []  in_SPR_READ_REGISTERFILE_DATA ;

    delete [] out_SPR_READ_STATUS_VAL        ;
    delete []  in_SPR_READ_STATUS_ACK        ;
    delete []  in_SPR_READ_STATUS_DATA_VAL   ;

    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    delete []  in_GPR_WRITE_VAL               ;
    delete [] out_GPR_WRITE_ACK               ;
    if (_param->_have_port_ooo_engine_id == true)
    delete []  in_GPR_WRITE_OOO_ENGINE_ID     ;

    delete [] out_GPR_WRITE_REGISTERFILE_VAL  ;
    delete []  in_GPR_WRITE_REGISTERFILE_ACK  ;

    delete [] out_GPR_WRITE_STATUS_VAL        ;
    delete []  in_GPR_WRITE_STATUS_ACK        ;

    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    delete []  in_SPR_WRITE_VAL               ;
    delete [] out_SPR_WRITE_ACK               ;
    if (_param->_have_port_ooo_engine_id == true)
    delete []  in_SPR_WRITE_OOO_ENGINE_ID     ;

    delete [] out_SPR_WRITE_REGISTERFILE_VAL  ;
    delete []  in_SPR_WRITE_REGISTERFILE_ACK  ;

    delete [] out_SPR_WRITE_STATUS_VAL        ;
    delete []  in_SPR_WRITE_STATUS_ACK        ;

    // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    delete []  in_INSERT_ROB_VAL                  ;
    delete [] out_INSERT_ROB_ACK                  ;
    delete []  in_INSERT_ROB_RD_USE               ;
    delete []  in_INSERT_ROB_RE_USE               ;
    delete [] out_INSERT_ROB_GPR_STATUS_VAL       ;
    delete []  in_INSERT_ROB_GPR_STATUS_ACK       ;
    delete [] out_INSERT_ROB_SPR_STATUS_VAL       ;
    delete []  in_INSERT_ROB_SPR_STATUS_ACK       ;

//     // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//     delete []  in_RETIRE_ROB_VAL                      ;
//     delete [] out_RETIRE_ROB_ACK                      ;
//     delete []  in_RETIRE_ROB_RD_OLD_USE               ;
//     delete []  in_RETIRE_ROB_RD_NEW_USE               ;
//     delete []  in_RETIRE_ROB_RE_OLD_USE               ;
//     delete []  in_RETIRE_ROB_RE_NEW_USE               ;
//     delete [] out_RETIRE_ROB_GPR_STATUS_OLD_VAL       ;
//     delete [] out_RETIRE_ROB_GPR_STATUS_NEW_VAL       ;
//     delete []  in_RETIRE_ROB_GPR_STATUS_OLD_ACK       ;
//     delete []  in_RETIRE_ROB_GPR_STATUS_NEW_ACK       ;
//     delete [] out_RETIRE_ROB_SPR_STATUS_OLD_VAL       ;
//     delete [] out_RETIRE_ROB_SPR_STATUS_NEW_VAL       ;
//     delete []  in_RETIRE_ROB_SPR_STATUS_OLD_ACK       ;
//     delete []  in_RETIRE_ROB_SPR_STATUS_NEW_ACK       ;
      }
    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    

    delete _component;

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

}; // end namespace register_unit_glue
}; // end namespace register_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

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