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

#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h"

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


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

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

	// ~~~~~[ Interface : "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	delete []  in_INSERT_VAL                  ;
	delete [] out_INSERT_ACK                  ;
	if (_param->_have_port_front_end_id)
	delete []  in_INSERT_FRONT_END_ID         ;
	if (_param->_have_port_context_id)
	delete []  in_INSERT_CONTEXT_ID           ;
	delete []  in_INSERT_TYPE                 ;
	delete []  in_INSERT_OPERATION            ;
	delete [] out_INSERT_STORE_QUEUE_PTR_WRITE;
	if (_param->_have_port_load_queue_ptr)
	delete [] out_INSERT_LOAD_QUEUE_PTR_WRITE ;
	
	// ~~~~~[ Interface : "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	delete []  in_RETIRE_VAL                  ;
	delete [] out_RETIRE_ACK                  ;
	if (_param->_have_port_front_end_id)
	delete []  in_RETIRE_FRONT_END_ID         ;
	if (_param->_have_port_context_id)
	delete []  in_RETIRE_CONTEXT_ID           ;
// 	delete []  in_RETIRE_TYPE                 ;
// 	delete []  in_RETIRE_OPERATION            ;
 	delete []  in_RETIRE_USE_STORE_QUEUE      ;
 	delete []  in_RETIRE_USE_LOAD_QUEUE       ;
	delete []  in_RETIRE_STORE_QUEUE_PTR_WRITE;
	if (_param->_have_port_load_queue_ptr)
	delete []  in_RETIRE_LOAD_QUEUE_PTR_WRITE ;

        delete [] reg_STORE_QUEUE_PTR_WRITE    ;
        delete [] reg_STORE_QUEUE_USE          ;
        delete [] reg_STORE_QUEUE_NB_USE       ;
        delete [] reg_LOAD_QUEUE_PTR_WRITE     ;
        delete [] reg_LOAD_QUEUE_USE           ;
        delete [] internal_INSERT_ACK          ;
        delete [] internal_INSERT_OPERATION_USE;
        delete [] internal_INSERT_LSQ          ;
        delete [] internal_INSERT_PTR          ;
        delete [] internal_RETIRE_ACK          ;
        delete [] internal_RETIRE_OPERATION_USE;
        delete [] internal_RETIRE_LSQ          ;
        delete [] internal_RETIRE_PTR          ;
      }

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

    delete _component;

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

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

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