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

#include "Behavioural/Generic/Select/Priority_Fixed/include/Priority_Fixed.h"

namespace morpheo                    {
namespace behavioural {
namespace generic {
namespace select {
namespace priority_fixed {


  void Priority_Fixed::allocation (void)
  {
    string rename;

    log_printf(FUNC,Priority_Fixed,"allocation","Begin");

#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     in_CLOCK        = new SC_CLOCK           ("in_CLOCK");
#endif
    
     in_VAL          = new SC_IN (Tcontrol_t)           * [_param._nb_entity];
    if (_param._encoding_one_hot)
    out_ACK          = new SC_OUT(Tcontrol_t)           * [_param._nb_entity];

    for (uint32_t i=0; i<_param._nb_entity; i++)
      {
	rename = " in_VAL_"+toString(i);
	 in_VAL [i]      = new SC_IN (Tcontrol_t) (rename.c_str());

	if (_param._encoding_one_hot)
	  {
	rename = "out_ACK_"+toString(i);
	out_ACK [i]      = new SC_OUT(Tcontrol_t) (rename.c_str());
	  }
      }

    if (_param._encoding_compact)
      {
	out_ENTITY_ACK   = new SC_OUT(Tcontrol_t)           ("out_entity_ack");
	out_ENTITY       = new SC_OUT(Tentity_t)            ("out_entity");
      }
    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    

    log_printf(FUNC,Priority_Fixed,"allocation","End");
  };

}; // end namespace priority_fixed
}; // end namespace select
}; // end namespace generic

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