コード例 #1
0
ファイル: Cluster.cpp プロジェクト: rlavaee/sesc-src
Cluster *Cluster::create(const char *clusterName, GMemorySystem *ms, GProcessor *gproc)
{
  // Note: Clusters do NOT share functional units. This breaks the cluster
  // principle. If someone were interested in doing that, the UnitMap sould be
  // cleared (unitMap.clear()) by the PendingWindow instead of buildCluster. If
  // the objective is to share the FUs even between Cores, UnitMap must be
  // declared static in that class (what a mess!)

  unitMap.clear();

  // Constraints
  SescConf->isCharPtr(clusterName,"recycleAt");
  SescConf->isInList(clusterName,"recycleAt","Execute","Retire","Issue");  //NM added Issue
  const char *recycleAt = SescConf->getCharPtr(clusterName,"recycleAt");
  
  SescConf->isLong(clusterName,"winSize");
  SescConf->isBetween(clusterName,"winSize",1,262144);
  
  Cluster *cluster;
  if( strcasecmp(recycleAt,"retire") == 0) {
    cluster = new RetiredCluster(clusterName, gproc);
  }else if( strcasecmp(recycleAt,"issue") == 0) {  //NM added issue
    cluster = new IssuedCluster(clusterName, gproc);
  }else{
    I( strcasecmp(recycleAt,"execute") == 0);
    cluster = new ExecutedCluster(clusterName, gproc);
  }

  char strtmp[128];
  sprintf(strtmp,"%s_energy",clusterName);
  GStatsEnergyCGBase *ecgbase = new GStatsEnergyCGBase(strtmp,gproc->getId());

  cluster->buildUnit(clusterName,ms,cluster,iALU,ecgbase);
  cluster->buildUnit(clusterName,ms,cluster,iMult,ecgbase);  
  cluster->buildUnit(clusterName,ms,cluster,iDiv,ecgbase);
  cluster->buildUnit(clusterName,ms,cluster,iBJ,ecgbase);
  cluster->buildUnit(clusterName,ms,cluster,iLoad,ecgbase);
  cluster->buildUnit(clusterName,ms,cluster,iStore,ecgbase);
  cluster->buildUnit(clusterName,ms,cluster,fpALU,ecgbase);
  cluster->buildUnit(clusterName,ms,cluster,fpMult,ecgbase);
  cluster->buildUnit(clusterName,ms,cluster,fpDiv,ecgbase);

 // Do not leave useless garbage
  unitMap.clear();

  return cluster;
}
コード例 #2
0
ファイル: Cluster.cpp プロジェクト: trenttong/PESESC
Cluster *Cluster::create(const char *clusterName, GMemorySystem *ms, GProcessor *gproc) {
  // Note: Clusters do NOT share functional units. This breaks the cluster
  // principle. If someone were interested in doing that, the UnitMap sould be
  // cleared (unitMap.clear()) by the PendingWindow instead of buildCluster. If
  // the objective is to share the FUs even between Cores, UnitMap must be
  // declared static in that class (what a mess!)

  unitMap.clear();

  // Constraints
  SescConf->isCharPtr(clusterName,"recycleAt");
  SescConf->isInList(clusterName,"recycleAt","Executing","Execute","Retire");
  const char *recycleAt = SescConf->getCharPtr(clusterName,"recycleAt");
  
  SescConf->isInt(clusterName,"winSize");
  SescConf->isBetween(clusterName,"winSize",1,262144);
  
  Cluster *cluster;
  if( strcasecmp(recycleAt,"retire") == 0) {
    cluster = new RetiredCluster(clusterName, gproc);
  }else if( strcasecmp(recycleAt,"executing") == 0) {
    cluster = new ExecutingCluster(clusterName, gproc);
  }else{
    I( strcasecmp(recycleAt,"execute") == 0);
    cluster = new ExecutedCluster(clusterName, gproc);
  }

  cluster->regPool = SescConf->getInt(clusterName, "nRegs");

  SescConf->isInt(clusterName     , "nRegs");
  SescConf->isBetween(clusterName , "nRegs", 16, 262144);

  for(int32_t t = 0; t < iMAX; t++) {
    cluster->buildUnit(clusterName,ms,cluster,static_cast<InstOpcode>(t));
  }

 // Do not leave useless garbage
  unitMap.clear();

  return cluster;
}