/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/include/test.h"

#define NB_PARAMS 9

void usage (string exec)
{
  cerr << "<Usage> " << exec << " name_instance list_params" << endl
       << "list_params is :" << endl
       << " - have_bht               (boolean     )" << endl
       << " - bht_size_history       (unsigned int)" << endl
       << " - bht_size_address       (unsigned int)" << endl
       << " - have_pht               (boolean     )" << endl
       << " - pht_size_address       (unsigned int)" << endl
       << " - pht_size_address_share (unsigned int)" << endl
       << " - size_address           (unsigned int)" << endl
       << " - nb_prediction          (unsigned int)" << endl
       << " - nb_branch_complete     (unsigned int)" << endl;
  exit (1);
}

#ifndef SYSTEMC
int main    (int argc, char * argv[])
#else
int sc_main (int argc, char * argv[])
#endif
{
  if (argc != 2+NB_PARAMS)
    usage (argv[0]);

  const string   name                     = argv[1];
  const bool     have_bht                 = atoi(argv[ 2]);
  const uint32_t bht_size_history         = atoi(argv[ 3]);
  const uint32_t bht_size_address         = atoi(argv[ 4]);
  const bool     have_pht                 = atoi(argv[ 5]);
  const uint32_t pht_size_address         = atoi(argv[ 6]);
  const uint32_t pht_size_address_share   = atoi(argv[ 7]);
  const uint32_t size_address             = atoi(argv[ 8]);
  const uint32_t nb_prediction            = atoi(argv[ 9]);
  const uint32_t nb_branch_complete       = atoi(argv[10]);

  morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters param (have_bht              ,
																		  bht_size_history      ,
																		  bht_size_address      ,
																		  have_pht              ,
																		  pht_size_address      ,
																		  pht_size_address_share,
																		  size_address          ,
																		  nb_prediction         ,
																		  nb_branch_complete    );

  test (name,param);

  return (EXIT_SUCCESS);
}

