Example #1
0
static int runCores(SystemState &sys, const std::set<Core*> &cores,
                     const std::map<Core*,uint32_t> &entryPoints)
{
  for (std::set<Core*>::iterator it = cores.begin(), e = cores.end(); it != e;
       ++it) {
    Core *core = *it;
    sys.schedule(core->getThread(0));
    std::map<Core*,uint32_t>::const_iterator match;
    if ((match = entryPoints.find(core)) != entryPoints.end()) {
      uint32_t entryPc = core->physicalAddress(match->second) >> 1;
      if (core->isValidPc(entryPc)) {
        core->getThread(0).pc = entryPc;
      } else {
        std::cout << "Warning: invalid ELF entry point 0x";
        std::cout << std::hex << match->second << std::dec << "\n";
      }
    }
  }