1/* 2 * Copyright (c) 2010-2012, 2015 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 49 unchanged lines hidden (view full) --- 58#include "config/the_isa.hh" 59#include "cpu/base.hh" 60#include "cpu/quiesce_event.hh" 61#include "cpu/thread_context.hh" 62#include "debug/Loader.hh" 63#include "debug/PseudoInst.hh" 64#include "debug/Quiesce.hh" 65#include "debug/WorkItems.hh" |
66#include "dev/net/dist_iface.hh" |
67#include "params/BaseCPU.hh" 68#include "sim/full_system.hh" |
69#include "sim/initparam_keys.hh" |
70#include "sim/process.hh" 71#include "sim/pseudo_inst.hh" 72#include "sim/serialize.hh" 73#include "sim/sim_events.hh" 74#include "sim/sim_exit.hh" 75#include "sim/stat_control.hh" 76#include "sim/stats.hh" 77#include "sim/system.hh" --- 276 unchanged lines hidden (view full) --- 354 if (other_tc->status() == ThreadContext::Suspended) 355 other_tc->activate(); 356} 357 358void 359m5exit(ThreadContext *tc, Tick delay) 360{ 361 DPRINTF(PseudoInst, "PseudoInst::m5exit(%i)\n", delay); |
362 if (DistIface::readyToExit(delay)) { 363 Tick when = curTick() + delay * SimClock::Int::ns; 364 exitSimLoop("m5_exit instruction encountered", 0, when, 0, true); 365 } |
366} 367 368void 369m5fail(ThreadContext *tc, Tick delay, uint64_t code) 370{ 371 DPRINTF(PseudoInst, "PseudoInst::m5fail(%i, %i)\n", delay, code); 372 Tick when = curTick() + delay * SimClock::Int::ns; 373 exitSimLoop("m5_fail instruction encountered", code, when, 0, true); --- 96 unchanged lines hidden (view full) --- 470 sizeof(uint64_t)); 471 } else { 472 assert(key_str2 == 0); 473 } 474 475 // Compare the key parameter with the known values to select the return 476 // value 477 uint64_t val; |
478 if (strcmp(key_str, InitParamKey::DEFAULT) == 0) { |
479 val = tc->getCpuPtr()->system->init_param; |
480 } else if (strcmp(key_str, InitParamKey::DIST_RANK) == 0) { 481 val = DistIface::rankParam(); 482 } else if (strcmp(key_str, InitParamKey::DIST_SIZE) == 0) { 483 val = DistIface::sizeParam(); |
484 } else { |
485 panic("Unknown key for initparam pseudo instruction:\"%s\"", key_str); |
486 } 487 return val; 488} 489 490 491void 492resetstats(ThreadContext *tc, Tick delay, Tick period) 493{ --- 38 unchanged lines hidden (view full) --- 532 533void 534m5checkpoint(ThreadContext *tc, Tick delay, Tick period) 535{ 536 DPRINTF(PseudoInst, "PseudoInst::m5checkpoint(%i, %i)\n", delay, period); 537 if (!tc->getCpuPtr()->params()->do_checkpoint_insts) 538 return; 539 |
540 if (DistIface::readyToCkpt(delay, period)) { 541 Tick when = curTick() + delay * SimClock::Int::ns; 542 Tick repeat = period * SimClock::Int::ns; 543 exitSimLoop("checkpoint", 0, when, repeat); 544 } |
545} 546 547uint64_t 548readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset) 549{ 550 DPRINTF(PseudoInst, "PseudoInst::readfile(0x%x, 0x%x, 0x%x)\n", 551 vaddr, len, offset); 552 if (!FullSystem) { --- 215 unchanged lines hidden --- |