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

Generated on Tue Mar 23 2021 19:41:28 for gem5 by doxygen 1.8.17