/*
 * $Id: Parameters_msg_error.cpp 88 2008-12-10 18:31:39Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Types.h"
#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Parameters.h"
#include <sstream>

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_ooo_engine {
namespace ooo_engine {
namespace rename_unit {
namespace load_store_pointer_unit {


#undef  FUNCTION
#define FUNCTION "Load_Store_pointer_unit::msg_error"
  Parameters_test Parameters::msg_error(void)
  {
    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin");

    Parameters_test test ("Load_Store_pointer_unit");

    for (uint32_t i=0; i<_nb_load_store_queue; i++)
      {
	if (not (_size_store_queue [i] > 1))
	  test.error(toString(_("The size of store_queue[%d] must be greater or equal at 2.\n"),i));
	if (not (_size_load_queue  [i] > 0))
	  test.error(toString(_("The size of load_queue[%d] must be greater or equal at 1.\n"),i));
      }

    bool map_lsq [_nb_load_store_queue];
    for (uint32_t i=0; i<_nb_load_store_queue; i++)
      map_lsq [i] = false;
    for (uint32_t i=0; i<_nb_front_end; i++)
      for (uint32_t j=0; j<_nb_context[i]; j++)
	if (_link_load_store_unit_with_thread[i][j] < _nb_load_store_queue)
	  map_lsq [_link_load_store_unit_with_thread[i][j]] = true;
	else
	  test.error(toString(_("The number of load_store_unit for the thread [%d][%d] is too high.\n"),i,j));
	  
    for (uint32_t i=0; i<_nb_load_store_queue; i++)
      if (map_lsq [i] == false)
	test.error(toString(_("The load store unit [%d] is not linked with a thread.\n"),i));
    
    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End");

    return test;
  };

}; // end namespace load_store_pointer_unit
}; // end namespace rename_unit
}; // end namespace ooo_engine
}; // end namespace multi_ooo_engine
}; // end namespace core

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