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

Generated on Tue Sep 21 2021 12:25:48 for gem5 by doxygen 1.8.17