<commit_before>#include "performance_model.h"
#include "branch_predictor.h"
#include "simulator.h"
#include "simple_performance_model.h"
#include "iocoom_performance_model.h"

PerformanceModel* PerformanceModel::create()
{
   string type;

   try {
      type = Sim()->getCfg()->getString("perf_model/core/type");
   } catch (...) {
      LOG_PRINT_ERROR("No perf model type provided.");
   }

   if (type == "iocoom")
      return new IOCOOMPerformanceModel();
   else if (type == "simple")
      return new SimplePerformanceModel();
   else
   {
      LOG_PRINT_ERROR("Invalid perf model type: %s", type.c_str());
      return NULL;
   }
}

// Public Interface
PerformanceModel::PerformanceModel()
   : m_enabled(true)
   , m_current_ins_index(0)
   , m_bp(0)
{
   m_bp = BranchPredictor::create();
}

PerformanceModel::~PerformanceModel()
{
   delete m_bp; m_bp = 0;
}

void PerformanceModel::enable()
{
   m_enabled = true;
}

void PerformanceModel::disable()
{
   m_enabled = false;
}<commit_msg>[perf_model] Don't ever enable the MCP core performance model.<commit_after>#include "performance_model.h"
#include "branch_predictor.h"
#include "simulator.h"
#include "simple_performance_model.h"
#include "iocoom_performance_model.h"
#include "core_manager.h"

PerformanceModel* PerformanceModel::create()
{
   string type;

   try {
      type = Sim()->getCfg()->getString("perf_model/core/type");
   } catch (...) {
      LOG_PRINT_ERROR("No perf model type provided.");
   }

   if (type == "iocoom")
      return new IOCOOMPerformanceModel();
   else if (type == "simple")
      return new SimplePerformanceModel();
   else
   {
      LOG_PRINT_ERROR("Invalid perf model type: %s", type.c_str());
      return NULL;
   }
}

// Public Interface
PerformanceModel::PerformanceModel()
   : m_enabled(false)
   , m_current_ins_index(0)
   , m_bp(0)
{
   m_bp = BranchPredictor::create();
}

PerformanceModel::~PerformanceModel()
{
   delete m_bp; m_bp = 0;
}

void PerformanceModel::enable()
{
   // MCP perf model should never be enabled
   if (Sim()->getCoreManager()->getCurrentCoreID() == Config::getSingleton()->getMCPCoreNum())
      return;

   m_enabled = true;
}

void PerformanceModel::disable()
{
   m_enabled = false;
}
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.0026869682042095834, 'mean_word_length': 4.031531531531532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2641515', 'n_tokens_mistral': 753, 'n_tokens_neox': 723, 'n_words': 153}