gem5  v20.1.0.0
system.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2014,2017-2019 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
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2003-2006 The Regents of The University of Michigan
15  * Copyright (c) 2011 Regents of the University of California
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #include "sim/system.hh"
43 
44 #include <algorithm>
45 
46 #include "arch/remote_gdb.hh"
47 #include "arch/utility.hh"
48 #include "base/compiler.hh"
50 #include "base/loader/symtab.hh"
51 #include "base/str.hh"
52 #include "base/trace.hh"
53 #include "config/use_kvm.hh"
54 #if USE_KVM
55 #include "cpu/kvm/base.hh"
56 #include "cpu/kvm/vm.hh"
57 #endif
58 #include "cpu/base.hh"
59 #include "cpu/thread_context.hh"
60 #include "debug/Loader.hh"
61 #include "debug/Quiesce.hh"
62 #include "debug/WorkItems.hh"
63 #include "mem/abstract_mem.hh"
64 #include "mem/physical.hh"
65 #include "params/System.hh"
66 #include "sim/byteswap.hh"
67 #include "sim/debug.hh"
68 #include "sim/full_system.hh"
69 #include "sim/redirect_path.hh"
70 
71 using namespace std;
72 using namespace TheISA;
73 
75 
76 void
78 {
79 # if THE_ISA != NULL_ISA
80  DPRINTFS(Quiesce, context->getCpuPtr(), "activating\n");
81  context->activate();
82 # endif
83 }
84 
85 std::string
87 {
88  assert(context);
89  return csprintf("%s.threads[%d]", context->getSystemPtr()->name(),
90  context->contextId());
91 }
92 
93 void
95 {
96  context->suspend();
97  auto *workload = context->getSystemPtr()->workload;
98  if (workload)
99  workload->recordQuiesce();
100 }
101 
102 ContextID
104 {
105  if (id == InvalidContextID) {
106  for (id = 0; id < size(); id++) {
107  if (!threads[id].context)
108  break;
109  }
110  }
111 
112  if (id >= size())
113  threads.resize(id + 1);
114 
115  fatal_if(threads[id].context,
116  "Cannot have two thread contexts with the same id (%d).", id);
117 
118  auto *sys = tc->getSystemPtr();
119 
120  auto &t = thread(id);
121  t.context = tc;
122  // Look up this thread again on resume, in case the threads vector has
123  // been reallocated.
124  t.resumeEvent = new EventFunctionWrapper(
125  [this, id](){ thread(id).resume(); }, sys->name());
126 # if THE_ISA != NULL_ISA
127  int port = getRemoteGDBPort();
128  if (port) {
129  t.gdb = new RemoteGDB(sys, tc, port + id);
130  t.gdb->listen();
131  }
132 # endif
133 
134  return id;
135 }
136 
137 void
139 {
140  auto &t = thread(id);
141  panic_if(!t.context, "Can't replace a context which doesn't exist.");
142  if (t.gdb)
143  t.gdb->replaceThreadContext(tc);
144 # if THE_ISA != NULL_ISA
145  if (t.resumeEvent->scheduled()) {
146  Tick when = t.resumeEvent->when();
147  t.context->getCpuPtr()->deschedule(t.resumeEvent);
148  tc->getCpuPtr()->schedule(t.resumeEvent, when);
149  }
150 # endif
151  t.context = tc;
152 }
153 
156 {
157  for (auto &thread: threads) {
158  if (thread.context->status() == ThreadContext::Halted)
159  return thread.context;
160  }
161  return nullptr;
162 }
163 
164 int
166 {
167  int count = 0;
168  for (auto &thread: threads) {
169  auto status = thread.context->status();
170  if (status != ThreadContext::Halted &&
172  count++;
173  }
174  }
175  return count;
176 }
177 
178 void
180 {
181  auto &t = thread(id);
182 # if THE_ISA != NULL_ISA
183  BaseCPU M5_VAR_USED *cpu = t.context->getCpuPtr();
184  DPRINTFS(Quiesce, cpu, "quiesce()\n");
185 # endif
186  t.quiesce();
187 }
188 
189 void
191 {
192 # if THE_ISA != NULL_ISA
193  auto &t = thread(id);
194  BaseCPU *cpu = t.context->getCpuPtr();
195 
196  DPRINTFS(Quiesce, cpu, "quiesceTick until %u\n", when);
197  t.quiesce();
198 
199  cpu->reschedule(t.resumeEvent, when, true);
200 # endif
201 }
202 
204 
206  : SimObject(p), _systemPort("system_port", this),
207  multiThread(p->multi_thread),
208  pagePtr(0),
209  init_param(p->init_param),
210  physProxy(_systemPort, p->cache_line_size),
211  workload(p->workload),
212 #if USE_KVM
213  kvmVM(p->kvm_vm),
214 #else
215  kvmVM(nullptr),
216 #endif
217  physmem(name() + ".physmem", p->memories, p->mmap_using_noreserve,
218  p->shared_backstore),
219  memoryMode(p->mem_mode),
220  _cacheLineSize(p->cache_line_size),
221  workItemsBegin(0),
222  workItemsEnd(0),
223  numWorkIds(p->num_work_ids),
224  thermalModel(p->thermal_model),
225  _params(p),
226  _m5opRange(p->m5ops_base ?
227  RangeSize(p->m5ops_base, 0x10000) :
228  AddrRange(1, 0)), // Create an empty range if disabled
229  totalNumInsts(0),
230  redirectPaths(p->redirect_paths)
231 {
232  if (workload)
233  workload->system = this;
234 
235  // add self to global system list
236  systemList.push_back(this);
237 
238 #if USE_KVM
239  if (kvmVM) {
240  kvmVM->setSystem(this);
241  }
242 #endif
243 
244  // check if the cache line size is a value known to work
245  if (!(_cacheLineSize == 16 || _cacheLineSize == 32 ||
246  _cacheLineSize == 64 || _cacheLineSize == 128))
247  warn_once("Cache line size is neither 16, 32, 64 nor 128 bytes.\n");
248 
249  // Get the generic system requestor IDs
250  RequestorID tmp_id M5_VAR_USED;
251  tmp_id = getRequestorId(this, "writebacks");
252  assert(tmp_id == Request::wbRequestorId);
253  tmp_id = getRequestorId(this, "functional");
254  assert(tmp_id == Request::funcRequestorId);
255  tmp_id = getRequestorId(this, "interrupt");
256  assert(tmp_id == Request::intRequestorId);
257 
258  // increment the number of running systems
260 
261  // Set back pointers to the system in all memories
262  for (int x = 0; x < params()->memories.size(); x++)
263  params()->memories[x]->system(this);
264 }
265 
267 {
268  for (uint32_t j = 0; j < numWorkIds; j++)
269  delete workItemStats[j];
270 }
271 
272 void
274 {
275  // check that the system port is connected
276  if (!_systemPort.isConnected())
277  panic("System port on %s is not connected.\n", name());
278 }
279 
280 void
282 {
284 
285  // Now that we're about to start simulation, wait for GDB connections if
286  // requested.
287 #if THE_ISA != NULL_ISA
288  for (int i = 0; i < threads.size(); i++) {
289  auto *gdb = threads.thread(i).gdb;
290  auto *cpu = threads[i]->getCpuPtr();
291  if (gdb && cpu->waitForRemoteGDB()) {
292  inform("%s: Waiting for a remote GDB connection on port %d.",
293  cpu->name(), gdb->port());
294  gdb->connect();
295  }
296  }
297 #endif
298 }
299 
300 Port &
301 System::getPort(const std::string &if_name, PortID idx)
302 {
303  // no need to distinguish at the moment (besides checking)
304  return _systemPort;
305 }
306 
307 void
308 System::setMemoryMode(Enums::MemoryMode mode)
309 {
310  assert(drainState() == DrainState::Drained);
311  memoryMode = mode;
312 }
313 
315 {
316  if (!threads.size())
317  return false;
318  auto *gdb = threads.thread(0).gdb;
319  if (!gdb)
320  return false;
321  return gdb->breakpoint();
322 }
323 
324 ContextID
326 {
327  ContextID id = threads.insert(tc, assigned);
328 
329  for (auto *e: liveEvents)
330  tc->schedule(e);
331 
332  return id;
333 }
334 
335 bool
337 {
338  bool all = true;
339  liveEvents.push_back(event);
340  for (auto *tc: threads)
341  all = tc->schedule(event) && all;
342  return all;
343 }
344 
345 bool
347 {
348  bool all = true;
349  liveEvents.remove(event);
350  for (auto *tc: threads)
351  all = tc->remove(event) && all;
352  return all;
353 }
354 
355 void
357 {
358  auto *otc = threads[context_id];
359  threads.replace(tc, context_id);
360 
361  for (auto *e: liveEvents) {
362  otc->remove(e);
363  tc->schedule(e);
364  }
365 }
366 
367 bool
369 {
370 #if USE_KVM
371  if (threads.empty())
372  return false;
373 
374  for (auto *tc: threads) {
375  if (!dynamic_cast<BaseKvmCPU *>(tc->getCpuPtr()))
376  return false;
377  }
378 
379  return true;
380 #else
381  return false;
382 #endif
383 }
384 
385 Addr
387 {
388  Addr return_addr = pagePtr << PageShift;
389  pagePtr += npages;
390 
391  Addr next_return_addr = pagePtr << PageShift;
392 
393  if (_m5opRange.contains(next_return_addr)) {
394  warn("Reached m5ops MMIO region\n");
395  return_addr = 0xffffffff;
396  pagePtr = 0xffffffff >> PageShift;
397  }
398 
399  if ((pagePtr << PageShift) > physmem.totalSize())
400  fatal("Out of memory, please increase size of physical memory.");
401  return return_addr;
402 }
403 
404 Addr
406 {
407  return physmem.totalSize();
408 }
409 
410 Addr
412 {
413  return physmem.totalSize() - (pagePtr << PageShift);
414 }
415 
416 bool
418 {
419  return physmem.isMemAddr(addr);
420 }
421 
422 void
424 {
425  if (!deviceMemMap.count(requestor_id)) {
426  deviceMemMap.insert(std::make_pair(requestor_id, deviceMemory));
427  }
428 }
429 
430 bool
432 {
433  const RequestorID& id = pkt->requestorId();
434 
435  return (deviceMemMap.count(id) &&
436  deviceMemMap.at(id)->getAddrRange().contains(pkt->getAddr()));
437 }
438 
441 {
442  panic_if(!deviceMemMap.count(id),
443  "No device memory found for RequestorID %d\n", id);
444  return deviceMemMap.at(id);
445 }
446 
447 void
449 {
450  totalNumInsts = 0;
451 }
452 
453 void
455 {
457 
458  for (auto &t: threads.threads) {
459  Tick when = 0;
460  if (t.resumeEvent && t.resumeEvent->scheduled())
461  when = t.resumeEvent->when();
462  ContextID id = t.context->contextId();
463  paramOut(cp, csprintf("quiesceEndTick_%d", id), when);
464  }
465 
466  // also serialize the memories in the system
467  physmem.serializeSection(cp, "physmem");
468 }
469 
470 
471 void
473 {
475 
476  for (auto &t: threads.threads) {
477  Tick when = 0;
478  ContextID id = t.context->contextId();
479  if (!optParamIn(cp, csprintf("quiesceEndTick_%d", id), when) ||
480  !when || !t.resumeEvent) {
481  continue;
482  }
483 # if THE_ISA != NULL_ISA
484  t.context->getCpuPtr()->schedule(t.resumeEvent, when);
485 # endif
486  }
487 
488  // also unserialize the memories in the system
489  physmem.unserializeSection(cp, "physmem");
490 }
491 
492 void
494 {
496 
497  for (uint32_t j = 0; j < numWorkIds ; j++) {
499  stringstream namestr;
500  ccprintf(namestr, "work_item_type%d", j);
501  workItemStats[j]->init(20)
502  .name(name() + "." + namestr.str())
503  .desc("Run time stat for" + namestr.str())
504  .prereq(*workItemStats[j]);
505  }
506 }
507 
508 void
509 System::workItemEnd(uint32_t tid, uint32_t workid)
510 {
511  std::pair<uint32_t,uint32_t> p(tid, workid);
512  if (!lastWorkItemStarted.count(p))
513  return;
514 
515  Tick samp = curTick() - lastWorkItemStarted[p];
516  DPRINTF(WorkItems, "Work item end: %d\t%d\t%lld\n", tid, workid, samp);
517 
518  if (workid >= numWorkIds)
519  fatal("Got workid greater than specified in system configuration\n");
520 
521  workItemStats[workid]->sample(samp);
522  lastWorkItemStarted.erase(p);
523 }
524 
525 void
527 {
528  ios::fmtflags flags(cerr.flags());
529 
532  for (; i != end; ++i) {
533  System *sys = *i;
534  cerr << "System " << sys->name() << ": " << hex << sys << endl;
535  }
536 
537  cerr.flags(flags);
538 }
539 
540 void
542 {
544 }
545 
546 std::string
547 System::stripSystemName(const std::string& requestor_name) const
548 {
549  if (startswith(requestor_name, name())) {
550  return requestor_name.substr(name().size());
551  } else {
552  return requestor_name;
553  }
554 }
555 
558 {
560 
561  // number of occurrences of the SimObject pointer
562  // in the requestor list.
563  auto obj_number = 0;
564 
565  for (int i = 0; i < requestors.size(); i++) {
566  if (requestors[i].obj == obj) {
567  id = i;
568  obj_number++;
569  }
570  }
571 
572  fatal_if(obj_number > 1,
573  "Cannot lookup RequestorID by SimObject pointer: "
574  "More than one requestor is sharing the same SimObject\n");
575 
576  return id;
577 }
578 
580 System::lookupRequestorId(const std::string& requestor_name) const
581 {
582  std::string name = stripSystemName(requestor_name);
583 
584  for (int i = 0; i < requestors.size(); i++) {
585  if (requestors[i].req_name == name) {
586  return i;
587  }
588  }
589 
591 }
592 
594 System::getGlobalRequestorId(const std::string& requestor_name)
595 {
596  return _getRequestorId(nullptr, requestor_name);
597 }
598 
600 System::getRequestorId(const SimObject* requestor, std::string subrequestor)
601 {
602  auto requestor_name = leafRequestorName(requestor, subrequestor);
603  return _getRequestorId(requestor, requestor_name);
604 }
605 
608  const std::string& requestor_name)
609 {
610  std::string name = stripSystemName(requestor_name);
611 
612  // CPUs in switch_cpus ask for ids again after switching
613  for (int i = 0; i < requestors.size(); i++) {
614  if (requestors[i].req_name == name) {
615  return i;
616  }
617  }
618 
619  // Verify that the statistics haven't been enabled yet
620  // Otherwise objects will have sized their stat buckets and
621  // they will be too small
622 
623  if (Stats::enabled()) {
624  fatal("Can't request a requestorId after regStats(). "
625  "You must do so in init().\n");
626  }
627 
628  // Generate a new RequestorID incrementally
629  RequestorID requestor_id = requestors.size();
630 
631  // Append the new Requestor metadata to the group of system Requestors.
632  requestors.emplace_back(requestor, name, requestor_id);
633 
634  return requestors.back().id;
635 }
636 
637 std::string
639  const std::string& subrequestor)
640 {
641  if (subrequestor.empty()) {
642  return requestor->name();
643  } else {
644  // Get the full requestor name by appending the subrequestor name to
645  // the root SimObject requestor name
646  return requestor->name() + "." + subrequestor;
647  }
648 }
649 
650 std::string
652 {
653  if (requestor_id >= requestors.size())
654  fatal("Invalid requestor_id passed to getRequestorName()\n");
655 
656  const auto& requestor_info = requestors[requestor_id];
657  return requestor_info.req_name;
658 }
659 
660 System *
661 SystemParams::create()
662 {
663  return new System(this);
664 }
BaseRemoteGDB::breakpoint
bool breakpoint()
Definition: remote_gdb.hh:48
Request::intRequestorId
@ intRequestorId
This requestor id is used for message signaled interrupts.
Definition: request.hh:250
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
ArmISA::status
Bitfield< 5, 0 > status
Definition: miscregs_types.hh:417
System::deviceMemMap
std::unordered_map< RequestorID, AbstractMemory * > deviceMemMap
Definition: system.hh:102
Stats::Group::regStats
virtual void regStats()
Callback to set stat parameters.
Definition: group.cc:64
System::getRequestorId
RequestorID getRequestorId(const SimObject *requestor, std::string subrequestor=std::string())
Request an id used to create a request object in the system.
Definition: system.cc:600
System::pagePtr
Addr pagePtr
Definition: system.hh:318
Serializable::unserializeSection
void unserializeSection(CheckpointIn &cp, const char *name)
Unserialize an a child object.
Definition: serialize.cc:178
System::Threads::numRunning
int numRunning() const
Definition: system.cc:165
warn
#define warn(...)
Definition: logging.hh:239
SimObject::Params
SimObjectParams Params
Definition: sim_object.hh:113
system.hh
System::liveEvents
std::list< PCEvent * > liveEvents
Definition: system.hh:98
UNSERIALIZE_SCALAR
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:797
Packet::getAddr
Addr getAddr() const
Definition: packet.hh:754
System::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: system.cc:281
abstract_mem.hh
warn_once
#define warn_once(...)
Definition: logging.hh:243
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
System::workItemEnd
void workItemEnd(uint32_t tid, uint32_t workid)
Definition: system.cc:509
ThreadContext::Halting
@ Halting
Trying to exit and waiting for an event to completely exit.
Definition: thread_context.hh:110
System::init
void init() override
After all objects have been created and all ports are connected, check that the system port is connec...
Definition: system.cc:273
ContextID
int ContextID
Globally unique thread context ID.
Definition: types.hh:231
System::_getRequestorId
RequestorID _getRequestorId(const SimObject *requestor, const std::string &requestor_name)
helper function for getRequestorId
Definition: system.cc:607
TheISA
Definition: decode_cache.hh:37
System::Threads::Thread::quiesce
void quiesce() const
Definition: system.cc:94
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
redirect_path.hh
System::registerThreadContext
ContextID registerThreadContext(ThreadContext *tc, ContextID assigned=InvalidContextID)
Definition: system.cc:325
PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
AddrRange::contains
bool contains(const Addr &a) const
Determine if the range contains an address.
Definition: addr_range.hh:435
System::_cacheLineSize
const unsigned int _cacheLineSize
Definition: system.hh:416
Workload::system
System * system
Definition: workload.hh:64
System::getGlobalRequestorId
RequestorID getGlobalRequestorId(const std::string &requestor_name)
Registers a GLOBAL RequestorID, which is a RequestorID not related to any particular SimObject; since...
Definition: system.cc:594
Packet::requestorId
RequestorID requestorId() const
Definition: packet.hh:740
std::vector< System * >
InvalidContextID
const ContextID InvalidContextID
Definition: types.hh:232
X86ISA::count
count
Definition: misc.hh:703
System::validKvmEnvironment
bool validKvmEnvironment() const
Verify gem5 configuration will support KVM emulation.
Definition: system.cc:368
System::replaceThreadContext
void replaceThreadContext(ThreadContext *tc, ContextID context_id)
Definition: system.cc:356
Serializable::serializeSection
void serializeSection(CheckpointOut &cp, const char *name) const
Serialize an object into a new section.
Definition: serialize.cc:171
System::Threads::replace
void replace(ThreadContext *tc, ContextID id)
Definition: system.cc:138
paramOut
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
Definition: types.cc:38
System::Threads::findFree
ThreadContext * findFree()
Definition: system.cc:155
System::printSystems
static void printSystems()
Definition: system.cc:526
EventFunctionWrapper
Definition: eventq.hh:1101
printSystems
void printSystems()
Definition: system.cc:541
System::stripSystemName
std::string stripSystemName(const std::string &requestor_name) const
Strips off the system name from a requestor name.
Definition: system.cc:547
Stats::Histogram
A simple histogram stat.
Definition: statistics.hh:2654
System::lookupRequestorId
RequestorID lookupRequestorId(const SimObject *obj) const
Looks up the RequestorID for a given SimObject returns an invalid RequestorID (invldRequestorId) if n...
Definition: system.cc:557
DrainState::Drained
@ Drained
Buffers drained, ready for serialization/handover.
str.hh
System::memoryMode
Enums::MemoryMode memoryMode
Definition: system.hh:414
SimObject::startup
virtual void startup()
startup() is the final initialization call before simulation.
Definition: sim_object.cc:96
System::breakpoint
bool breakpoint()
Definition: system.cc:314
System::systemList
static std::vector< System * > systemList
Definition: system.hh:613
AbstractMemory
An abstract memory represents a contiguous block of physical memory, with an associated address range...
Definition: abstract_mem.hh:104
System::System
System(Params *p)
Definition: system.cc:205
RequestorID
uint16_t RequestorID
Definition: request.hh:85
System::Threads::Thread::gdb
BaseRemoteGDB * gdb
Definition: system.hh:113
ArmISA::j
Bitfield< 24 > j
Definition: miscregs_types.hh:54
cp
Definition: cprintf.cc:40
System::workload
Workload * workload
OS kernel.
Definition: system.hh:327
BaseKvmCPU
Base class for KVM based CPU models.
Definition: base.hh:77
Stats::enabled
bool enabled()
Definition: statistics.cc:545
System::physmem
PhysicalMemory physmem
Definition: system.hh:412
System::setMemoryMode
void setMemoryMode(Enums::MemoryMode mode)
Change the memory mode of the system.
Definition: system.cc:308
System::Threads::Thread::name
std::string name() const
Definition: system.cc:86
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
AddrRange
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition: addr_range.hh:68
PCEventScope::schedule
virtual bool schedule(PCEvent *event)=0
System
Definition: system.hh:73
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
PhysicalMemory::totalSize
uint64_t totalSize() const
Get the total physical memory size.
Definition: physical.hh:201
ThreadContext::Halted
@ Halted
Permanently shut down.
Definition: thread_context.hh:115
ArmISA::PageShift
const Addr PageShift
Definition: isa_traits.hh:51
System::~System
~System()
Definition: system.cc:266
Request::wbRequestorId
@ wbRequestorId
This requestor id is used for writeback requests by the caches.
Definition: request.hh:243
MipsISA::event
Bitfield< 10, 5 > event
Definition: pra_constants.hh:297
debug.hh
System::numWorkIds
uint32_t numWorkIds
Definition: system.hh:420
optParamIn
bool optParamIn(CheckpointIn &cp, const std::string &name, T &param, bool warn=true)
This function is used for restoring optional parameters from the checkpoint.
Definition: serialize.hh:507
Port
Ports are used to interface objects to each other.
Definition: port.hh:56
System::Threads::quiesceTick
void quiesceTick(ContextID id, Tick when)
Definition: system.cc:190
System::Threads::quiesce
void quiesce(ContextID id)
Definition: system.cc:179
KvmVM::setSystem
void setSystem(System *s)
Initialize system pointer.
Definition: vm.cc:531
RangeSize
AddrRange RangeSize(Addr start, Addr size)
Definition: addr_range.hh:638
ArmISA::mode
Bitfield< 4, 0 > mode
Definition: miscregs_types.hh:70
System::Threads::insert
ContextID insert(ThreadContext *tc, ContextID id=InvalidContextID)
Definition: system.cc:103
System::schedule
bool schedule(PCEvent *event) override
Definition: system.cc:336
Request::invldRequestorId
@ invldRequestorId
Invalid requestor id for assertion checking only.
Definition: request.hh:255
System::Threads::size
int size() const
Definition: system.hh:204
compiler.hh
System::leafRequestorName
std::string leafRequestorName(const SimObject *requestor, const std::string &subrequestor)
Helper function for constructing the full (sub)requestor name by providing the root requestor and the...
Definition: system.cc:638
System::memSize
Addr memSize() const
Amount of physical memory that exists.
Definition: system.cc:405
System::numSystemsRunning
static int numSystemsRunning
Definition: system.hh:614
System::Threads::Thread::resume
void resume()
Definition: system.cc:77
RiscvISA::x
Bitfield< 3 > x
Definition: pagetable.hh:69
std::pair
STL pair class.
Definition: stl.hh:58
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
System::Threads::thread
Thread & thread(ContextID id)
Definition: system.hh:124
name
const std::string & name()
Definition: trace.cc:50
base.hh
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:790
System::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: system.cc:472
vm.hh
full_system.hh
ArmISA::e
Bitfield< 9 > e
Definition: miscregs_types.hh:61
Drainable::drainState
DrainState drainState() const
Return the current drain state of an object.
Definition: drain.hh:320
Request::funcRequestorId
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
Definition: request.hh:248
System::freeMemSize
Addr freeMemSize() const
Amount of physical memory that is still free.
Definition: system.cc:411
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:133
System::_systemPort
SystemPort _systemPort
Definition: system.hh:99
BaseCPU
Definition: cpu_dummy.hh:43
System::lastWorkItemStarted
std::map< std::pair< uint32_t, uint32_t >, Tick > lastWorkItemStarted
Definition: system.hh:604
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:197
System::threads
Threads threads
Definition: system.hh:309
System::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Additional function to return the Port of a memory object.
Definition: system.cc:301
System::workItemStats
std::map< uint32_t, Stats::Histogram * > workItemStats
Definition: system.hh:605
System::_m5opRange
const AddrRange _m5opRange
Range for memory-mapped m5 pseudo ops.
Definition: system.hh:573
inform
#define inform(...)
Definition: logging.hh:240
PhysicalMemory::isMemAddr
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
Definition: physical.cc:252
System::isDeviceMemAddr
bool isDeviceMemAddr(PacketPtr pkt) const
Similar to isMemAddr but for devices.
Definition: system.cc:431
base.hh
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
System::kvmVM
KvmVM *const kvmVM
Definition: system.hh:410
ArmISA::t
Bitfield< 5 > t
Definition: miscregs_types.hh:67
startswith
bool startswith(const char *s, const char *prefix)
Return true if 's' starts with the prefix string 'prefix'.
Definition: str.hh:224
System::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: system.cc:454
System::totalNumInsts
Counter totalNumInsts
Definition: system.hh:603
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
physical.hh
addr
ip6_addr_t addr
Definition: inet.hh:423
Port::isConnected
bool isConnected() const
Is this port currently connected to a peer?
Definition: port.hh:128
DPRINTFS
#define DPRINTFS(x,...)
Definition: trace.hh:235
ccprintf
void ccprintf(cp::Print &print)
Definition: cprintf.hh:127
System::requestors
std::vector< RequestorInfo > requestors
This array is a per-system list of all devices capable of issuing a memory system request and an asso...
Definition: system.hh:427
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
System::addDeviceMemory
void addDeviceMemory(RequestorID requestorId, AbstractMemory *deviceMemory)
Add a physical memory range for a device.
Definition: system.cc:423
System::remove
bool remove(PCEvent *event) override
Definition: system.cc:346
System::getRequestorName
std::string getRequestorName(RequestorID requestor_id)
Get the name of an object for a given request id.
Definition: system.cc:651
System::allocPhysPages
Addr allocPhysPages(int npages)
Allocate npages contiguous unused physical pages.
Definition: system.cc:386
PCEvent
Definition: pc_event.hh:42
System::getDeviceMemory
AbstractMemory * getDeviceMemory(RequestorID _id) const
Return a pointer to the device memory.
Definition: system.cc:440
trace.hh
symtab.hh
System::Threads::empty
bool empty() const
Definition: system.hh:205
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
fatal_if
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Definition: logging.hh:219
CheckpointIn
Definition: serialize.hh:67
getRemoteGDBPort
int getRemoteGDBPort()
Definition: debug.cc:119
ThreadContext::getCpuPtr
virtual BaseCPU * getCpuPtr()=0
System::regStats
void regStats() override
Callback to set stat parameters.
Definition: system.cc:493
System::params
const Params * params() const
Definition: system.hh:579
object_file.hh
System::isMemAddr
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
Definition: system.cc:417
System::Threads::threads
std::vector< Thread > threads
Definition: system.hh:121
csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:158
thread_context.hh
ArmISA::id
Bitfield< 33 > id
Definition: miscregs_types.hh:247
byteswap.hh
ThreadContext::getSystemPtr
virtual System * getSystemPtr()=0
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
System::drainResume
void drainResume() override
Resume execution after a successful drain.
Definition: system.cc:448
curTick
Tick curTick()
The current simulated tick.
Definition: core.hh:45
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:92

Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17