gem5  v20.0.0.3
pseudo_inst.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2012, 2015, 2017 ARM Limited
3  * Copyright (c) 2020 Barkhausen Institut
4  * All rights reserved
5  *
6  * The license below extends only to copyright in the software and shall
7  * not be construed as granting a license to any other intellectual
8  * property including but not limited to intellectual property relating
9  * to a hardware implementation of the functionality of the software
10  * licensed hereunder. You may use the software subject to the license
11  * terms below provided that you ensure that this notice is replicated
12  * unmodified and in its entirety in all distributions of the software,
13  * modified or unmodified, in source code or in binary form.
14  *
15  * Copyright (c) 2011 Advanced Micro Devices, Inc.
16  * Copyright (c) 2003-2006 The Regents of The University of Michigan
17  * All rights reserved.
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions are
21  * met: redistributions of source code must retain the above copyright
22  * notice, this list of conditions and the following disclaimer;
23  * redistributions in binary form must reproduce the above copyright
24  * notice, this list of conditions and the following disclaimer in the
25  * documentation and/or other materials provided with the distribution;
26  * neither the name of the copyright holders nor the names of its
27  * contributors may be used to endorse or promote products derived from
28  * this software without specific prior written permission.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41  */
42 
43 #include "sim/pseudo_inst.hh"
44 
45 #include <fcntl.h>
46 #include <unistd.h>
47 
48 #include <array>
49 #include <cerrno>
50 #include <fstream>
51 #include <string>
52 #include <vector>
53 
54 #include "base/debug.hh"
55 #include "base/output.hh"
56 #include "config/the_isa.hh"
57 #include "cpu/base.hh"
58 #include "cpu/quiesce_event.hh"
59 #include "cpu/thread_context.hh"
60 #include "debug/Loader.hh"
61 #include "debug/Quiesce.hh"
62 #include "debug/WorkItems.hh"
63 #include "dev/net/dist_iface.hh"
64 #include "kern/kernel_stats.hh"
65 #include "params/BaseCPU.hh"
66 #include "sim/full_system.hh"
67 #include "sim/process.hh"
68 #include "sim/serialize.hh"
69 #include "sim/sim_events.hh"
70 #include "sim/sim_exit.hh"
71 #include "sim/stat_control.hh"
72 #include "sim/stats.hh"
73 #include "sim/system.hh"
74 #include "sim/vptr.hh"
75 
76 using namespace std;
77 using namespace Stats;
78 
79 namespace PseudoInst
80 {
81 
88 namespace InitParamKey
89 {
90 
94 const std::string DEFAULT = "";
98 const std::string DIST_RANK = "dist-rank";
102 const std::string DIST_SIZE = "dist-size";
103 
104 } // namespace InitParamKey
105 
106 static inline void
108 {
109  panic("Pseudo inst \"%s\" is only available in Full System mode.");
110 }
111 
112 void
114 {
115  DPRINTF(PseudoInst, "PseudoInst::arm()\n");
116  if (!FullSystem)
117  panicFsOnlyPseudoInst("arm");
118 
119  if (tc->getKernelStats())
120  tc->getKernelStats()->arm();
121 }
122 
123 void
125 {
126  DPRINTF(PseudoInst, "PseudoInst::quiesce()\n");
127  tc->quiesce();
128 }
129 
130 void
132 {
133  DPRINTF(PseudoInst, "PseudoInst::quiesceSkip()\n");
134  tc->quiesceTick(tc->getCpuPtr()->nextCycle() + 1);
135 }
136 
137 void
138 quiesceNs(ThreadContext *tc, uint64_t ns)
139 {
140  DPRINTF(PseudoInst, "PseudoInst::quiesceNs(%i)\n", ns);
141  tc->quiesceTick(curTick() + SimClock::Int::ns * ns);
142 }
143 
144 void
145 quiesceCycles(ThreadContext *tc, uint64_t cycles)
146 {
147  DPRINTF(PseudoInst, "PseudoInst::quiesceCycles(%i)\n", cycles);
148  tc->quiesceTick(tc->getCpuPtr()->clockEdge(Cycles(cycles)));
149 }
150 
151 uint64_t
153 {
154  DPRINTF(PseudoInst, "PseudoInst::quiesceTime()\n");
155 
156  return (tc->readLastActivate() - tc->readLastSuspend()) /
158 }
159 
160 uint64_t
162 {
163  DPRINTF(PseudoInst, "PseudoInst::rpns()\n");
164  return curTick() / SimClock::Int::ns;
165 }
166 
167 void
169 {
170  DPRINTF(PseudoInst, "PseudoInst::wakeCPU(%i)\n", cpuid);
171  System *sys = tc->getSystemPtr();
172 
173  if (sys->numContexts() <= cpuid) {
174  warn("PseudoInst::wakeCPU(%i), cpuid greater than number of contexts"
175  "(%i)\n",cpuid, sys->numContexts());
176  return;
177  }
178 
179  ThreadContext *other_tc = sys->threadContexts[cpuid];
180  if (other_tc->status() == ThreadContext::Suspended)
181  other_tc->activate();
182 }
183 
184 void
186 {
187  DPRINTF(PseudoInst, "PseudoInst::m5exit(%i)\n", delay);
188  if (DistIface::readyToExit(delay)) {
189  Tick when = curTick() + delay * SimClock::Int::ns;
190  exitSimLoop("m5_exit instruction encountered", 0, when, 0, true);
191  }
192 }
193 
194 void
195 m5fail(ThreadContext *tc, Tick delay, uint64_t code)
196 {
197  DPRINTF(PseudoInst, "PseudoInst::m5fail(%i, %i)\n", delay, code);
198  Tick when = curTick() + delay * SimClock::Int::ns;
199  exitSimLoop("m5_fail instruction encountered", code, when, 0, true);
200 }
201 
202 void
204 {
205  DPRINTF(PseudoInst, "PseudoInst::loadsymbol()\n");
206  if (!FullSystem)
207  panicFsOnlyPseudoInst("loadsymbol");
208 
209  const string &filename = tc->getCpuPtr()->system->params()->symbolfile;
210  if (filename.empty()) {
211  return;
212  }
213 
214  std::string buffer;
215  ifstream file(filename.c_str());
216 
217  if (!file)
218  fatal("file error: Can't open symbol table file %s\n", filename);
219 
220  while (!file.eof()) {
221  getline(file, buffer);
222 
223  if (buffer.empty())
224  continue;
225 
226  string::size_type idx = buffer.find(' ');
227  if (idx == string::npos)
228  continue;
229 
230  string address = "0x" + buffer.substr(0, idx);
231  eat_white(address);
232  if (address.empty())
233  continue;
234 
235  // Skip over letter and space
236  string symbol = buffer.substr(idx + 3);
237  eat_white(symbol);
238  if (symbol.empty())
239  continue;
240 
241  Addr addr;
242  if (!to_number(address, addr))
243  continue;
244 
245  if (!tc->getSystemPtr()->workload->insertSymbol(addr, symbol))
246  continue;
247 
248 
249  DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
250  }
251  file.close();
252 }
253 
254 void
256 {
257  DPRINTF(PseudoInst, "PseudoInst::addsymbol(0x%x, 0x%x)\n",
258  addr, symbolAddr);
259  if (!FullSystem)
260  panicFsOnlyPseudoInst("addSymbol");
261 
262  std::string symbol;
263  tc->getVirtProxy().readString(symbol, symbolAddr);
264 
265  DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
266 
267  tc->getSystemPtr()->workload->insertSymbol(addr, symbol);
268  Loader::debugSymbolTable->insert(addr, symbol);
269 }
270 
271 uint64_t
272 initParam(ThreadContext *tc, uint64_t key_str1, uint64_t key_str2)
273 {
274  DPRINTF(PseudoInst, "PseudoInst::initParam() key:%s%s\n", (char *)&key_str1,
275  (char *)&key_str2);
276  if (!FullSystem) {
277  panicFsOnlyPseudoInst("initParam");
278  return 0;
279  }
280 
281  // The key parameter string is passed in via two 64-bit registers. We copy
282  // out the characters from the 64-bit integer variables here, and
283  // concatenate them in the key character buffer
284  const int len = 2 * sizeof(uint64_t) + 1;
285  char key[len];
286  memset(key, '\0', len);
287 
288  std::array<uint64_t, 2> key_regs = {{ key_str1, key_str2 }};
289  key_regs = letoh(key_regs);
290  memcpy(key, key_regs.data(), sizeof(key_regs));
291 
292  // Check key parameter to figure out what to return.
293  const std::string key_str(key);
294  if (key == InitParamKey::DEFAULT)
295  return tc->getCpuPtr()->system->init_param;
296  else if (key == InitParamKey::DIST_RANK)
297  return DistIface::rankParam();
298  else if (key == InitParamKey::DIST_SIZE)
299  return DistIface::sizeParam();
300  else
301  panic("Unknown key for initparam pseudo instruction:\"%s\"", key_str);
302 }
303 
304 
305 void
306 resetstats(ThreadContext *tc, Tick delay, Tick period)
307 {
308  DPRINTF(PseudoInst, "PseudoInst::resetstats(%i, %i)\n", delay, period);
309  if (!tc->getCpuPtr()->params()->do_statistics_insts)
310  return;
311 
312 
313  Tick when = curTick() + delay * SimClock::Int::ns;
314  Tick repeat = period * SimClock::Int::ns;
315 
316  Stats::schedStatEvent(false, true, when, repeat);
317 }
318 
319 void
320 dumpstats(ThreadContext *tc, Tick delay, Tick period)
321 {
322  DPRINTF(PseudoInst, "PseudoInst::dumpstats(%i, %i)\n", delay, period);
323  if (!tc->getCpuPtr()->params()->do_statistics_insts)
324  return;
325 
326 
327  Tick when = curTick() + delay * SimClock::Int::ns;
328  Tick repeat = period * SimClock::Int::ns;
329 
330  Stats::schedStatEvent(true, false, when, repeat);
331 }
332 
333 void
335 {
336  DPRINTF(PseudoInst, "PseudoInst::dumpresetstats(%i, %i)\n", delay, period);
337  if (!tc->getCpuPtr()->params()->do_statistics_insts)
338  return;
339 
340 
341  Tick when = curTick() + delay * SimClock::Int::ns;
342  Tick repeat = period * SimClock::Int::ns;
343 
344  Stats::schedStatEvent(true, true, when, repeat);
345 }
346 
347 void
348 m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
349 {
350  DPRINTF(PseudoInst, "PseudoInst::m5checkpoint(%i, %i)\n", delay, period);
351  if (!tc->getCpuPtr()->params()->do_checkpoint_insts)
352  return;
353 
354  if (DistIface::readyToCkpt(delay, period)) {
355  Tick when = curTick() + delay * SimClock::Int::ns;
356  Tick repeat = period * SimClock::Int::ns;
357  exitSimLoop("checkpoint", 0, when, repeat);
358  }
359 }
360 
361 uint64_t
362 readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
363 {
364  DPRINTF(PseudoInst, "PseudoInst::readfile(0x%x, 0x%x, 0x%x)\n",
365  vaddr, len, offset);
366  if (!FullSystem) {
367  panicFsOnlyPseudoInst("readfile");
368  return 0;
369  }
370 
371  const string &file = tc->getSystemPtr()->params()->readfile;
372  if (file.empty()) {
373  return ULL(0);
374  }
375 
376  uint64_t result = 0;
377 
378  int fd = ::open(file.c_str(), O_RDONLY, 0);
379  if (fd < 0)
380  panic("could not open file %s\n", file);
381 
382  if (::lseek(fd, offset, SEEK_SET) < 0)
383  panic("could not seek: %s", strerror(errno));
384 
385  char *buf = new char[len];
386  char *p = buf;
387  while (len > 0) {
388  int bytes = ::read(fd, p, len);
389  if (bytes <= 0)
390  break;
391 
392  p += bytes;
393  result += bytes;
394  len -= bytes;
395  }
396 
397  close(fd);
398  tc->getVirtProxy().writeBlob(vaddr, buf, result);
399  delete [] buf;
400  return result;
401 }
402 
403 uint64_t
404 writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset,
405  Addr filename_addr)
406 {
407  DPRINTF(PseudoInst, "PseudoInst::writefile(0x%x, 0x%x, 0x%x, 0x%x)\n",
408  vaddr, len, offset, filename_addr);
409 
410  // copy out target filename
411  std::string filename;
412  tc->getVirtProxy().readString(filename, filename_addr);
413 
414  OutputStream *out;
415  if (offset == 0) {
416  // create a new file (truncate)
417  out = simout.create(filename, true, true);
418  } else {
419  // do not truncate file if offset is non-zero
420  // (ios::in flag is required as well to keep the existing data
421  // intact, otherwise existing data will be zeroed out.)
422  out = simout.open(filename, ios::in | ios::out | ios::binary, true);
423  }
424 
425  ostream *os(out->stream());
426  if (!os)
427  panic("could not open file %s\n", filename);
428 
429  if (offset != 0) {
430  // seek to offset
431  os->seekp(offset);
432  }
433 
434  // copy out data and write to file
435  char *buf = new char[len];
436  tc->getVirtProxy().readBlob(vaddr, buf, len);
437  os->write(buf, len);
438  if (os->fail() || os->bad())
439  panic("Error while doing writefile!\n");
440 
441  simout.close(out);
442 
443  delete [] buf;
444 
445  return len;
446 }
447 
448 void
450 {
451  DPRINTF(PseudoInst, "PseudoInst::debugbreak()\n");
453 }
454 
455 void
457 {
458  DPRINTF(PseudoInst, "PseudoInst::switchcpu()\n");
459  exitSimLoop("switchcpu");
460 }
461 
462 /*
463  * This function is executed when the simulation is executing the syscall
464  * handler in System Emulation mode.
465  */
466 void
468 {
469  DPRINTF(PseudoInst, "PseudoInst::m5Syscall()\n");
470  Fault fault;
471  tc->syscall(&fault);
472 }
473 
474 void
476 {
477  DPRINTF(PseudoInst, "PseudoInst::togglesync()\n");
479 }
480 
481 //
482 // This function is executed when annotated work items begin. Depending on
483 // what the user specified at the command line, the simulation may exit and/or
484 // take a checkpoint when a certain work item begins.
485 //
486 void
487 workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
488 {
489  DPRINTF(PseudoInst, "PseudoInst::workbegin(%i, %i)\n", workid, threadid);
490  System *sys = tc->getSystemPtr();
491  const System::Params *params = sys->params();
492 
493  if (params->exit_on_work_items) {
494  exitSimLoop("workbegin", static_cast<int>(workid));
495  return;
496  }
497 
498  DPRINTF(WorkItems, "Work Begin workid: %d, threadid %d\n", workid,
499  threadid);
500  tc->getCpuPtr()->workItemBegin();
501  sys->workItemBegin(threadid, workid);
502 
503  //
504  // If specified, determine if this is the specific work item the user
505  // identified
506  //
507  if (params->work_item_id == -1 || params->work_item_id == workid) {
508 
509  uint64_t systemWorkBeginCount = sys->incWorkItemsBegin();
510  int cpuId = tc->getCpuPtr()->cpuId();
511 
512  if (params->work_cpus_ckpt_count != 0 &&
513  sys->markWorkItem(cpuId) >= params->work_cpus_ckpt_count) {
514  //
515  // If active cpus equals checkpoint count, create checkpoint
516  //
517  exitSimLoop("checkpoint");
518  }
519 
520  if (systemWorkBeginCount == params->work_begin_ckpt_count) {
521  //
522  // Note: the string specified as the cause of the exit event must
523  // exactly equal "checkpoint" inorder to create a checkpoint
524  //
525  exitSimLoop("checkpoint");
526  }
527 
528  if (systemWorkBeginCount == params->work_begin_exit_count) {
529  //
530  // If a certain number of work items started, exit simulation
531  //
532  exitSimLoop("work started count reach");
533  }
534 
535  if (cpuId == params->work_begin_cpu_id_exit) {
536  //
537  // If work started on the cpu id specified, exit simulation
538  //
539  exitSimLoop("work started on specific cpu");
540  }
541  }
542 }
543 
544 //
545 // This function is executed when annotated work items end. Depending on
546 // what the user specified at the command line, the simulation may exit and/or
547 // take a checkpoint when a certain work item ends.
548 //
549 void
550 workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
551 {
552  DPRINTF(PseudoInst, "PseudoInst::workend(%i, %i)\n", workid, threadid);
553  System *sys = tc->getSystemPtr();
554  const System::Params *params = sys->params();
555 
556  if (params->exit_on_work_items) {
557  exitSimLoop("workend", static_cast<int>(workid));
558  return;
559  }
560 
561  DPRINTF(WorkItems, "Work End workid: %d, threadid %d\n", workid, threadid);
562  tc->getCpuPtr()->workItemEnd();
563  sys->workItemEnd(threadid, workid);
564 
565  //
566  // If specified, determine if this is the specific work item the user
567  // identified
568  //
569  if (params->work_item_id == -1 || params->work_item_id == workid) {
570 
571  uint64_t systemWorkEndCount = sys->incWorkItemsEnd();
572  int cpuId = tc->getCpuPtr()->cpuId();
573 
574  if (params->work_cpus_ckpt_count != 0 &&
575  sys->markWorkItem(cpuId) >= params->work_cpus_ckpt_count) {
576  //
577  // If active cpus equals checkpoint count, create checkpoint
578  //
579  exitSimLoop("checkpoint");
580  }
581 
582  if (params->work_end_ckpt_count != 0 &&
583  systemWorkEndCount == params->work_end_ckpt_count) {
584  //
585  // If total work items completed equals checkpoint count, create
586  // checkpoint
587  //
588  exitSimLoop("checkpoint");
589  }
590 
591  if (params->work_end_exit_count != 0 &&
592  systemWorkEndCount == params->work_end_exit_count) {
593  //
594  // If total work items completed equals exit count, exit simulation
595  //
596  exitSimLoop("work items exit count reached");
597  }
598  }
599 }
600 
601 } // namespace PseudoInst
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:163
void m5fail(ThreadContext *tc, Tick delay, uint64_t code)
Definition: pseudo_inst.cc:195
#define DPRINTF(x,...)
Definition: trace.hh:225
OutputDirectory simout
Definition: output.cc:61
virtual System * getSystemPtr()=0
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:81
void quiesceNs(ThreadContext *tc, uint64_t ns)
Definition: pseudo_inst.cc:138
void breakpoint()
Definition: debug.cc:50
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:171
virtual void syscall(Fault *fault)=0
const std::string & name()
Definition: trace.cc:50
OutputStream * create(const std::string &name, bool binary=false, bool no_gz=false)
Creates a file in this directory (optionally compressed).
Definition: output.cc:207
void arm(ThreadContext *tc)
Definition: pseudo_inst.cc:113
const Params * params() const
Definition: system.hh:456
virtual ::Kernel::Statistics * getKernelStats()=0
SystemParams Params
Definition: system.hh:441
ip6_addr_t addr
Definition: inet.hh:330
void dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:334
uint64_t incWorkItemsEnd()
Called by pseudo_inst to track the number of work items completed by this system. ...
Definition: system.hh:405
virtual PortProxy & getVirtProxy()=0
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:132
uint64_t quiesceTime(ThreadContext *tc)
Definition: pseudo_inst.cc:152
void quiesceSkip(ThreadContext *tc)
Definition: pseudo_inst.cc:131
void workItemEnd()
Definition: base.hh:211
void m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:348
void workItemEnd(uint32_t tid, uint32_t workid)
Definition: system.cc:401
Definition: system.hh:72
uint64_t writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset, Addr filename_addr)
Definition: pseudo_inst.cc:404
Bitfield< 23, 0 > offset
Definition: types.hh:152
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
virtual BaseCPU * getCpuPtr()=0
Bitfield< 28, 21 > cpuid
Definition: dt_constants.hh:92
void quiesceCycles(ThreadContext *tc, uint64_t cycles)
Definition: pseudo_inst.cc:145
System * system
Definition: base.hh:382
T letoh(T value)
Definition: byteswap.hh:141
int cpuId() const
Reads this CPU&#39;s ID.
Definition: base.hh:179
virtual Tick readLastSuspend()=0
static void toggleSync(ThreadContext *tc)
Trigger the master to start/stop synchronization.
Definition: dist_iface.cc:853
ThreadContext is the external interface to all thread state for anything outside of the CPU...
unsigned int size_type
Definition: types.hh:54
Bitfield< 17 > os
Definition: misc.hh:803
void togglesync(ThreadContext *tc)
Definition: pseudo_inst.cc:475
void quiesce()
Quiesce thread context.
std::ostream * stream() const
Get the output underlying output stream.
Definition: output.hh:59
const std::string DIST_RANK
Unique key for "rank" param (distributed gem5 runs)
Definition: pseudo_inst.cc:98
bool insert(Addr address, std::string symbol)
Definition: symtab.cc:56
uint64_t initParam(ThreadContext *tc, uint64_t key_str1, uint64_t key_str2)
Definition: pseudo_inst.cc:272
Bitfield< 0 > ns
Tick curTick()
The current simulated tick.
Definition: core.hh:44
void quiesce(ThreadContext *tc)
Definition: pseudo_inst.cc:124
static uint64_t sizeParam()
Getter for the dist size param.
Definition: dist_iface.cc:934
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:187
uint64_t Tick
Tick count type.
Definition: types.hh:61
void switchcpu(ThreadContext *tc)
Definition: pseudo_inst.cc:456
int markWorkItem(int index)
Called by pseudo_inst to mark the cpus actively executing work items.
Definition: system.hh:416
static bool readyToCkpt(Tick delay, Tick period)
Initiate taking a checkpoint.
Definition: dist_iface.cc:822
std::vector< ThreadContext * > threadContexts
Definition: system.hh:182
void close(OutputStream *file)
Closes an output file and free the corresponding OutputFile.
Definition: output.cc:144
Bitfield< 18, 16 > len
unsigned numContexts() const
Definition: system.hh:198
virtual bool insertSymbol(Addr address, const std::string &symbol)=0
const std::string DIST_SIZE
Unique key for "size" param (distributed gem5 runs)
Definition: pseudo_inst.cc:102
static bool readyToExit(Tick delay)
Initiate the exit from the simulation.
Definition: dist_iface.cc:896
const std::string DEFAULT
The default key (empty string)
Definition: pseudo_inst.cc:94
Workload * workload
OS kernel.
Definition: system.hh:213
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:140
#define ULL(N)
uint64_t constant
Definition: types.hh:48
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...
void debugbreak(ThreadContext *tc)
Definition: pseudo_inst.cc:449
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:177
void workbegin(ThreadContext *tc, uint64_t workid, uint64_t threadid)
Definition: pseudo_inst.cc:487
void resetstats(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:306
uint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
Definition: pseudo_inst.cc:362
void readString(std::string &str, Addr addr) const
Same as tryReadString, but insists on success.
Definition: port_proxy.hh:255
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:88
uint64_t incWorkItemsBegin()
Called by pseudo_inst to track the number of work items started by this system.
Definition: system.hh:395
void wakeCPU(ThreadContext *tc, uint64_t cpuid)
Definition: pseudo_inst.cc:168
void workItemBegin(uint32_t tid, uint32_t workid)
Definition: system.hh:428
void eat_white(std::string &s)
Definition: str.hh:64
void dumpstats(ThreadContext *tc, Tick delay, Tick period)
Definition: pseudo_inst.cc:320
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:65
SymbolTable * debugSymbolTable
Global unified debugging symbol table (for target).
Definition: symtab.cc:46
Temporarily inactive.
#define warn(...)
Definition: logging.hh:208
void quiesceTick(Tick resume)
Quiesce, suspend, and schedule activate at resume.
void m5exit(ThreadContext *tc, Tick delay)
Definition: pseudo_inst.cc:185
static void panicFsOnlyPseudoInst(const char *name)
Definition: pseudo_inst.cc:107
Bitfield< 14, 12 > fd
Definition: types.hh:158
static uint64_t rankParam()
Getter for the dist rank param.
Definition: dist_iface.cc:921
Bitfield< 0 > p
uint64_t init_param
Definition: system.hh:206
void workItemBegin()
Definition: base.hh:210
std::shared_ptr< FaultBase > Fault
Definition: types.hh:238
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:221
const Params * params() const
Definition: base.hh:307
void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
Definition: pseudo_inst.cc:255
void loadsymbol(ThreadContext *tc)
Definition: pseudo_inst.cc:203
void workend(ThreadContext *tc, uint64_t workid, uint64_t threadid)
Definition: pseudo_inst.cc:550
void m5Syscall(ThreadContext *tc)
Definition: pseudo_inst.cc:467
uint64_t rpns(ThreadContext *tc)
Definition: pseudo_inst.cc:161

Generated on Fri Jul 3 2020 15:52:58 for gem5 by doxygen 1.8.13