#undef  FUNCTION
#define FUNCTION "Reservation_station::"

#ifdef SYSTEMC
/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Reservation_station.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace multi_read_unit {
namespace read_unit {
namespace reservation_station {


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

    delete     in_CLOCK ;
    delete     in_NRESET;

    delete     in_INSERT_VAL           ;
    delete    out_INSERT_ACK           ;
    if (_param->_have_port_context_id)
    delete     in_INSERT_CONTEXT_ID    ;
    if (_param->_have_port_front_end_id)
    delete     in_INSERT_FRONT_END_ID  ;
    if (_param->_have_port_ooo_engine_id)
    delete     in_INSERT_OOO_ENGINE_ID ;
    if (_param->_have_port_rob_id)
    delete     in_INSERT_ROB_ID        ;
    delete     in_INSERT_OPERATION     ;
    delete     in_INSERT_TYPE          ;
    delete     in_INSERT_STORE_QUEUE_PTR_WRITE;
    delete     in_INSERT_LOAD_QUEUE_PTR_WRITE ;
    delete     in_INSERT_HAS_IMMEDIAT  ;
    delete     in_INSERT_IMMEDIAT      ;
//  delete     in_INSERT_READ_RA       ;
    delete     in_INSERT_NUM_REG_RA    ;
    delete     in_INSERT_DATA_RA_VAL   ;
    delete     in_INSERT_DATA_RA       ;
//  delete     in_INSERT_READ_RB       ;
    delete     in_INSERT_NUM_REG_RB    ;
    delete     in_INSERT_DATA_RB_VAL   ;
    delete     in_INSERT_DATA_RB       ;
//  delete     in_INSERT_READ_RC       ;
    delete     in_INSERT_NUM_REG_RC    ;
    delete     in_INSERT_DATA_RC_VAL   ;
    delete     in_INSERT_DATA_RC       ;
    delete     in_INSERT_WRITE_RD      ;
    delete     in_INSERT_NUM_REG_RD    ;
    delete     in_INSERT_WRITE_RE      ;
    delete     in_INSERT_NUM_REG_RE    ;
    
    delete [] out_RETIRE_VAL           ;
    delete []  in_RETIRE_ACK           ;
    if (_param->_have_port_context_id)
    delete [] out_RETIRE_CONTEXT_ID    ;
    if (_param->_have_port_front_end_id)
    delete [] out_RETIRE_FRONT_END_ID  ;
    if (_param->_have_port_ooo_engine_id)
    delete [] out_RETIRE_OOO_ENGINE_ID ;
    if (_param->_have_port_rob_id)
    delete [] out_RETIRE_ROB_ID        ;
    delete [] out_RETIRE_OPERATION     ;
    delete [] out_RETIRE_TYPE          ;
    delete [] out_RETIRE_STORE_QUEUE_PTR_WRITE;
    delete [] out_RETIRE_LOAD_QUEUE_PTR_WRITE ;
    delete [] out_RETIRE_HAS_IMMEDIAT  ;
    delete [] out_RETIRE_IMMEDIAT      ;
    delete [] out_RETIRE_DATA_RA       ;
    delete [] out_RETIRE_DATA_RB       ;
    delete [] out_RETIRE_DATA_RC       ;
    delete [] out_RETIRE_WRITE_RD      ;
    delete [] out_RETIRE_NUM_REG_RD    ;
    delete [] out_RETIRE_WRITE_RE      ;
    delete [] out_RETIRE_NUM_REG_RE    ;
    
    delete []  in_GPR_WRITE_VAL         ;
    if (_param->_have_port_ooo_engine_id)
    delete []  in_GPR_WRITE_OOO_ENGINE_ID;
    delete []  in_GPR_WRITE_NUM_REG     ;
    delete []  in_GPR_WRITE_DATA        ;
    
    delete []  in_SPR_WRITE_VAL       ;
    if (_param->_have_port_ooo_engine_id)
    delete []  in_SPR_WRITE_OOO_ENGINE_ID;
    delete []  in_SPR_WRITE_NUM_REG   ;
    delete []  in_SPR_WRITE_DATA      ;
    
    if (_param->_have_port_ooo_engine_id)
    delete []  in_BYPASS_WRITE_OOO_ENGINE_ID;
    delete []  in_BYPASS_WRITE_GPR_VAL    ;
    delete []  in_BYPASS_WRITE_GPR_NUM_REG;
    delete []  in_BYPASS_WRITE_GPR_DATA   ;
    delete []  in_BYPASS_WRITE_SPR_VAL    ;
    delete []  in_BYPASS_WRITE_SPR_NUM_REG;
    delete []  in_BYPASS_WRITE_SPR_DATA   ;
    
    delete []  in_BYPASS_MEMORY_VAL       ;
    if (_param->_have_port_ooo_engine_id)
    delete []  in_BYPASS_MEMORY_OOO_ENGINE_ID;
    delete []  in_BYPASS_MEMORY_NUM_REG   ;
    delete []  in_BYPASS_MEMORY_DATA      ;
    
    // ~~~~~[ internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    delete []  internal_RETIRE_VAL;

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

    delete    _component;
#ifdef  SYSTEMC_VHDL_COMPATIBILITY
    delete [] _queue_valid  ;
#else
    delete    _queue_control;
#endif
    delete [] _queue        ;

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

}; // end namespace reservation_station
}; // end namespace read_unit
}; // end namespace multi_read_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

}; // end namespace behavioural
}; // end namespace morpheo              
#endif
