gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pseudo_inst.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2012, 2015, 2017 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) 2011 Advanced Micro Devices, Inc.
15  * Copyright (c) 2003-2006 The Regents of The University of Michigan
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  * Authors: Nathan Binkert
42  */
43 
44 #include "sim/pseudo_inst.hh"
45 
46 #include <fcntl.h>
47 #include <unistd.h>
48 
49 #include <cerrno>
50 #include <fstream>
51 #include <string>
52 #include <vector>
53 
54 #include "arch/vtophys.hh"
55 #include "base/debug.hh"
56 #include "base/output.hh"
57 #include "config/the_isa.hh"
58 #include "cpu/base.hh"
59 #include "cpu/quiesce_event.hh"
60 #include "cpu/thread_context.hh"
61 #include "debug/Loader.hh"
62 #include "debug/Quiesce.hh"
63 #include "debug/WorkItems.hh"
64 #include "dev/net/dist_iface.hh"
65 #include "kern/kernel_stats.hh"
66 #include "params/BaseCPU.hh"
67 #include "sim/full_system.hh"
68 #include "sim/initparam_keys.hh"
69 #include "sim/process.hh"
70 #include "sim/serialize.hh"
71 #include "sim/sim_events.hh"
72 #include "sim/sim_exit.hh"
73 #include "sim/stat_control.hh"
74 #include "sim/stats.hh"
75 #include "sim/system.hh"
76 #include "sim/vptr.hh"
77 
78 using namespace std;
79 using namespace Stats;
80 
81 namespace PseudoInst
82 {
83 
84 static inline void
86 {
87  panic("Pseudo inst \"%s\" is only available in Full System mode.");
88 }
89 
90 void
92 {
93  DPRINTF(PseudoInst, "PseudoInst::arm()\n");
94  if (!FullSystem)
95  panicFsOnlyPseudoInst("arm");
96 
97  if (tc->getKernelStats())
98  tc->getKernelStats()->arm();
99 }
100 
101 void
103 {
104  DPRINTF(PseudoInst, "PseudoInst::quiesce()\n");
105  tc->quiesce();
106 }
107 
108 void
110 {
111  DPRINTF(PseudoInst, "PseudoInst::quiesceSkip()\n");
112  tc->quiesceTick(tc->getCpuPtr()->nextCycle() + 1);
113 }
114 
115 void
116 quiesceNs(ThreadContext *tc, uint64_t ns)
117 {
118  DPRINTF(PseudoInst, "PseudoInst::quiesceNs(%i)\n", ns);
119  tc->quiesceTick(curTick() + SimClock::Int::ns * ns);
120 }
121 
122 void
123 quiesceCycles(ThreadContext *tc, uint64_t cycles)
124 {
125  DPRINTF(PseudoInst, "PseudoInst::quiesceCycles(%i)\n", cycles);
126  tc->quiesceTick(tc->getCpuPtr()->clockEdge(Cycles(cycles)));
127 }
128 
129 uint64_t
131 {
132  DPRINTF(PseudoInst, "PseudoInst::quiesceTime()\n");
133 
134  return (tc->readLastActivate() - tc->readLastSuspend()) /
136 }
137 
138 uint64_t
140 {
141  DPRINTF(PseudoInst, "PseudoInst::rpns()\n");
142  return curTick() / SimClock::Int::ns;
143 }
144 
145 void
147 {
148  DPRINTF(PseudoInst, "PseudoInst::wakeCPU(%i)\n", cpuid);
149  System *sys = tc->getSystemPtr();
150 
151  if (sys->numContexts() <= cpuid) {
152  warn("PseudoInst::wakeCPU(%i), cpuid greater than number of contexts"
153  "(%i)\n",cpuid, sys->numContexts());
154  return;
155  }
156 
157  ThreadContext *other_tc = sys->threadContexts[cpuid];
158  if (other_tc->status() == ThreadContext::Suspended)
159  other_tc->activate();
160 }
161 
162 void
164 {
165  DPRINTF(PseudoInst, "PseudoInst::m5exit(%i)\n", delay);
166  if (DistIface::readyToExit(delay)) {
167  Tick when = curTick() + delay * SimClock::Int::ns;
168  exitSimLoop("m5_exit instruction encountered", 0, when, 0, true);
169  }
170 }
171 
172 void
173 m5fail(ThreadContext *tc, Tick delay, uint64_t code)
174 {
175  DPRINTF(PseudoInst, "PseudoInst::m5fail(%i, %i)\n", delay, code);
176  Tick when = curTick() + delay * SimClock::Int::ns;
177  exitSimLoop("m5_fail instruction encountered", code, when, 0, true);
178 }
179 
180 void
182 {
183  DPRINTF(PseudoInst, "PseudoInst::loadsymbol()\n");
184  if (!FullSystem)
185  panicFsOnlyPseudoInst("loadsymbol");
186 
187  const string &filename = tc->getCpuPtr()->system->params()->symbolfile;
188  if (filename.empty()) {
189  return;
190  }
191 
192  std::string buffer;
193  ifstream file(filename.c_str());
194 
195  if (!file)
196  fatal("file error: Can't open symbol table file %s\n", filename);
197 
198  while (!file.eof()) {
199  getline(file, buffer);
200 
201  if (buffer.empty())
202  continue;
203 
204  string::size_type idx = buffer.find(' ');
205  if (idx == string::npos)
206  continue;
207 
208  string address = "0x" + buffer.substr(0, idx);
209  eat_white(address);
210  if (address.empty())
211  continue;
212 
213  // Skip over letter and space
214  string symbol = buffer.substr(idx + 3);
215  eat_white(symbol);
216  if (symbol.empty())
217  continue;
218 
219  Addr addr;
220  if (!to_number(address, addr))
221  continue;
222 
223  if (!tc->getSystemPtr()->kernelSymtab->insert(addr, symbol))
224  continue;
225 
226 
227  DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
228  }
229  file.close();
230 }
231 
232 void
234 {
235  DPRINTF(PseudoInst, "PseudoInst::addsymbol(0x%x, 0x%x)\n",
236  addr, symbolAddr);
237  if (!FullSystem)
238  panicFsOnlyPseudoInst("addSymbol");
239 
240  std::string symbol;
241  tc->getVirtProxy().readString(symbol, symbolAddr);
242 
243  DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
244 
245  tc->getSystemPtr()->kernelSymtab->insert(addr,symbol);
246  debugSymbolTable->insert(addr,symbol);
247 }
248 
249 uint64_t
250 initParam(ThreadContext *tc, uint64_t key_str1, uint64_t key_str2)
251 {
252  DPRINTF(PseudoInst, "PseudoInst::initParam() key:%s%s\n", (char *)&key_str1,
253  (char *)&key_str2);
254  if (!FullSystem) {
255  panicFsOnlyPseudoInst("initParam");
256  return 0;
257  }
258 
259  // The key parameter string is passed in via two 64-bit registers. We copy
260  // out the characters from the 64-bit integer variables here and concatenate
261  // them in the key_str character buffer
262  const int len = 2 * sizeof(uint64_t) + 1;
263  char key_str[len];
264  memset(key_str, '\0', len);
265  if (key_str1 == 0) {
266  assert(key_str2 == 0);
267  } else {
268  strncpy(key_str, (char *)&key_str1, sizeof(uint64_t));
269  }
270 
271  if (strlen(key_str) == sizeof(uint64_t)) {
272  strncpy(key_str + sizeof(uint64_t), (char *)&key_str2,
273  sizeof(uint64_t));
274  } else {
275  assert(key_str2 == 0);
276  }
277 
278  // Compare the key parameter with the known values to select the return
279  // value
280  uint64_t val;
281  if (strcmp(key_str, InitParamKey::DEFAULT) == 0) {
282  val = tc->getCpuPtr()->system->init_param;
283  } else if (strcmp(key_str, InitParamKey::DIST_RANK) == 0) {
284  val = DistIface::rankParam();
285  } else if (strcmp(key_str, InitParamKey::DIST_SIZE) == 0) {
286  val = DistIface::sizeParam();
287  } else {
288  panic("Unknown key for initparam pseudo instruction:\"%s\"", key_str);
289  }
290  return val;
291 }
292 
293 
294 void
295 resetstats(ThreadContext *tc, Tick delay, Tick period)
296 {
297  DPRINTF(PseudoInst, "PseudoInst::resetstats(%i, %i)\n", delay, period);
298  if (!tc->getCpuPtr()->params()->do_statistics_insts)
299  return;
300 
301 
302  Tick when = curTick() + delay * SimClock::Int::ns;
303  Tick repeat = period * SimClock::Int::ns;
304 
305  Stats::schedStatEvent(false, true, when, repeat);
306 }
307 
308 void
309 dumpstats(ThreadContext *tc, Tick delay, Tick period)
310 {
311  DPRINTF(PseudoInst, "PseudoInst::dumpstats(%i, %i)\n", delay, period);
312  if (!tc->getCpuPtr()->params()->do_statistics_insts)
313  return;
314 
315 
316  Tick when = curTick() + delay * SimClock::Int::ns;
317  Tick repeat = period * SimClock::Int::ns;
318 
319  Stats::schedStatEvent(true, false, when, repeat);
320 }
321 
322 void
324 {
325  DPRINTF(PseudoInst, "PseudoInst::dumpresetstats(%i, %i)\n", delay, period);
326  if (!tc->getCpuPtr()->params()->do_statistics_insts)
327  return;
328 
329 
330  Tick when = curTick() + delay * SimClock::Int::ns;
331  Tick repeat = period * SimClock::Int::ns;
332 
333  Stats::schedStatEvent(true, true, when, repeat);
334 }
335 
336 void
337 m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
338 {
339  DPRINTF(PseudoInst, "PseudoInst::m5checkpoint(%i, %i)\n", delay, period);
340  if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
341  return;
342 
343  if (DistIface::readyToCkpt(delay, period)) {
344  Tick when = curTick() + delay * SimClock::Int::ns;
345  Tick repeat = period * SimClock::Int::ns;
346  exitSimLoop("checkpoint", 0, when, repeat);
347  }
348 }
349 
350 uint64_t
351 readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
352 {
353  DPRINTF(PseudoInst, "PseudoInst::readfile(0x%x, 0x%x, 0x%x)\n",
354  vaddr, len, offset);
355  if (!FullSystem) {
356  panicFsOnlyPseudoInst("readfile");
357  return 0;
358  }
359 
360  const string &file = tc->getSystemPtr()->params()->readfile;
361  if (file.empty()) {
362  return ULL(0);
363  }
364 
365  uint64_t result = 0;
366 
367  int fd = ::open(file.c_str(), O_RDONLY, 0);
368  if (fd < 0)
369  panic("could not open file %s\n", file);
370 
371  if (::lseek(fd, offset, SEEK_SET) < 0)
372  panic("could not seek: %s", strerror(errno));
373 
374  char *buf = new char[len];
375  char *p = buf;
376  while (len > 0) {
377  int bytes = ::read(fd, p, len);
378  if (bytes <= 0)
379  break;
380 
381  p += bytes;
382  result += bytes;
383  len -= bytes;
384  }
385 
386  close(fd);
387  tc->getVirtProxy().writeBlob(vaddr, buf, result);
388  delete [] buf;
389  return result;
390 }
391 
392 uint64_t
393 writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset,
394  Addr filename_addr)
395 {
396  DPRINTF(PseudoInst, "PseudoInst::writefile(0x%x, 0x%x, 0x%x, 0x%x)\n",
397  vaddr, len, offset, filename_addr);
398 
399  // copy out target filename
400  std::string filename;
401  tc->getVirtProxy().readString(filename, filename_addr);
402 
403  OutputStream *out;
404  if (offset == 0) {
405  // create a new file (truncate)
406  out = simout.create(filename, true, true);
407  } else {
408  // do not truncate file if offset is non-zero
409  // (ios::in flag is required as well to keep the existing data
410  // intact, otherwise existing data will be zeroed out.)
411  out = simout.open(filename, ios::in | ios::out | ios::binary, true);
412  }
413 
414  ostream *os(out->stream());
415  if (!os)
416  panic("could not open file %s\n", filename);
417 
418  // seek to offset
419  os->seekp(offset);
420 
421  // copy out data and write to file
422  char *buf = new char[len];
423  tc->getVirtProxy().readBlob(vaddr, buf, len);
424  os->write(buf, len);
425  if (os->fail() || os->bad())
426  panic("Error while doing writefile!\n");
427 
428  simout.close(out);
429 
430  delete [] buf;
431 
432  return len;
433 }
434 
435 void
437 {
438  DPRINTF(PseudoInst, "PseudoInst::debugbreak()\n");
440 }
441 
442 void
444 {
445  DPRINTF(PseudoInst, "PseudoInst::switchcpu()\n");
446  exitSimLoop("switchcpu");
447 }
448 
449 /*
450  * This function is executed when the simulation is executing the syscall
451  * handler in System Emulation mode.
452  */
453 void
455 {
456  DPRINTF(PseudoInst, "PseudoInst::m5Syscall()\n");
457  Fault fault;
458  tc->syscall(&fault);
459 }
460 
461 void
463 {
464  DPRINTF(PseudoInst, "PseudoInst::togglesync()\n");
466 }
467 
468 //
469 // This function is executed when annotated work items begin. Depending on
470 // what the user specified at the command line, the simulation may exit and/or
471 // take a checkpoint when a certain work item begins.
472 //
473 void
474 workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
475 {
476  DPRINTF(PseudoInst, "PseudoInst::workbegin(%i, %i)\n", workid, threadid);
477  System *sys = tc->getSystemPtr();
478  const System::Params *params = sys->params();
479 
480  if (params->exit_on_work_items) {
481  exitSimLoop("workbegin", static_cast<int>(workid));
482  return;
483  }
484 
485  DPRINTF(WorkItems, "Work Begin workid: %d, threadid %d\n", workid,
486  threadid);
487  tc->getCpuPtr()->workItemBegin();
488  sys->workItemBegin(threadid, workid);
489 
490  //
491  // If specified, determine if this is the specific work item the user
492  // identified
493  //
494  if (params->work_item_id == -1 || params->work_item_id == workid) {
495 
496  uint64_t systemWorkBeginCount = sys->incWorkItemsBegin();
497  int cpuId = tc->getCpuPtr()->cpuId();
498 
499  if (params->work_cpus_ckpt_count != 0 &&
500  sys->markWorkItem(cpuId) >= params->work_cpus_ckpt_count) {
501  //
502  // If active cpus equals checkpoint count, create checkpoint
503  //
504  exitSimLoop("checkpoint");
505  }
506 
507  if (systemWorkBeginCount == params->work_begin_ckpt_count) {
508  //
509  // Note: the string specified as the cause of the exit event must
510  // exactly equal "checkpoint" inorder to create a checkpoint
511  //
512  exitSimLoop("checkpoint");
513  }
514 
515  if (systemWorkBeginCount == params->work_begin_exit_count) {
516  //
517  // If a certain number of work items started, exit simulation
518  //
519  exitSimLoop("work started count reach");
520  }
521 
522  if (cpuId == params->work_begin_cpu_id_exit) {
523  //
524  // If work started on the cpu id specified, exit simulation
525  //
526  exitSimLoop("work started on specific cpu");
527  }
528  }
529 }
530 
531 //
532 // This function is executed when annotated work items end. Depending on
533 // what the user specified at the command line, the simulation may exit and/or
534 // take a checkpoint when a certain work item ends.
535 //
536 void
537 workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
538 {
539  DPRINTF(PseudoInst, "PseudoInst::workend(%i, %i)\n", workid, threadid);
540  System *sys = tc->getSystemPtr();
541  const System::Params *params = sys->params();
542 
543  if (params->exit_on_work_items) {
544  exitSimLoop("workend", static_cast<int>(workid));
545  return;
546  }
547 
548  DPRINTF(WorkItems, "Work End workid: %d, threadid %d\n", workid, threadid);
549  tc->getCpuPtr()->workItemEnd();
550  sys->workItemEnd(threadid, workid);
551 
552  //
553  // If specified, determine if this is the specific work item the user
554  // identified
555  //
556  if (params->work_item_id == -1 || params->work_item_id == workid) {
557 
558  uint64_t systemWorkEndCount = sys->incWorkItemsEnd();
559  int cpuId = tc->getCpuPtr()->cpuId();
560 
561  if (params->work_cpus_ckpt_count != 0 &&
562  sys->markWorkItem(cpuId) >= params->work_cpus_ckpt_count) {
563  //
564  // If active cpus equals checkpoint count, create checkpoint
565  //
566  exitSimLoop("checkpoint");
567  }
568 
569  if (params->work_end_ckpt_count != 0 &&
570  systemWorkEndCount == params->work_end_ckpt_count) {
571  //
572  // If total work items completed equals checkpoint count, create
573  // checkpoint
574  //
575  exitSimLoop("checkpoint");
576  }
577 
578  if (params->work_end_exit_count != 0 &&
579  systemWorkEndCount == params->work_end_exit_count) {
580  //
581  // If total work items completed equals exit count, exit simulation
582  //
583  exitSimLoop("work items exit count reached");
584  }
585  }
586 }
587 
588 } // namespace PseudoInst
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:167
void m5fail(ThreadContext *tc, Tick delay, uint64_t code)
Definition: pseudo_inst.cc:173
#define DPRINTF(x,...)
Definition: trace.hh:229
OutputDirectory simout
Definition: output.cc:65
virtual System * getSystemPtr()=0
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
void quiesceNs(ThreadContext *tc, uint64_t ns)
Definition: pseudo_inst.cc:116
void breakpoint()
Definition: debug.cc:52
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:175
virtual void syscall(Fault *fault)=0
const std::string & name()
Definition: trace.cc:54
OutputStream * create(const std::string &name, bool binary=false, bool no_gz=false)
Creates a file in this directory (optionally compressed).
Definition: output.cc:206
void arm(ThreadContext *tc)
Definition: pseudo_inst.cc:91
const Params * params() const
Definition: system.hh:585
virtual ::Kernel::Statistics * getKernelStats()=0
SystemParams Params
Definition: system.hh:568
ip6_addr_t addr
Definition: inet.hh:335
void dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:323
uint64_t incWorkItemsEnd()
Called by pseudo_inst to track the number of work items completed by this system. ...
Definition: system.hh:444
virtual PortProxy & getVirtProxy()=0
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:136
uint64_t quiesceTime(ThreadContext *tc)
Definition: pseudo_inst.cc:130
void quiesceSkip(ThreadContext *tc)
Definition: pseudo_inst.cc:109
void workItemEnd()
Definition: base.hh:215
void m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:337
void workItemEnd(uint32_t tid, uint32_t workid)
Definition: system.cc:512
SymbolTable * debugSymbolTable
Global unified debugging symbol table (for target).
Definition: symtab.cc:45
Definition: system.hh:77
uint64_t writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset, Addr filename_addr)
Definition: pseudo_inst.cc:393
Bitfield< 23, 0 > offset
Definition: types.hh:154
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:586
virtual BaseCPU * getCpuPtr()=0
Bitfield< 28, 21 > cpuid
Definition: dt_constants.hh:94
void quiesceCycles(ThreadContext *tc, uint64_t cycles)
Definition: pseudo_inst.cc:123
System * system
Definition: base.hh:386
int cpuId() const
Reads this CPU&#39;s ID.
Definition: base.hh:183
virtual Tick readLastSuspend()=0
static void toggleSync(ThreadContext *tc)
Trigger the master to start/stop synchronization.
Definition: dist_iface.cc:855
ThreadContext is the external interface to all thread state for anything outside of the CPU...
unsigned int size_type
Definition: types.hh:56
Bitfield< 17 > os
Definition: misc.hh:805
void togglesync(ThreadContext *tc)
Definition: pseudo_inst.cc:462
void quiesce()
Quiesce thread context.
Bitfield< 63 > val
Definition: misc.hh:771
std::ostream * stream() const
Get the output underlying output stream.
Definition: output.hh:64
uint64_t initParam(ThreadContext *tc, uint64_t key_str1, uint64_t key_str2)
Definition: pseudo_inst.cc:250
Bitfield< 0 > ns
Tick curTick()
The current simulated tick.
Definition: core.hh:47
void quiesce(ThreadContext *tc)
Definition: pseudo_inst.cc:102
static uint64_t sizeParam()
Getter for the dist size param.
Definition: dist_iface.cc:936
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:189
uint64_t Tick
Tick count type.
Definition: types.hh:63
void switchcpu(ThreadContext *tc)
Definition: pseudo_inst.cc:443
int markWorkItem(int index)
Called by pseudo_inst to mark the cpus actively executing work items.
Definition: system.hh:455
static bool readyToCkpt(Tick delay, Tick period)
Initiate taking a checkpoint.
Definition: dist_iface.cc:824
std::vector< ThreadContext * > threadContexts
Definition: system.hh:190
void close(OutputStream *file)
Closes an output file and free the corresponding OutputFile.
Definition: output.cc:148
Bitfield< 18, 16 > len
unsigned numContexts() const
Definition: system.hh:206
bool insert(Addr address, std::string symbol)
Definition: symtab.cc:55
static bool readyToExit(Tick delay)
Initiate the exit from the simulation.
Definition: dist_iface.cc:898
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
bool to_number(const std::string &value, VecPredRegContainer< NumBits, Packed > &p)
Helper functions used for serialization/de-serialization.
virtual void activate()=0
Set the status to Active.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
#define ULL(N)
uint64_t constant
Definition: types.hh:50
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
SymbolTable * kernelSymtab
kernel symbol table
Definition: system.hh:221
void debugbreak(ThreadContext *tc)
Definition: pseudo_inst.cc:436
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:179
void workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
Definition: pseudo_inst.cc:474
void resetstats(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:295
uint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
Definition: pseudo_inst.cc:351
void readString(std::string &str, Addr addr) const
Same as tryReadString, but insists on success.
Definition: port_proxy.hh:257
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
Definition: sim_events.cc:90
uint64_t incWorkItemsBegin()
Called by pseudo_inst to track the number of work items started by this system.
Definition: system.hh:434
void wakeCPU(ThreadContext *tc, uint64_t cpuid)
Definition: pseudo_inst.cc:146
void workItemBegin(uint32_t tid, uint32_t workid)
Definition: system.hh:467
void eat_white(std::string &s)
Definition: str.hh:67
void dumpstats(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:309
virtual Tick readLastActivate()=0
virtual Status status() const =0
void schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
Schedule statistics dumping.
Tick ns
nanosecond
Definition: core.cc:68
Temporarily inactive.
#define warn(...)
Definition: logging.hh:212
void quiesceTick(Tick resume)
Quiesce, suspend, and schedule activate at resume.
void m5exit(ThreadContext *tc, Tick delay)
Definition: pseudo_inst.cc:163
static void panicFsOnlyPseudoInst(const char *name)
Definition: pseudo_inst.cc:85
Bitfield< 14, 12 > fd
Definition: types.hh:160
static uint64_t rankParam()
Getter for the dist rank param.
Definition: dist_iface.cc:923
Bitfield< 0 > p
uint64_t init_param
Definition: system.hh:214
void workItemBegin()
Definition: base.hh:214
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
OutputStream * open(const std::string &name, std::ios_base::openmode mode, bool recreateable=true, bool no_gz=false)
Open a file in this directory (optionally compressed).
Definition: output.cc:220
const Params * params() const
Definition: base.hh:311
void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
Definition: pseudo_inst.cc:233
void loadsymbol(ThreadContext *tc)
Definition: pseudo_inst.cc:181
void workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
Definition: pseudo_inst.cc:537
void m5Syscall(ThreadContext *tc)
Definition: pseudo_inst.cc:454
uint64_t rpns(ThreadContext *tc)
Definition: pseudo_inst.cc:139

Generated on Fri Feb 28 2020 16:26:57 for gem5 by doxygen 1.8.13