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

#include "Behavioural/Generic/Shifter/include/Shifter.h"

namespace morpheo                    {
namespace behavioural {
namespace generic {
namespace shifter {


  void Shifter::deallocation (void)
  {
#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
    delete in_CLOCK;
#endif

    // Interface "shifter"
    for (uint32_t i=0; i<_param._nb_port; i++)
      {
	delete  in_SHIFTER_DATA      [i];
	if (_param._shift_value == 0)
	delete  in_SHIFTER_SHIFT     [i];
	if (_param._direction   == external_direction)
	delete  in_SHIFTER_DIRECTION [i];
	if (_param._rotate      == external_rotate)
	delete  in_SHIFTER_TYPE      [i];
	if (_param._carry       == external_carry)
	delete  in_SHIFTER_CARRY     [i];
	if (_param._carry       == external_completion)
	if (_param._type_completion_bool == true)
	delete  in_SHIFTER_CARRY_IN  [i];	  
	else
	delete  in_SHIFTER_COMPLETION[i];
	delete out_SHIFTER_DATA      [i];
      }

    delete  in_SHIFTER_DATA      ;
    if (_param._shift_value == 0)
    delete  in_SHIFTER_SHIFT     ;
    if (_param._direction   == external_direction )
    delete  in_SHIFTER_DIRECTION ;
    if (_param._rotate      == external_rotate    )
    delete  in_SHIFTER_TYPE      ;
    if (_param._carry       == external_carry     )
    delete  in_SHIFTER_CARRY     ;
    if (_param._carry       == external_completion)
      if (_param._type_completion_bool == true)
	delete  in_SHIFTER_CARRY_IN  ;
      else
	delete  in_SHIFTER_COMPLETION;
    delete out_SHIFTER_DATA      ;
  };

}; // end namespace shifter
}; // end namespace generic

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