#ifdef SYSTEMC
/*
 * $Id: Functionnal_unit_genMealy.cpp 81 2008-04-15 18:40:01Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/include/Functionnal_unit.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace multi_execute_unit {
namespace execute_unit {
namespace functionnal_unit {


#undef  FUNCTION
#define FUNCTION "Functionnal_unit::genMealy"
  void Functionnal_unit::genMealy (void)
  {
    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");

    bool execute_out_transaction = (PORT_READ(in_EXECUTE_OUT_ACK) and
				    (reg_BUSY and (_execute_operation->_timing._latence == 0)));

    internal_EXECUTE_IN_ACK = not reg_BUSY or (reg_BUSY and execute_out_transaction);

    PORT_WRITE(out_EXECUTE_IN_ACK, internal_EXECUTE_IN_ACK);

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

}; // end namespace functionnal_unit
}; // end namespace execute_unit
}; // end namespace multi_execute_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

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