#ifdef STATISTICS
/*
 * $Id: OOO_Engine_Glue_statistics_allocation.cpp 110 2009-02-19 16:31:47Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/include/OOO_Engine_Glue.h"

namespace morpheo {
namespace behavioural {
namespace core {
namespace multi_ooo_engine {
namespace ooo_engine {
namespace ooo_engine_glue {


#undef  FUNCTION
#define FUNCTION "OOO_Engine_Glue::statistics_allocation"
  void OOO_Engine_Glue::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics)
  {
    log_begin(OOO_Engine_Glue,FUNCTION);

    _stat = new Stat (static_cast<std::string>(_name),
		      "OOO_Engine_Glue",
		      param_statistics);

    _stat_nb_inst_issue_stall_by_registerfile = _stat->create_variable("nb_inst_issue_stall_by_registerfile");
//  _stat_nb_inst_issue_stall_by_rename_unit  = _stat->create_variable("nb_inst_issue_stall_by_rename_unit" );
    _stat_nb_inst_issue_stall_by_commit_unit  = _stat->create_variable("nb_inst_issue_stall_by_commit_unit" );
    _stat_nb_inst_issue_stall_by_issue_queue  = _stat->create_variable("nb_inst_issue_stall_by_issue_queue" );

//     std::string nb_inst_issue_stall = "+ + nb_inst_issue_stall_by_registerfile nb_inst_issue_stall_by_rename_unit + nb_inst_issue_stall_by_commit_unit nb_inst_issue_stall_by_issue_queue";
    std::string nb_inst_issue_stall = "+ nb_inst_issue_stall_by_registerfile + nb_inst_issue_stall_by_commit_unit nb_inst_issue_stall_by_issue_queue";

    _stat->create_expr_percent ("percent_issue_stall_by_registerfile", "nb_inst_issue_stall_by_registerfile", nb_inst_issue_stall, _("Percent of instruction stalled by RegisterFile"));
//  _stat->create_expr_percent ("percent_issue_stall_by_rename_unit" , "nb_inst_issue_stall_by_rename_unit" , nb_inst_issue_stall, _("Percent of instruction stalled by Rename_Unit") );
    _stat->create_expr_percent ("percent_issue_stall_by_commit_unit" , "nb_inst_issue_stall_by_commit_unit" , nb_inst_issue_stall, _("Percent of instruction stalled by Commit_Unit") );
    _stat->create_expr_percent ("percent_issue_stall_by_issue_queue" , "nb_inst_issue_stall_by_issue_queue" , nb_inst_issue_stall, _("Percent of instruction stalled by Issue_Queue") );
    
    log_end(OOO_Engine_Glue,FUNCTION);
  };

}; // end namespace ooo_engine_glue
}; // end namespace ooo_engine
}; // end namespace multi_ooo_engine
}; // end namespace core

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