#ifndef morpheo_behavioural_generic_select_select_priority_fixed_Select_Priority_Fixed_h
#define morpheo_behavioural_generic_select_select_priority_fixed_Select_Priority_Fixed_h

/*
 * $Id: Select_Priority_Fixed.h 82 2008-05-01 16:48:45Z rosiere $
 *
 * [ Description ]
 * 
 */

#ifdef SYSTEMC
#include "systemc.h"
#endif

#include <iostream>
#include "Common/include/ToString.h"
#include "Common/include/Debug.h"

#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Parameters.h"
#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Types.h"
#ifdef STATISTICS
#include "Behavioural/include/Stat.h"
#endif
#include "Behavioural/include/Component.h"
#ifdef VHDL
#include "Behavioural/include/Vhdl.h"
#endif
#include "Behavioural/include/Usage.h"

namespace morpheo {
namespace behavioural {
namespace generic {
namespace select {
namespace select_priority_fixed {


  class Select_Priority_Fixed 
#if SYSTEMC
    : public sc_module
#endif
  {
    // -----[ fields ]----------------------------------------------------
    // Parameters
  protected : const std::string     _name;
  protected : const Parameters * _param;
  private   : const Tusage_t     _usage;
//#ifdef STATISTICS
//  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
//#endif

#ifdef STATISTICS
  public    : Stat                           * _stat;
#endif

  public    : Component                      * _component;
  private   : Interfaces                     * _interfaces;

#ifdef SYSTEMC
    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    // Interface

  public    : SC_CLOCK                      *  in_CLOCK        ;
  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;

  public    : SC_IN (Tcontrol_t)           **  in_VAL          ;
  public    : SC_OUT(Tcontrol_t)           ** out_ACK          ;
  public    : SC_OUT(Tcontrol_t)            * out_ENTITY_ACK   ;
  public    : SC_OUT(Tentity_t)             * out_ENTITY       ;

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

    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#endif

    // -----[ methods ]---------------------------------------------------

#ifdef SYSTEMC
    SC_HAS_PROCESS (Select_Priority_Fixed);
#endif
  public  :          Select_Priority_Fixed 
  (
#ifdef SYSTEMC
   sc_module_name                              name,
#else					       
   std::string                                 name,
#endif					       
#ifdef STATISTICS
   morpheo::behavioural::Parameters_Statistics * param_statistics,
#endif
   Parameters                                  * param ,
   morpheo::behavioural::Tusage_t                usage);
    
  public  :          ~Select_Priority_Fixed             (void);
					       
#ifdef SYSTEMC				       
  private : void     allocation                (void);
  private : void     deallocation              (void);
					       
# if defined(STATISTICS) or defined(VHDL_TESTBENCH)
  public  : void     transition                (void);
# endif
  public  : void     genMealy_entity           (void);
#endif					       
					       
#if VHDL				       
  public  : void     vhdl                      (void);
  private : void     vhdl_declaration          (Vhdl * & vhdl);
  private : void     vhdl_body                 (Vhdl * & vhdl);
#endif					       
					       
#ifdef STATISTICS
  public  : void        statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
#endif
#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
  private : void        end_cycle                 (void);
#endif
  };

}; // end namespace select_priority_fixed
}; // end namespace select
}; // end namespace generic

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

#endif
