#ifdef SYSTEMC
/*
 * $Id: Write_queue_genMealy_bypass.cpp 123 2009-06-08 20:43:30Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/include/Write_queue.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace multi_write_unit {
namespace write_unit {
namespace write_queue {


#undef  FUNCTION
#define FUNCTION "Write_queue::genMealy_bypass"
  void Write_queue::genMealy_bypass (void)
  {
    log_begin(Write_queue,FUNCTION);
    log_function(Write_queue,FUNCTION,_name.c_str());

    if (PORT_READ(in_NRESET))
      {
    Tcontrol_t val = PORT_READ(in_WRITE_QUEUE_IN_VAL);

    if (_param->_have_port_ooo_engine_id)
    PORT_WRITE(out_BYPASS_WRITE_OOO_ENGINE_ID [0], PORT_READ(in_WRITE_QUEUE_IN_OOO_ENGINE_ID));
    PORT_WRITE(out_BYPASS_WRITE_GPR_VAL       [0], val and PORT_READ(in_WRITE_QUEUE_IN_WRITE_RD     ));
    PORT_WRITE(out_BYPASS_WRITE_GPR_NUM_REG   [0], PORT_READ(in_WRITE_QUEUE_IN_NUM_REG_RD   )); // RD
    PORT_WRITE(out_BYPASS_WRITE_GPR_DATA      [0], PORT_READ(in_WRITE_QUEUE_IN_DATA_RD      ));
    PORT_WRITE(out_BYPASS_WRITE_SPR_VAL       [0], val and PORT_READ(in_WRITE_QUEUE_IN_WRITE_RE     ));
    PORT_WRITE(out_BYPASS_WRITE_SPR_NUM_REG   [0], PORT_READ(in_WRITE_QUEUE_IN_NUM_REG_RE   )); // RE
    PORT_WRITE(out_BYPASS_WRITE_SPR_DATA      [0], PORT_READ(in_WRITE_QUEUE_IN_DATA_RE      ));
      }
    else
      {
    PORT_WRITE(out_BYPASS_WRITE_GPR_VAL       [0], 0);
    PORT_WRITE(out_BYPASS_WRITE_SPR_VAL       [0], 0);
      }

    log_end(Write_queue,FUNCTION);
  };

}; // end namespace write_queue
}; // end namespace write_unit
}; // end namespace multi_write_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

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