/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/include/Functionnal_unit.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace multi_execute_unit {
namespace execute_unit {
namespace functionnal_unit {


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

    if (_usage & USE_SYSTEMC)
      {
	delete    in_CLOCK ;
	delete    in_NRESET;
	
	delete  in_EXECUTE_IN_VAL           ;
	delete out_EXECUTE_IN_ACK           ;
	if (_param->_have_port_context_id)
	delete  in_EXECUTE_IN_CONTEXT_ID    ;
	if (_param->_have_port_front_end_id)
	delete  in_EXECUTE_IN_FRONT_END_ID  ;
	if (_param->_have_port_ooo_engine_id)
	delete  in_EXECUTE_IN_OOO_ENGINE_ID ;
	if (_param->_have_port_packet_id)
	delete  in_EXECUTE_IN_PACKET_ID     ;
	delete  in_EXECUTE_IN_OPERATION     ;
	delete  in_EXECUTE_IN_TYPE          ;
	delete  in_EXECUTE_IN_HAS_IMMEDIAT  ;
	delete  in_EXECUTE_IN_IMMEDIAT      ;
	delete  in_EXECUTE_IN_DATA_RA       ;
	delete  in_EXECUTE_IN_DATA_RB       ;
	delete  in_EXECUTE_IN_DATA_RC       ;
	delete  in_EXECUTE_IN_WRITE_RD      ;
	delete  in_EXECUTE_IN_NUM_REG_RD    ;
	delete  in_EXECUTE_IN_WRITE_RE      ;
	delete  in_EXECUTE_IN_NUM_REG_RE    ;

	delete out_EXECUTE_OUT_VAL            ;
	delete  in_EXECUTE_OUT_ACK            ;
	if (_param->_have_port_context_id)
	delete out_EXECUTE_OUT_CONTEXT_ID     ; 
	if (_param->_have_port_front_end_id)
	delete out_EXECUTE_OUT_FRONT_END_ID   ; 
	if (_param->_have_port_ooo_engine_id)
	delete out_EXECUTE_OUT_OOO_ENGINE_ID  ; 
	if (_param->_have_port_packet_id)
	delete out_EXECUTE_OUT_PACKET_ID      ; 
      //delete out_EXECUTE_OUT_OPERATION      ; 
      //delete out_EXECUTE_OUT_TYPE           ; 
	delete out_EXECUTE_OUT_WRITE_RD       ; 
	delete out_EXECUTE_OUT_NUM_REG_RD     ; 
	delete out_EXECUTE_OUT_DATA_RD        ; 
	delete out_EXECUTE_OUT_WRITE_RE       ; 
	delete out_EXECUTE_OUT_NUM_REG_RE     ; 
	delete out_EXECUTE_OUT_DATA_RE        ;
	delete out_EXECUTE_OUT_EXCEPTION      ;
	delete out_EXECUTE_OUT_NO_SEQUENCE    ;
	delete out_EXECUTE_OUT_ADDRESS        ;
      }
    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    

    delete [] _execute_register;
    delete    _execute_param;
    delete    _execute_operation;
    delete    _function_execute;

    delete    _component;

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

}; // end namespace functionnal_unit
}; // end namespace execute_unit
}; // end namespace multi_execute_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

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