/*
 * $Id: Register_unit_deallocation.cpp 81 2008-04-15 18:40:01Z rosiere $
 *
 * [ Description ]
 * 
 */

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

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


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

//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    delete     in_CLOCK ;
//#endif
    delete     in_NRESET;

    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 []  in_GPR_READ_NUM_REG             ;
    delete [] out_GPR_READ_DATA                ;
    delete [] out_GPR_READ_DATA_VAL            ;
    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 []  in_GPR_WRITE_NUM_REG            ;
    delete []  in_GPR_WRITE_DATA               ;
    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 []  in_SPR_READ_NUM_REG             ;
    delete [] out_SPR_READ_DATA                ;
    delete [] out_SPR_READ_DATA_VAL            ;
    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 []  in_SPR_WRITE_NUM_REG            ;
    delete []  in_SPR_WRITE_DATA               ;
    delete []  in_INSERT_ROB_VAL               ;
    delete [] out_INSERT_ROB_ACK               ;
    delete []  in_INSERT_ROB_RD_USE            ;
    delete []  in_INSERT_ROB_RD_NUM_REG        ;
    delete []  in_INSERT_ROB_RE_USE            ;
    delete []  in_INSERT_ROB_RE_NUM_REG        ;
    delete []  in_RETIRE_ROB_VAL               ;
    delete [] out_RETIRE_ROB_ACK               ;
    delete []  in_RETIRE_ROB_RD_OLD_USE        ;
    delete []  in_RETIRE_ROB_RD_OLD_NUM_REG    ;
    delete []  in_RETIRE_ROB_RD_NEW_USE        ;
    delete []  in_RETIRE_ROB_RD_NEW_NUM_REG    ;
    delete []  in_RETIRE_ROB_RE_OLD_USE        ; 
    delete []  in_RETIRE_ROB_RE_OLD_NUM_REG    ;
    delete []  in_RETIRE_ROB_RE_NEW_USE        ;
    delete []  in_RETIRE_ROB_RE_NEW_NUM_REG    ;

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

    delete [] component_gpr       ;
    delete [] component_gpr_status;
    delete [] component_spr       ;
    delete [] component_spr_status;
    delete    component_glue      ; 

    delete _component;

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

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

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