gem5  v21.1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cpu.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2012, 2014, 2016, 2017, 2019-2020 ARM Limited
3  * Copyright (c) 2013 Advanced Micro Devices, Inc.
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) 2004-2006 The Regents of The University of Michigan
16  * Copyright (c) 2011 Regents of the University of California
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 "cpu/o3/cpu.hh"
44 
45 #include "config/the_isa.hh"
46 #include "cpu/activity.hh"
47 #include "cpu/checker/cpu.hh"
49 #include "cpu/o3/limits.hh"
50 #include "cpu/o3/thread_context.hh"
51 #include "cpu/simple_thread.hh"
52 #include "cpu/thread_context.hh"
53 #include "debug/Activity.hh"
54 #include "debug/Drain.hh"
55 #include "debug/O3CPU.hh"
56 #include "debug/Quiesce.hh"
57 #include "enums/MemoryMode.hh"
58 #include "sim/cur_tick.hh"
59 #include "sim/full_system.hh"
60 #include "sim/process.hh"
61 #include "sim/stat_control.hh"
62 #include "sim/system.hh"
63 
64 namespace gem5
65 {
66 
67 struct BaseCPUParams;
68 
69 namespace o3
70 {
71 
72 CPU::CPU(const O3CPUParams &params)
73  : BaseCPU(params),
74  mmu(params.mmu),
75  tickEvent([this]{ tick(); }, "O3CPU tick",
76  false, Event::CPU_Tick_Pri),
77  threadExitEvent([this]{ exitThreads(); }, "O3CPU exit threads",
78  false, Event::CPU_Exit_Pri),
79 #ifndef NDEBUG
80  instcount(0),
81 #endif
82  removeInstsThisCycle(false),
83  fetch(this, params),
84  decode(this, params),
85  rename(this, params),
86  iew(this, params),
87  commit(this, params),
88 
89  /* It is mandatory that all SMT threads use the same renaming mode as
90  * they are sharing registers and rename */
91  vecMode(params.isa[0]->initVecRegRenameMode()),
92  regFile(params.numPhysIntRegs,
93  params.numPhysFloatRegs,
94  params.numPhysVecRegs,
95  params.numPhysVecPredRegs,
96  params.numPhysCCRegs,
97  params.isa[0]->regClasses(),
98  vecMode),
99 
100  freeList(name() + ".freelist", &regFile),
101 
102  rob(this, params),
103 
104  scoreboard(name() + ".scoreboard", regFile.totalNumPhysRegs(),
105  params.isa[0]->regClasses().at(IntRegClass).zeroReg()),
106 
107  isa(numThreads, NULL),
108 
109  timeBuffer(params.backComSize, params.forwardComSize),
110  fetchQueue(params.backComSize, params.forwardComSize),
111  decodeQueue(params.backComSize, params.forwardComSize),
112  renameQueue(params.backComSize, params.forwardComSize),
113  iewQueue(params.backComSize, params.forwardComSize),
114  activityRec(name(), NumStages,
115  params.backComSize + params.forwardComSize,
116  params.activity),
117 
118  globalSeqNum(1),
119  system(params.system),
120  lastRunningCycle(curCycle()),
121  cpuStats(this)
122 {
123  fatal_if(FullSystem && params.numThreads > 1,
124  "SMT is not supported in O3 in full system mode currently.");
125 
126  fatal_if(!FullSystem && params.numThreads < params.workload.size(),
127  "More workload items (%d) than threads (%d) on CPU %s.",
128  params.workload.size(), params.numThreads, name());
129 
130  if (!params.switched_out) {
131  _status = Running;
132  } else {
133  _status = SwitchedOut;
134  }
135 
136  if (params.checker) {
137  BaseCPU *temp_checker = params.checker;
138  checker = dynamic_cast<Checker<DynInstPtr> *>(temp_checker);
139  checker->setIcachePort(&fetch.getInstPort());
140  checker->setSystem(params.system);
141  } else {
142  checker = NULL;
143  }
144 
145  if (!FullSystem) {
146  thread.resize(numThreads);
147  tids.resize(numThreads);
148  }
149 
150  // The stages also need their CPU pointer setup. However this
151  // must be done at the upper level CPU because they have pointers
152  // to the upper level CPU, and not this CPU.
153 
154  // Set up Pointers to the activeThreads list for each stage
155  fetch.setActiveThreads(&activeThreads);
156  decode.setActiveThreads(&activeThreads);
157  rename.setActiveThreads(&activeThreads);
158  iew.setActiveThreads(&activeThreads);
159  commit.setActiveThreads(&activeThreads);
160 
161  // Give each of the stages the time buffer they will use.
162  fetch.setTimeBuffer(&timeBuffer);
163  decode.setTimeBuffer(&timeBuffer);
164  rename.setTimeBuffer(&timeBuffer);
165  iew.setTimeBuffer(&timeBuffer);
166  commit.setTimeBuffer(&timeBuffer);
167 
168  // Also setup each of the stages' queues.
169  fetch.setFetchQueue(&fetchQueue);
170  decode.setFetchQueue(&fetchQueue);
171  commit.setFetchQueue(&fetchQueue);
172  decode.setDecodeQueue(&decodeQueue);
173  rename.setDecodeQueue(&decodeQueue);
174  rename.setRenameQueue(&renameQueue);
175  iew.setRenameQueue(&renameQueue);
176  iew.setIEWQueue(&iewQueue);
177  commit.setIEWQueue(&iewQueue);
178  commit.setRenameQueue(&renameQueue);
179 
180  commit.setIEWStage(&iew);
181  rename.setIEWStage(&iew);
182  rename.setCommitStage(&commit);
183 
184  ThreadID active_threads;
185  if (FullSystem) {
186  active_threads = 1;
187  } else {
188  active_threads = params.workload.size();
189 
190  if (active_threads > MaxThreads) {
191  panic("Workload Size too large. Increase the 'MaxThreads' "
192  "constant in cpu/o3/limits.hh or edit your workload size.");
193  }
194  }
195 
196  // Make Sure That this a Valid Architeture
197  assert(numThreads);
198  const auto &regClasses = params.isa[0]->regClasses();
199 
200  assert(params.numPhysIntRegs >=
201  numThreads * regClasses.at(IntRegClass).size());
202  assert(params.numPhysFloatRegs >=
203  numThreads * regClasses.at(FloatRegClass).size());
204  assert(params.numPhysVecRegs >=
205  numThreads * regClasses.at(VecRegClass).size());
206  assert(params.numPhysVecPredRegs >=
207  numThreads * regClasses.at(VecPredRegClass).size());
208  assert(params.numPhysCCRegs >=
209  numThreads * regClasses.at(CCRegClass).size());
210 
211  // Just make this a warning and go ahead anyway, to keep from having to
212  // add checks everywhere.
213  warn_if(regClasses.at(CCRegClass).size() == 0 && params.numPhysCCRegs != 0,
214  "Non-zero number of physical CC regs specified, even though\n"
215  " ISA does not use them.");
216 
217  rename.setScoreboard(&scoreboard);
218  iew.setScoreboard(&scoreboard);
219 
220  // Setup the rename map for whichever stages need it.
221  for (ThreadID tid = 0; tid < numThreads; tid++) {
222  isa[tid] = dynamic_cast<TheISA::ISA *>(params.isa[tid]);
223  assert(isa[tid]);
224  assert(isa[tid]->initVecRegRenameMode() ==
225  isa[0]->initVecRegRenameMode());
226 
227  commitRenameMap[tid].init(regClasses, &regFile, &freeList, vecMode);
228  renameMap[tid].init(regClasses, &regFile, &freeList, vecMode);
229  }
230 
231  // Initialize rename map to assign physical registers to the
232  // architectural registers for active threads only.
233  for (ThreadID tid = 0; tid < active_threads; tid++) {
234  for (RegIndex ridx = 0; ridx < regClasses.at(IntRegClass).size();
235  ++ridx) {
236  // Note that we can't use the rename() method because we don't
237  // want special treatment for the zero register at this point
238  PhysRegIdPtr phys_reg = freeList.getIntReg();
239  renameMap[tid].setEntry(RegId(IntRegClass, ridx), phys_reg);
240  commitRenameMap[tid].setEntry(RegId(IntRegClass, ridx), phys_reg);
241  }
242 
243  for (RegIndex ridx = 0; ridx < regClasses.at(FloatRegClass).size();
244  ++ridx) {
245  PhysRegIdPtr phys_reg = freeList.getFloatReg();
246  renameMap[tid].setEntry(RegId(FloatRegClass, ridx), phys_reg);
247  commitRenameMap[tid].setEntry(
248  RegId(FloatRegClass, ridx), phys_reg);
249  }
250 
251  /* Here we need two 'interfaces' the 'whole register' and the
252  * 'register element'. At any point only one of them will be
253  * active. */
254  const size_t numVecs = regClasses.at(VecRegClass).size();
255  if (vecMode == enums::Full) {
256  /* Initialize the full-vector interface */
257  for (RegIndex ridx = 0; ridx < numVecs; ++ridx) {
258  RegId rid = RegId(VecRegClass, ridx);
259  PhysRegIdPtr phys_reg = freeList.getVecReg();
260  renameMap[tid].setEntry(rid, phys_reg);
261  commitRenameMap[tid].setEntry(rid, phys_reg);
262  }
263  } else {
264  /* Initialize the vector-element interface */
265  const size_t numElems = regClasses.at(VecElemClass).size();
266  const size_t elemsPerVec = numElems / numVecs;
267  for (RegIndex ridx = 0; ridx < numVecs; ++ridx) {
268  for (ElemIndex ldx = 0; ldx < elemsPerVec; ++ldx) {
269  RegId lrid = RegId(VecElemClass, ridx, ldx);
270  PhysRegIdPtr phys_elem = freeList.getVecElem();
271  renameMap[tid].setEntry(lrid, phys_elem);
272  commitRenameMap[tid].setEntry(lrid, phys_elem);
273  }
274  }
275  }
276 
277  for (RegIndex ridx = 0; ridx < regClasses.at(VecPredRegClass).size();
278  ++ridx) {
279  PhysRegIdPtr phys_reg = freeList.getVecPredReg();
280  renameMap[tid].setEntry(RegId(VecPredRegClass, ridx), phys_reg);
281  commitRenameMap[tid].setEntry(
282  RegId(VecPredRegClass, ridx), phys_reg);
283  }
284 
285  for (RegIndex ridx = 0; ridx < regClasses.at(CCRegClass).size();
286  ++ridx) {
287  PhysRegIdPtr phys_reg = freeList.getCCReg();
288  renameMap[tid].setEntry(RegId(CCRegClass, ridx), phys_reg);
289  commitRenameMap[tid].setEntry(RegId(CCRegClass, ridx), phys_reg);
290  }
291  }
292 
293  rename.setRenameMap(renameMap);
294  commit.setRenameMap(commitRenameMap);
295  rename.setFreeList(&freeList);
296 
297  // Setup the ROB for whichever stages need it.
298  commit.setROB(&rob);
299 
300  lastActivatedCycle = 0;
301 
302  DPRINTF(O3CPU, "Creating O3CPU object.\n");
303 
304  // Setup any thread state.
305  thread.resize(numThreads);
306 
307  for (ThreadID tid = 0; tid < numThreads; ++tid) {
308  if (FullSystem) {
309  // SMT is not supported in FS mode yet.
310  assert(numThreads == 1);
311  thread[tid] = new ThreadState(this, 0, NULL);
312  } else {
313  if (tid < params.workload.size()) {
314  DPRINTF(O3CPU, "Workload[%i] process is %#x", tid,
315  thread[tid]);
316  thread[tid] = new ThreadState(this, tid, params.workload[tid]);
317  } else {
318  //Allocate Empty thread so M5 can use later
319  //when scheduling threads to CPU
320  Process* dummy_proc = NULL;
321 
322  thread[tid] = new ThreadState(this, tid, dummy_proc);
323  }
324  }
325 
327 
328  // Setup the TC that will serve as the interface to the threads/CPU.
329  auto *o3_tc = new ThreadContext;
330 
331  tc = o3_tc;
332 
333  // If we're using a checker, then the TC should be the
334  // CheckerThreadContext.
335  if (params.checker) {
336  tc = new CheckerThreadContext<ThreadContext>(o3_tc, checker);
337  }
338 
339  o3_tc->cpu = this;
340  o3_tc->thread = thread[tid];
341 
342  // Give the thread the TC.
343  thread[tid]->tc = tc;
344 
345  // Add the TC to the CPU's list of TC's.
346  threadContexts.push_back(tc);
347  }
348 
349  // O3CPU always requires an interrupt controller.
350  if (!params.switched_out && interrupts.empty()) {
351  fatal("O3CPU %s has no interrupt controller.\n"
352  "Ensure createInterruptController() is called.\n", name());
353  }
354 }
355 
356 void
358 {
360 
362  getProbeManager(), "InstAccessComplete");
365  getProbeManager(), "DataAccessComplete");
366 
371 }
372 
374  : statistics::Group(cpu),
375  ADD_STAT(timesIdled, statistics::units::Count::get(),
376  "Number of times that the entire CPU went into an idle state "
377  "and unscheduled itself"),
378  ADD_STAT(idleCycles, statistics::units::Cycle::get(),
379  "Total number of cycles that the CPU has spent unscheduled due "
380  "to idling"),
381  ADD_STAT(quiesceCycles, statistics::units::Cycle::get(),
382  "Total number of cycles that CPU has spent quiesced or waiting "
383  "for an interrupt"),
384  ADD_STAT(committedInsts, statistics::units::Count::get(),
385  "Number of Instructions Simulated"),
386  ADD_STAT(committedOps, statistics::units::Count::get(),
387  "Number of Ops (including micro ops) Simulated"),
388  ADD_STAT(cpi, statistics::units::Rate<
389  statistics::units::Cycle, statistics::units::Count>::get(),
390  "CPI: Cycles Per Instruction"),
391  ADD_STAT(totalCpi, statistics::units::Rate<
392  statistics::units::Cycle, statistics::units::Count>::get(),
393  "CPI: Total CPI of All Threads"),
394  ADD_STAT(ipc, statistics::units::Rate<
395  statistics::units::Count, statistics::units::Cycle>::get(),
396  "IPC: Instructions Per Cycle"),
397  ADD_STAT(totalIpc, statistics::units::Rate<
398  statistics::units::Count, statistics::units::Cycle>::get(),
399  "IPC: Total IPC of All Threads"),
400  ADD_STAT(intRegfileReads, statistics::units::Count::get(),
401  "Number of integer regfile reads"),
402  ADD_STAT(intRegfileWrites, statistics::units::Count::get(),
403  "Number of integer regfile writes"),
404  ADD_STAT(fpRegfileReads, statistics::units::Count::get(),
405  "Number of floating regfile reads"),
406  ADD_STAT(fpRegfileWrites, statistics::units::Count::get(),
407  "Number of floating regfile writes"),
408  ADD_STAT(vecRegfileReads, statistics::units::Count::get(),
409  "number of vector regfile reads"),
410  ADD_STAT(vecRegfileWrites, statistics::units::Count::get(),
411  "number of vector regfile writes"),
412  ADD_STAT(vecPredRegfileReads, statistics::units::Count::get(),
413  "number of predicate regfile reads"),
414  ADD_STAT(vecPredRegfileWrites, statistics::units::Count::get(),
415  "number of predicate regfile writes"),
416  ADD_STAT(ccRegfileReads, statistics::units::Count::get(),
417  "number of cc regfile reads"),
418  ADD_STAT(ccRegfileWrites, statistics::units::Count::get(),
419  "number of cc regfile writes"),
420  ADD_STAT(miscRegfileReads, statistics::units::Count::get(),
421  "number of misc regfile reads"),
422  ADD_STAT(miscRegfileWrites, statistics::units::Count::get(),
423  "number of misc regfile writes")
424 {
425  // Register any of the O3CPU's stats here.
426  timesIdled
427  .prereq(timesIdled);
428 
429  idleCycles
430  .prereq(idleCycles);
431 
434 
435  // Number of Instructions simulated
436  // --------------------------------
437  // Should probably be in Base CPU but need templated
438  // MaxThreads so put in here instead
440  .init(cpu->numThreads)
442 
444  .init(cpu->numThreads)
446 
447  cpi
448  .precision(6);
450 
451  totalCpi
452  .precision(6);
454 
455  ipc
456  .precision(6);
458 
459  totalIpc
460  .precision(6);
462 
465 
468 
471 
474 
477 
480 
483 
486 
489 
492 
495 
498 }
499 
500 void
502 {
503  DPRINTF(O3CPU, "\n\nO3CPU: Ticking main, O3CPU.\n");
504  assert(!switchedOut());
505  assert(drainState() != DrainState::Drained);
506 
509 
510 // activity = false;
511 
512  //Tick each of the stages
513  fetch.tick();
514 
515  decode.tick();
516 
517  rename.tick();
518 
519  iew.tick();
520 
521  commit.tick();
522 
523  // Now advance the time buffers
524  timeBuffer.advance();
525 
526  fetchQueue.advance();
527  decodeQueue.advance();
528  renameQueue.advance();
529  iewQueue.advance();
530 
532 
533  if (removeInstsThisCycle) {
535  }
536 
537  if (!tickEvent.scheduled()) {
538  if (_status == SwitchedOut) {
539  DPRINTF(O3CPU, "Switched out!\n");
540  // increment stat
542  } else if (!activityRec.active() || _status == Idle) {
543  DPRINTF(O3CPU, "Idle!\n");
546  } else {
548  DPRINTF(O3CPU, "Scheduling next tick!\n");
549  }
550  }
551 
552  if (!FullSystem)
554 
555  tryDrain();
556 }
557 
558 void
560 {
561  BaseCPU::init();
562 
563  for (ThreadID tid = 0; tid < numThreads; ++tid) {
564  // Set noSquashFromTC so that the CPU doesn't squash when initially
565  // setting up registers.
566  thread[tid]->noSquashFromTC = true;
567  // Initialise the ThreadContext's memory proxies
568  thread[tid]->initMemProxies(thread[tid]->getTC());
569  }
570 
571  // Clear noSquashFromTC.
572  for (int tid = 0; tid < numThreads; ++tid)
573  thread[tid]->noSquashFromTC = false;
574 
576 }
577 
578 void
580 {
582 
585  iew.startupStage();
588 }
589 
590 void
592 {
594  std::find(activeThreads.begin(), activeThreads.end(), tid);
595 
596  DPRINTF(O3CPU, "[tid:%i] Calling activate thread.\n", tid);
597  assert(!switchedOut());
598 
599  if (isActive == activeThreads.end()) {
600  DPRINTF(O3CPU, "[tid:%i] Adding to active threads list\n", tid);
601 
602  activeThreads.push_back(tid);
603  }
604 }
605 
606 void
608 {
609  // hardware transactional memory
610  // shouldn't deactivate thread in the middle of a transaction
611  assert(!commit.executingHtmTransaction(tid));
612 
613  //Remove From Active List, if Active
615  std::find(activeThreads.begin(), activeThreads.end(), tid);
616 
617  DPRINTF(O3CPU, "[tid:%i] Calling deactivate thread.\n", tid);
618  assert(!switchedOut());
619 
620  if (thread_it != activeThreads.end()) {
621  DPRINTF(O3CPU,"[tid:%i] Removing from active threads list\n",
622  tid);
623  activeThreads.erase(thread_it);
624  }
625 
626  fetch.deactivateThread(tid);
628 }
629 
630 Counter
632 {
633  Counter total(0);
634 
635  ThreadID size = thread.size();
636  for (ThreadID i = 0; i < size; i++)
637  total += thread[i]->numInst;
638 
639  return total;
640 }
641 
642 Counter
644 {
645  Counter total(0);
646 
647  ThreadID size = thread.size();
648  for (ThreadID i = 0; i < size; i++)
649  total += thread[i]->numOp;
650 
651  return total;
652 }
653 
654 void
656 {
657  assert(!switchedOut());
658 
659  // Needs to set each stage to running as well.
660  activateThread(tid);
661 
662  // We don't want to wake the CPU if it is drained. In that case,
663  // we just want to flag the thread as active and schedule the tick
664  // event from drainResume() instead.
666  return;
667 
668  // If we are time 0 or if the last activation time is in the past,
669  // schedule the next tick and wake up the fetch unit
672 
673  // Be sure to signal that there's some activity so the CPU doesn't
674  // deschedule itself.
677 
678  Cycles cycles(curCycle() - lastRunningCycle);
679  // @todo: This is an oddity that is only here to match the stats
680  if (cycles != 0)
681  --cycles;
682  cpuStats.quiesceCycles += cycles;
683 
685 
686  _status = Running;
687 
689  }
690 }
691 
692 void
694 {
695  DPRINTF(O3CPU,"[tid:%i] Suspending Thread Context.\n", tid);
696  assert(!switchedOut());
697 
698  deactivateThread(tid);
699 
700  // If this was the last thread then unschedule the tick event.
701  if (activeThreads.size() == 0) {
704  _status = Idle;
705  }
706 
707  DPRINTF(Quiesce, "Suspending Context\n");
708 
710 }
711 
712 void
714 {
715  //For now, this is the same as deallocate
716  DPRINTF(O3CPU,"[tid:%i] Halt Context called. Deallocating\n", tid);
717  assert(!switchedOut());
718 
719  deactivateThread(tid);
720  removeThread(tid);
721 
722  // If this was the last thread then unschedule the tick event.
723  if (activeThreads.size() == 0) {
724  if (tickEvent.scheduled())
725  {
727  }
729  _status = Idle;
730  }
732 }
733 
734 void
736 {
737  DPRINTF(O3CPU,"[tid:%i] Initializing thread into CPU");
738  // Will change now that the PC and thread state is internal to the CPU
739  // and not in the ThreadContext.
740  gem5::ThreadContext *src_tc;
741  if (FullSystem)
742  src_tc = system->threads[tid];
743  else
744  src_tc = tcBase(tid);
745 
746  //Bind Int Regs to Rename Map
747  const auto &regClasses = isa[tid]->regClasses();
748 
749  for (RegIndex idx = 0; idx < regClasses.at(IntRegClass).size(); idx++) {
750  PhysRegIdPtr phys_reg = freeList.getIntReg();
751  renameMap[tid].setEntry(RegId(IntRegClass, idx), phys_reg);
752  scoreboard.setReg(phys_reg);
753  }
754 
755  //Bind Float Regs to Rename Map
756  for (RegIndex idx = 0; idx < regClasses.at(FloatRegClass).size(); idx++) {
757  PhysRegIdPtr phys_reg = freeList.getFloatReg();
758  renameMap[tid].setEntry(RegId(FloatRegClass, idx), phys_reg);
759  scoreboard.setReg(phys_reg);
760  }
761 
762  //Bind condition-code Regs to Rename Map
763  for (RegIndex idx = 0; idx < regClasses.at(CCRegClass).size(); idx++) {
764  PhysRegIdPtr phys_reg = freeList.getCCReg();
765  renameMap[tid].setEntry(RegId(CCRegClass, idx), phys_reg);
766  scoreboard.setReg(phys_reg);
767  }
768 
769  //Copy Thread Data Into RegFile
770  //copyFromTC(tid);
771 
772  //Set PC/NPC/NNPC
773  pcState(src_tc->pcState(), tid);
774 
776 
777  activateContext(tid);
778 
779  //Reset ROB/IQ/LSQ Entries
781 }
782 
783 void
785 {
786  DPRINTF(O3CPU,"[tid:%i] Removing thread context from CPU.\n", tid);
787 
788  // Copy Thread Data From RegFile
789  // If thread is suspended, it might be re-allocated
790  // copyToTC(tid);
791 
792 
793  // @todo: 2-27-2008: Fix how we free up rename mappings
794  // here to alleviate the case for double-freeing registers
795  // in SMT workloads.
796 
797  // clear all thread-specific states in each stage of the pipeline
798  // since this thread is going to be completely removed from the CPU
799  commit.clearStates(tid);
800  fetch.clearStates(tid);
801  decode.clearStates(tid);
802  rename.clearStates(tid);
803  iew.clearStates(tid);
804 
805  // Flush out any old data from the time buffers.
806  for (int i = 0; i < timeBuffer.getSize(); ++i) {
807  timeBuffer.advance();
808  fetchQueue.advance();
809  decodeQueue.advance();
810  renameQueue.advance();
811  iewQueue.advance();
812  }
813 
814  // at this step, all instructions in the pipeline should be already
815  // either committed successfully or squashed. All thread-specific
816  // queues in the pipeline must be empty.
817  assert(iew.instQueue.getCount(tid) == 0);
818  assert(iew.ldstQueue.getCount(tid) == 0);
819  assert(commit.rob->isEmpty(tid));
820 
821  // Reset ROB/IQ/LSQ Entries
822 
823  // Commented out for now. This should be possible to do by
824  // telling all the pipeline stages to drain first, and then
825  // checking until the drain completes. Once the pipeline is
826  // drained, call resetEntries(). - 10-09-06 ktlim
827 /*
828  if (activeThreads.size() >= 1) {
829  commit.rob->resetEntries();
830  iew.resetEntries();
831  }
832 */
833 }
834 
835 void
837 {
838  const auto &regClasses = isa[tid]->regClasses();
839 
840  const size_t numVecs = regClasses.at(VecRegClass).size();
841  if (vecMode == enums::Elem) {
842  const size_t numElems = regClasses.at(VecElemClass).size();
843  const size_t elemsPerVec = numElems / numVecs;
844  for (auto v = 0; v < numVecs; v++) {
845  for (auto e = 0; e < elemsPerVec; e++) {
846  scoreboard.setReg(commitRenameMap[tid].lookup(
847  RegId(VecElemClass, v, e)));
848  }
849  }
850  } else if (vecMode == enums::Full) {
851  for (auto v = 0; v < numVecs; v++) {
852  scoreboard.setReg(commitRenameMap[tid].lookup(
853  RegId(VecRegClass, v)));
854  }
855  }
856 }
857 
858 void
860 {
861  auto pc = pcState(tid);
862 
863  // new_mode is the new vector renaming mode
864  auto new_mode = isa[tid]->vecRegRenameMode(thread[tid]->getTC());
865 
866  // We update vecMode only if there has been a change
867  if (new_mode != vecMode) {
868  vecMode = new_mode;
869 
872  renameMap[tid].switchFreeList(freelist);
873  setVectorsAsReady(tid);
874  }
875 }
876 
877 Fault
879 {
880  // Check if there are any outstanding interrupts
881  return interrupts[0]->getInterrupt();
882 }
883 
884 void
885 CPU::processInterrupts(const Fault &interrupt)
886 {
887  // Check for interrupts here. For now can copy the code that
888  // exists within isa_fullsys_traits.hh. Also assume that thread 0
889  // is the one that handles the interrupts.
890  // @todo: Possibly consolidate the interrupt checking code.
891  // @todo: Allow other threads to handle interrupts.
892 
893  assert(interrupt != NoFault);
894  interrupts[0]->updateIntrInfo();
895 
896  DPRINTF(O3CPU, "Interrupt %s being handled\n", interrupt->name());
897  trap(interrupt, 0, nullptr);
898 }
899 
900 void
901 CPU::trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
902 {
903  // Pass the thread's TC into the invoke method.
904  fault->invoke(threadContexts[tid], inst);
905 }
906 
907 void
909 {
910  thread[tid]->serialize(cp);
911 }
912 
913 void
915 {
916  thread[tid]->unserialize(cp);
917 }
918 
921 {
922  // Deschedule any power gating event (if any)
924 
925  // If the CPU isn't doing anything, then return immediately.
926  if (switchedOut())
927  return DrainState::Drained;
928 
929  DPRINTF(Drain, "Draining...\n");
930 
931  // We only need to signal a drain to the commit stage as this
932  // initiates squashing controls the draining. Once the commit
933  // stage commits an instruction where it is safe to stop, it'll
934  // squash the rest of the instructions in the pipeline and force
935  // the fetch stage to stall. The pipeline will be drained once all
936  // in-flight instructions have retired.
937  commit.drain();
938 
939  // Wake the CPU and record activity so everything can drain out if
940  // the CPU was not able to immediately drain.
941  if (!isCpuDrained()) {
942  // If a thread is suspended, wake it up so it can be drained
943  for (auto t : threadContexts) {
944  if (t->status() == gem5::ThreadContext::Suspended){
945  DPRINTF(Drain, "Currently suspended so activate %i \n",
946  t->threadId());
947  t->activate();
948  // As the thread is now active, change the power state as well
949  activateContext(t->threadId());
950  }
951  }
952 
953  wakeCPU();
955 
956  DPRINTF(Drain, "CPU not drained\n");
957 
958  return DrainState::Draining;
959  } else {
960  DPRINTF(Drain, "CPU is already drained\n");
961  if (tickEvent.scheduled())
963 
964  // Flush out any old data from the time buffers. In
965  // particular, there might be some data in flight from the
966  // fetch stage that isn't visible in any of the CPU buffers we
967  // test in isCpuDrained().
968  for (int i = 0; i < timeBuffer.getSize(); ++i) {
969  timeBuffer.advance();
970  fetchQueue.advance();
971  decodeQueue.advance();
972  renameQueue.advance();
973  iewQueue.advance();
974  }
975 
977  return DrainState::Drained;
978  }
979 }
980 
981 bool
983 {
985  return false;
986 
987  if (tickEvent.scheduled())
989 
990  DPRINTF(Drain, "CPU done draining, processing drain event\n");
991  signalDrainDone();
992 
993  return true;
994 }
995 
996 void
998 {
999  assert(isCpuDrained());
1005 }
1006 
1007 bool
1009 {
1010  bool drained(true);
1011 
1012  if (!instList.empty() || !removeList.empty()) {
1013  DPRINTF(Drain, "Main CPU structures not drained.\n");
1014  drained = false;
1015  }
1016 
1017  if (!fetch.isDrained()) {
1018  DPRINTF(Drain, "Fetch not drained.\n");
1019  drained = false;
1020  }
1021 
1022  if (!decode.isDrained()) {
1023  DPRINTF(Drain, "Decode not drained.\n");
1024  drained = false;
1025  }
1026 
1027  if (!rename.isDrained()) {
1028  DPRINTF(Drain, "Rename not drained.\n");
1029  drained = false;
1030  }
1031 
1032  if (!iew.isDrained()) {
1033  DPRINTF(Drain, "IEW not drained.\n");
1034  drained = false;
1035  }
1036 
1037  if (!commit.isDrained()) {
1038  DPRINTF(Drain, "Commit not drained.\n");
1039  drained = false;
1040  }
1041 
1042  return drained;
1043 }
1044 
1046 
1047 void
1049 {
1050  if (switchedOut())
1051  return;
1052 
1053  DPRINTF(Drain, "Resuming...\n");
1054  verifyMemoryMode();
1055 
1056  fetch.drainResume();
1057  commit.drainResume();
1058 
1059  _status = Idle;
1060  for (ThreadID i = 0; i < thread.size(); i++) {
1062  DPRINTF(Drain, "Activating thread: %i\n", i);
1063  activateThread(i);
1064  _status = Running;
1065  }
1066  }
1067 
1068  assert(!tickEvent.scheduled());
1069  if (_status == Running)
1071 
1072  // Reschedule any power gating event (if any)
1074 }
1075 
1076 void
1078 {
1079  DPRINTF(O3CPU, "Switching out\n");
1081 
1082  activityRec.reset();
1083 
1084  _status = SwitchedOut;
1085 
1086  if (checker)
1087  checker->switchOut();
1088 }
1089 
1090 void
1092 {
1093  BaseCPU::takeOverFrom(oldCPU);
1094 
1095  fetch.takeOverFrom();
1096  decode.takeOverFrom();
1097  rename.takeOverFrom();
1098  iew.takeOverFrom();
1099  commit.takeOverFrom();
1100 
1101  assert(!tickEvent.scheduled());
1102 
1103  auto *oldO3CPU = dynamic_cast<CPU *>(oldCPU);
1104  if (oldO3CPU)
1105  globalSeqNum = oldO3CPU->globalSeqNum;
1106 
1108  _status = Idle;
1109 }
1110 
1111 void
1113 {
1114  if (!system->isTimingMode()) {
1115  fatal("The O3 CPU requires the memory system to be in "
1116  "'timing' mode.\n");
1117  }
1118 }
1119 
1120 RegVal
1121 CPU::readMiscRegNoEffect(int misc_reg, ThreadID tid) const
1122 {
1123  return isa[tid]->readMiscRegNoEffect(misc_reg);
1124 }
1125 
1126 RegVal
1127 CPU::readMiscReg(int misc_reg, ThreadID tid)
1128 {
1130  return isa[tid]->readMiscReg(misc_reg);
1131 }
1132 
1133 void
1135 {
1136  isa[tid]->setMiscRegNoEffect(misc_reg, val);
1137 }
1138 
1139 void
1140 CPU::setMiscReg(int misc_reg, RegVal val, ThreadID tid)
1141 {
1143  isa[tid]->setMiscReg(misc_reg, val);
1144 }
1145 
1146 RegVal
1148 {
1150  return regFile.readIntReg(phys_reg);
1151 }
1152 
1153 RegVal
1155 {
1157  return regFile.readFloatReg(phys_reg);
1158 }
1159 
1162 {
1164  return regFile.readVecReg(phys_reg);
1165 }
1166 
1169 {
1171  return regFile.getWritableVecReg(phys_reg);
1172 }
1173 
1174 const TheISA::VecElem&
1176 {
1178  return regFile.readVecElem(phys_reg);
1179 }
1180 
1183 {
1185  return regFile.readVecPredReg(phys_reg);
1186 }
1187 
1190 {
1192  return regFile.getWritableVecPredReg(phys_reg);
1193 }
1194 
1195 RegVal
1197 {
1199  return regFile.readCCReg(phys_reg);
1200 }
1201 
1202 void
1204 {
1206  regFile.setIntReg(phys_reg, val);
1207 }
1208 
1209 void
1211 {
1213  regFile.setFloatReg(phys_reg, val);
1214 }
1215 
1216 void
1218 {
1220  regFile.setVecReg(phys_reg, val);
1221 }
1222 
1223 void
1225 {
1227  regFile.setVecElem(phys_reg, val);
1228 }
1229 
1230 void
1233 {
1235  regFile.setVecPredReg(phys_reg, val);
1236 }
1237 
1238 void
1240 {
1242  regFile.setCCReg(phys_reg, val);
1243 }
1244 
1245 RegVal
1247 {
1249  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1250  RegId(IntRegClass, reg_idx));
1251 
1252  return regFile.readIntReg(phys_reg);
1253 }
1254 
1255 RegVal
1257 {
1259  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1260  RegId(FloatRegClass, reg_idx));
1261 
1262  return regFile.readFloatReg(phys_reg);
1263 }
1264 
1266 CPU::readArchVecReg(int reg_idx, ThreadID tid) const
1267 {
1268  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1269  RegId(VecRegClass, reg_idx));
1270  return readVecReg(phys_reg);
1271 }
1272 
1275 {
1276  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1277  RegId(VecRegClass, reg_idx));
1278  return getWritableVecReg(phys_reg);
1279 }
1280 
1281 const TheISA::VecElem&
1283  const RegIndex& reg_idx, const ElemIndex& ldx, ThreadID tid) const
1284 {
1285  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1286  RegId(VecElemClass, reg_idx, ldx));
1287  return readVecElem(phys_reg);
1288 }
1289 
1291 CPU::readArchVecPredReg(int reg_idx, ThreadID tid) const
1292 {
1293  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1294  RegId(VecPredRegClass, reg_idx));
1295  return readVecPredReg(phys_reg);
1296 }
1297 
1300 {
1301  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1302  RegId(VecPredRegClass, reg_idx));
1303  return getWritableVecPredReg(phys_reg);
1304 }
1305 
1306 RegVal
1307 CPU::readArchCCReg(int reg_idx, ThreadID tid)
1308 {
1310  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1311  RegId(CCRegClass, reg_idx));
1312 
1313  return regFile.readCCReg(phys_reg);
1314 }
1315 
1316 void
1318 {
1320  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1321  RegId(IntRegClass, reg_idx));
1322 
1323  regFile.setIntReg(phys_reg, val);
1324 }
1325 
1326 void
1328 {
1330  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1331  RegId(FloatRegClass, reg_idx));
1332 
1333  regFile.setFloatReg(phys_reg, val);
1334 }
1335 
1336 void
1338  ThreadID tid)
1339 {
1340  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1341  RegId(VecRegClass, reg_idx));
1342  setVecReg(phys_reg, val);
1343 }
1344 
1345 void
1346 CPU::setArchVecElem(const RegIndex& reg_idx, const ElemIndex& ldx,
1347  const TheISA::VecElem& val, ThreadID tid)
1348 {
1349  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1350  RegId(VecElemClass, reg_idx, ldx));
1351  setVecElem(phys_reg, val);
1352 }
1353 
1354 void
1357 {
1358  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1359  RegId(VecPredRegClass, reg_idx));
1360  setVecPredReg(phys_reg, val);
1361 }
1362 
1363 void
1365 {
1367  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
1368  RegId(CCRegClass, reg_idx));
1369 
1370  regFile.setCCReg(phys_reg, val);
1371 }
1372 
1375 {
1376  return commit.pcState(tid);
1377 }
1378 
1379 void
1381 {
1382  commit.pcState(val, tid);
1383 }
1384 
1385 Addr
1387 {
1388  return commit.instAddr(tid);
1389 }
1390 
1391 Addr
1393 {
1394  return commit.nextInstAddr(tid);
1395 }
1396 
1397 MicroPC
1399 {
1400  return commit.microPC(tid);
1401 }
1402 
1403 void
1405 {
1406  thread[tid]->noSquashFromTC = true;
1407  commit.generateTCEvent(tid);
1408 }
1409 
1412 {
1413  instList.push_back(inst);
1414 
1415  return --(instList.end());
1416 }
1417 
1418 void
1420 {
1421  // Keep an instruction count.
1422  if (!inst->isMicroop() || inst->isLastMicroop()) {
1423  thread[tid]->numInst++;
1424  thread[tid]->threadStats.numInsts++;
1425  cpuStats.committedInsts[tid]++;
1426 
1427  // Check for instruction-count-based events.
1428  thread[tid]->comInstEventQueue.serviceEvents(thread[tid]->numInst);
1429  }
1430  thread[tid]->numOp++;
1431  thread[tid]->threadStats.numOps++;
1432  cpuStats.committedOps[tid]++;
1433 
1434  probeInstCommit(inst->staticInst, inst->instAddr());
1435 }
1436 
1437 void
1439 {
1440  DPRINTF(O3CPU, "Removing committed instruction [tid:%i] PC %s "
1441  "[sn:%lli]\n",
1442  inst->threadNumber, inst->pcState(), inst->seqNum);
1443 
1444  removeInstsThisCycle = true;
1445 
1446  // Remove the front instruction.
1447  removeList.push(inst->getInstListIt());
1448 }
1449 
1450 void
1452 {
1453  DPRINTF(O3CPU, "Thread %i: Deleting instructions from instruction"
1454  " list.\n", tid);
1455 
1456  ListIt end_it;
1457 
1458  bool rob_empty = false;
1459 
1460  if (instList.empty()) {
1461  return;
1462  } else if (rob.isEmpty(tid)) {
1463  DPRINTF(O3CPU, "ROB is empty, squashing all insts.\n");
1464  end_it = instList.begin();
1465  rob_empty = true;
1466  } else {
1467  end_it = (rob.readTailInst(tid))->getInstListIt();
1468  DPRINTF(O3CPU, "ROB is not empty, squashing insts not in ROB.\n");
1469  }
1470 
1471  removeInstsThisCycle = true;
1472 
1473  ListIt inst_it = instList.end();
1474 
1475  inst_it--;
1476 
1477  // Walk through the instruction list, removing any instructions
1478  // that were inserted after the given instruction iterator, end_it.
1479  while (inst_it != end_it) {
1480  assert(!instList.empty());
1481 
1482  squashInstIt(inst_it, tid);
1483 
1484  inst_it--;
1485  }
1486 
1487  // If the ROB was empty, then we actually need to remove the first
1488  // instruction as well.
1489  if (rob_empty) {
1490  squashInstIt(inst_it, tid);
1491  }
1492 }
1493 
1494 void
1496 {
1497  assert(!instList.empty());
1498 
1499  removeInstsThisCycle = true;
1500 
1501  ListIt inst_iter = instList.end();
1502 
1503  inst_iter--;
1504 
1505  DPRINTF(O3CPU, "Deleting instructions from instruction "
1506  "list that are from [tid:%i] and above [sn:%lli] (end=%lli).\n",
1507  tid, seq_num, (*inst_iter)->seqNum);
1508 
1509  while ((*inst_iter)->seqNum > seq_num) {
1510 
1511  bool break_loop = (inst_iter == instList.begin());
1512 
1513  squashInstIt(inst_iter, tid);
1514 
1515  inst_iter--;
1516 
1517  if (break_loop)
1518  break;
1519  }
1520 }
1521 
1522 void
1523 CPU::squashInstIt(const ListIt &instIt, ThreadID tid)
1524 {
1525  if ((*instIt)->threadNumber == tid) {
1526  DPRINTF(O3CPU, "Squashing instruction, "
1527  "[tid:%i] [sn:%lli] PC %s\n",
1528  (*instIt)->threadNumber,
1529  (*instIt)->seqNum,
1530  (*instIt)->pcState());
1531 
1532  // Mark it as squashed.
1533  (*instIt)->setSquashed();
1534 
1535  // @todo: Formulate a consistent method for deleting
1536  // instructions from the instruction list
1537  // Remove the instruction from the list.
1538  removeList.push(instIt);
1539  }
1540 }
1541 
1542 void
1544 {
1545  while (!removeList.empty()) {
1546  DPRINTF(O3CPU, "Removing instruction, "
1547  "[tid:%i] [sn:%lli] PC %s\n",
1548  (*removeList.front())->threadNumber,
1549  (*removeList.front())->seqNum,
1550  (*removeList.front())->pcState());
1551 
1552  instList.erase(removeList.front());
1553 
1554  removeList.pop();
1555  }
1556 
1557  removeInstsThisCycle = false;
1558 }
1559 /*
1560 void
1561 CPU::removeAllInsts()
1562 {
1563  instList.clear();
1564 }
1565 */
1566 void
1568 {
1569  int num = 0;
1570 
1571  ListIt inst_list_it = instList.begin();
1572 
1573  cprintf("Dumping Instruction List\n");
1574 
1575  while (inst_list_it != instList.end()) {
1576  cprintf("Instruction:%i\nPC:%#x\n[tid:%i]\n[sn:%lli]\nIssued:%i\n"
1577  "Squashed:%i\n\n",
1578  num, (*inst_list_it)->instAddr(), (*inst_list_it)->threadNumber,
1579  (*inst_list_it)->seqNum, (*inst_list_it)->isIssued(),
1580  (*inst_list_it)->isSquashed());
1581  inst_list_it++;
1582  ++num;
1583  }
1584 }
1585 /*
1586 void
1587 CPU::wakeDependents(const DynInstPtr &inst)
1588 {
1589  iew.wakeDependents(inst);
1590 }
1591 */
1592 void
1594 {
1595  if (activityRec.active() || tickEvent.scheduled()) {
1596  DPRINTF(Activity, "CPU already running.\n");
1597  return;
1598  }
1599 
1600  DPRINTF(Activity, "Waking up CPU\n");
1601 
1602  Cycles cycles(curCycle() - lastRunningCycle);
1603  // @todo: This is an oddity that is only here to match the stats
1604  if (cycles > 1) {
1605  --cycles;
1606  cpuStats.idleCycles += cycles;
1607  baseStats.numCycles += cycles;
1608  }
1609 
1611 }
1612 
1613 void
1615 {
1617  return;
1618 
1619  wakeCPU();
1620 
1621  DPRINTF(Quiesce, "Suspended Processor woken\n");
1622  threadContexts[tid]->activate();
1623 }
1624 
1625 ThreadID
1627 {
1628  for (ThreadID tid = 0; tid < numThreads; tid++) {
1629  if (!tids[tid]) {
1630  tids[tid] = true;
1631  return tid;
1632  }
1633  }
1634 
1635  return InvalidThreadID;
1636 }
1637 
1638 void
1640 {
1641  if (activeThreads.size() > 1) {
1642  //DEFAULT TO ROUND ROBIN SCHEME
1643  //e.g. Move highest priority to end of thread list
1644  std::list<ThreadID>::iterator list_begin = activeThreads.begin();
1645 
1646  unsigned high_thread = *list_begin;
1647 
1648  activeThreads.erase(list_begin);
1649 
1650  activeThreads.push_back(high_thread);
1651  }
1652 }
1653 
1654 void
1656 {
1657  DPRINTF(O3CPU, "Thread %d is inserted to exitingThreads list\n", tid);
1658 
1659  // the thread trying to exit can't be already halted
1660  assert(tcBase(tid)->status() != gem5::ThreadContext::Halted);
1661 
1662  // make sure the thread has not been added to the list yet
1663  assert(exitingThreads.count(tid) == 0);
1664 
1665  // add the thread to exitingThreads list to mark that this thread is
1666  // trying to exit. The boolean value in the pair denotes if a thread is
1667  // ready to exit. The thread is not ready to exit until the corresponding
1668  // exit trap event is processed in the future. Until then, it'll be still
1669  // an active thread that is trying to exit.
1670  exitingThreads.emplace(std::make_pair(tid, false));
1671 }
1672 
1673 bool
1675 {
1676  return exitingThreads.count(tid) == 1;
1677 }
1678 
1679 void
1681 {
1682  assert(exitingThreads.count(tid) == 1);
1683 
1684  // exit trap event has been processed. Now, the thread is ready to exit
1685  // and be removed from the CPU.
1686  exitingThreads[tid] = true;
1687 
1688  // we schedule a threadExitEvent in the next cycle to properly clean
1689  // up the thread's states in the pipeline. threadExitEvent has lower
1690  // priority than tickEvent, so the cleanup will happen at the very end
1691  // of the next cycle after all pipeline stages complete their operations.
1692  // We want all stages to complete squashing instructions before doing
1693  // the cleanup.
1694  if (!threadExitEvent.scheduled()) {
1696  }
1697 }
1698 
1699 void
1701 {
1702  // there must be at least one thread trying to exit
1703  assert(exitingThreads.size() > 0);
1704 
1705  // terminate all threads that are ready to exit
1706  auto it = exitingThreads.begin();
1707  while (it != exitingThreads.end()) {
1708  ThreadID thread_id = it->first;
1709  bool readyToExit = it->second;
1710 
1711  if (readyToExit) {
1712  DPRINTF(O3CPU, "Exiting thread %d\n", thread_id);
1713  haltContext(thread_id);
1715  it = exitingThreads.erase(it);
1716  } else {
1717  it++;
1718  }
1719  }
1720 }
1721 
1722 void
1723 CPU::htmSendAbortSignal(ThreadID tid, uint64_t htm_uid,
1724  HtmFailureFaultCause cause)
1725 {
1726  const Addr addr = 0x0ul;
1727  const int size = 8;
1728  const Request::Flags flags =
1730 
1731  // O3-specific actions
1734 
1735  // notify l1 d-cache (ruby) that core has aborted transaction
1736  RequestPtr req =
1737  std::make_shared<Request>(addr, size, flags, _dataRequestorId);
1738 
1739  req->taskId(taskId());
1740  req->setContext(thread[tid]->contextId());
1741  req->setHtmAbortCause(cause);
1742 
1743  assert(req->isHTMAbort());
1744 
1745  PacketPtr abort_pkt = Packet::createRead(req);
1746  uint8_t *memData = new uint8_t[8];
1747  assert(memData);
1748  abort_pkt->dataStatic(memData);
1749  abort_pkt->setHtmTransactional(htm_uid);
1750 
1751  // TODO include correct error handling here
1752  if (!iew.ldstQueue.getDataPort().sendTimingReq(abort_pkt)) {
1753  panic("HTM abort signal was not sent to the memory subsystem.");
1754  }
1755 }
1756 
1757 } // namespace o3
1758 } // namespace gem5
gem5::o3::Rename::isDrained
bool isDrained() const
Has the stage drained?
Definition: rename.cc:305
gem5::o3::CPU::vecMode
enums::VecRegRenameMode vecMode
The rename mode of the vector registers.
Definition: cpu.hh:498
gem5::curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46
gem5::o3::CPU::setArchIntReg
void setArchIntReg(int reg_idx, RegVal val, ThreadID tid)
Architectural register accessors.
Definition: cpu.cc:1317
gem5::o3::UnifiedRenameMap::switchMode
void switchMode(VecMode newVecMode)
Set vector mode to Full or Elem.
Definition: rename_map.cc:166
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:189
gem5::o3::PhysRegFile::setCCReg
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
Sets a condition-code register to the given value.
Definition: regfile.hh:340
gem5::o3::CPU::addThreadToExitingList
void addThreadToExitingList(ThreadID tid)
Insert tid to the list of threads trying to exit.
Definition: cpu.cc:1655
gem5::VecElemClass
@ VecElemClass
Vector Register Native Elem lane.
Definition: reg_class.hh:62
gem5::o3::PhysRegFile::getWritableVecReg
TheISA::VecRegContainer & getWritableVecReg(PhysRegIdPtr phys_reg)
Reads a vector register for modification.
Definition: regfile.hh:222
gem5::o3::Commit::takeOverFrom
void takeOverFrom()
Takes over from another CPU's thread.
Definition: commit.cc:400
gem5::o3::CPU::dumpInsts
void dumpInsts()
Debug function to print all instructions on the list.
Definition: cpu.cc:1567
gem5::o3::CPU::ppDataAccessComplete
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
Definition: cpu.hh:174
gem5::CCRegClass
@ CCRegClass
Condition-code register.
Definition: reg_class.hh:64
gem5::o3::CPU::readVecElem
const TheISA::VecElem & readVecElem(PhysRegIdPtr reg_idx) const
Definition: cpu.cc:1175
gem5::o3::CPU::isCpuDrained
bool isCpuDrained() const
Check if a system is in a drained state.
Definition: cpu.cc:1008
gem5::o3::CPU::tids
std::vector< ThreadID > tids
Available thread ids in the cpu.
Definition: cpu.hh:623
gem5::o3::CPU::setArchVecElem
void setArchVecElem(const RegIndex &reg_idx, const ElemIndex &ldx, const TheISA::VecElem &val, ThreadID tid)
Definition: cpu.cc:1346
gem5::o3::CPU::CPUStats::miscRegfileWrites
statistics::Scalar miscRegfileWrites
Definition: cpu.hh:705
gem5::NoFault
constexpr decltype(nullptr) NoFault
Definition: types.hh:260
gem5::ThreadContext::Active
@ Active
Running.
Definition: thread_context.hh:108
gem5::BaseCPU::switchedOut
bool switchedOut() const
Determine if the CPU is switched out.
Definition: base.hh:357
gem5::RequestPort::sendTimingReq
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
Definition: port.hh:495
gem5::o3::CPU::removeList
std::queue< ListIt > removeList
List of all the instructions that will be removed at the end of this cycle.
Definition: cpu.hh:467
gem5::o3::Rename::tick
void tick()
Ticks rename, which processes all input signals and attempts to rename as many instructions as possib...
Definition: rename.cc:389
gem5::o3::CPU::setVecElem
void setVecElem(PhysRegIdPtr reg_idx, const TheISA::VecElem &val)
Definition: cpu.cc:1224
gem5::BaseCPU::interrupts
std::vector< BaseInterrupts * > interrupts
Definition: base.hh:225
gem5::o3::Commit::regProbePoints
void regProbePoints()
Registers probes.
Definition: commit.cc:139
gem5::o3::Rename::drainSanityCheck
void drainSanityCheck() const
Perform sanity checks after a drain.
Definition: rename.cc:325
gem5::o3::CPU::CPUStats::fpRegfileWrites
statistics::Scalar fpRegfileWrites
Definition: cpu.hh:693
gem5::RegVal
uint64_t RegVal
Definition: types.hh:173
gem5::o3::CPU::readCCReg
RegVal readCCReg(PhysRegIdPtr phys_reg)
Definition: cpu.cc:1196
gem5::o3::CPU::removeInstsThisCycle
bool removeInstsThisCycle
Records if instructions need to be removed this cycle due to being retired or squashed.
Definition: cpu.hh:479
gem5::o3::PhysRegFile::readVecReg
const TheISA::VecRegContainer & readVecReg(PhysRegIdPtr phys_reg) const
Reads a vector register.
Definition: regfile.hh:209
gem5::o3::CPU::ListIt
std::list< DynInstPtr >::iterator ListIt
Definition: cpu.hh:98
gem5::o3::CPU::cpuStats
gem5::o3::CPU::CPUStats cpuStats
gem5::Request::STRICT_ORDER
@ STRICT_ORDER
The request is required to be strictly ordered by CPU models and is non-speculative.
Definition: request.hh:135
gem5::cprintf
void cprintf(const char *format, const Args &...args)
Definition: cprintf.hh:155
gem5::o3::CPU::globalSeqNum
InstSeqNum globalSeqNum
The global sequence number counter.
Definition: cpu.hh:596
gem5::o3::CPU::removeInstsUntil
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
Definition: cpu.cc:1495
gem5::o3::ROB::readTailInst
DynInstPtr readTailInst(ThreadID tid)
Returns pointer to the tail instruction within the ROB.
Definition: rob.cc:516
system.hh
gem5::ArmISA::VecPredRegContainer
VecPredReg::Container VecPredRegContainer
Definition: vec.hh:68
gem5::o3::CPU::CPU
CPU(const O3CPUParams &params)
Constructs a CPU with the given parameters.
Definition: cpu.cc:72
gem5::o3::Commit::drain
void drain()
Initializes the draining of commit.
Definition: commit.cc:348
gem5::o3::PhysRegFile::readVecElem
const TheISA::VecElem & readVecElem(PhysRegIdPtr phys_reg) const
Reads a vector element.
Definition: regfile.hh:230
gem5::Clocked::curCycle
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
Definition: clocked_object.hh:195
gem5::ThreadContext::Halted
@ Halted
Permanently shut down.
Definition: thread_context.hh:121
gem5::BaseCPU::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: base.cc:315
gem5::o3::PhysRegFile::setVecPredReg
void setVecPredReg(PhysRegIdPtr phys_reg, const TheISA::VecPredRegContainer &val)
Sets a predicate register to the given value.
Definition: regfile.hh:327
gem5::HtmFailureFaultCause
HtmFailureFaultCause
Definition: htm.hh:47
gem5::o3::CPU::regFile
PhysRegFile regFile
The register file.
Definition: cpu.hh:501
gem5::Drainable::drainState
DrainState drainState() const
Return the current drain state of an object.
Definition: drain.hh:324
gem5::o3::PhysRegFile::readFloatReg
RegVal readFloatReg(PhysRegIdPtr phys_reg) const
Definition: regfile.hh:195
gem5::o3::LSQ::getCount
int getCount()
Returns the number of instructions in all of the queues.
Definition: lsq.cc:464
gem5::o3::CPU::decode
Decode decode
The decode stage.
Definition: cpu.hh:486
gem5::o3::CPU::CPUStats::ccRegfileWrites
statistics::Scalar ccRegfileWrites
Definition: cpu.hh:702
gem5::o3::CPU::activeThreads
std::list< ThreadID > activeThreads
Active Threads List.
Definition: cpu.hh:516
gem5::o3::Commit::setThreads
void setThreads(std::vector< ThreadState * > &threads)
Sets the list of threads.
Definition: commit.cc:248
gem5::Request::HTM_ABORT
@ HTM_ABORT
The request aborts a HTM transaction.
Definition: request.hh:214
gem5::o3::CPU::freeList
UnifiedFreeList freeList
The free list.
Definition: cpu.hh:504
gem5::o3::PhysRegFile::readIntReg
RegVal readIntReg(PhysRegIdPtr phys_reg) const
Reads an integer register.
Definition: regfile.hh:185
gem5::o3::CPU::processInterrupts
void processInterrupts(const Fault &interrupt)
Processes any an interrupt fault.
Definition: cpu.cc:885
gem5::o3::Decode::clearStates
void clearStates(ThreadID tid)
Clear all thread-specific states.
Definition: decode.cc:98
gem5::CheckpointIn
Definition: serialize.hh:68
gem5::o3::Fetch::drainStall
void drainStall(ThreadID tid)
Stall the fetch stage after reaching a safe drain point.
Definition: fetch.cc:459
gem5::o3::CPU::readArchFloatReg
RegVal readArchFloatReg(int reg_idx, ThreadID tid)
Definition: cpu.cc:1256
gem5::o3::CPU::CPUStats::quiesceCycles
statistics::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
Definition: cpu.hh:673
gem5::o3::CPU::getInterrupts
Fault getInterrupts()
Returns the Fault for any valid interrupt.
Definition: cpu.cc:878
gem5::o3::CPU::squashInstIt
void squashInstIt(const ListIt &instIt, ThreadID tid)
Removes the instruction pointed to by the iterator.
Definition: cpu.cc:1523
gem5::BaseCPU::updateCycleCounters
void updateCycleCounters(CPUState state)
base method keeping track of cycle progression
Definition: base.hh:523
gem5::o3::Fetch::wakeFromQuiesce
void wakeFromQuiesce()
Tells fetch to wake up from a quiesce instruction.
Definition: fetch.cc:468
cur_tick.hh
gem5::FloatRegClass
@ FloatRegClass
Floating-point register.
Definition: reg_class.hh:58
gem5::o3::IEW::takeOverFrom
void takeOverFrom()
Takes over from another CPU's thread.
Definition: iew.cc:392
gem5::o3::CPU::readArchCCReg
RegVal readArchCCReg(int reg_idx, ThreadID tid)
Definition: cpu.cc:1307
gem5::o3::CPU::CPUStats::miscRegfileReads
statistics::Scalar miscRegfileReads
Definition: cpu.hh:704
gem5::o3::Commit::startupStage
void startupStage()
Initializes stage by sending back the number of free entries.
Definition: commit.cc:314
gem5::BaseCPU::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: base.cc:272
gem5::o3::CPU::CPUStats::intRegfileReads
statistics::Scalar intRegfileReads
Definition: cpu.hh:689
gem5::o3::IEW::clearStates
void clearStates(ThreadID tid)
Clear all thread-specific states.
Definition: iew.cc:293
gem5::o3::CPU::_status
Status _status
Overall CPU status.
Definition: cpu.hh:116
gem5::ArmISA::e
Bitfield< 9 > e
Definition: misc_types.hh:64
gem5::Packet::setHtmTransactional
void setHtmTransactional(uint64_t val)
Stipulates that this packet/request originates in the CPU executing in transactional mode,...
Definition: packet.cc:521
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:775
gem5::o3::CPU::timeBuffer
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
Definition: cpu.hh:546
gem5::ThreadContext::setStatus
virtual void setStatus(Status new_status)=0
gem5::ActivityRecorder::advance
void advance()
Advances the activity buffer, decrementing the activityCount if active communication just left the ti...
Definition: activity.cc:71
gem5::o3::CPU::removeThread
void removeThread(ThreadID tid)
Remove all of a thread's context from CPU.
Definition: cpu.cc:784
gem5::Request::PHYSICAL
@ PHYSICAL
The virtual address is also the physical address.
Definition: request.hh:117
gem5::o3::UnifiedFreeList
FreeList class that simply holds the list of free integer and floating point registers.
Definition: free_list.hh:122
gem5::VecPredRegClass
@ VecPredRegClass
Definition: reg_class.hh:63
gem5::o3::CPU::htmSendAbortSignal
void htmSendAbortSignal(ThreadID tid, uint64_t htm_uid, HtmFailureFaultCause cause)
Definition: cpu.cc:1723
gem5::X86ISA::system
Bitfield< 15 > system
Definition: misc.hh:1003
gem5::o3::CPU::setVecReg
void setVecReg(PhysRegIdPtr reg_idx, const TheISA::VecRegContainer &val)
Definition: cpu.cc:1217
gem5::EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1019
gem5::o3::CPU::setMiscReg
void setMiscReg(int misc_reg, RegVal val, ThreadID tid)
Sets a misc.
Definition: cpu.cc:1140
gem5::o3::CPU::CPUStats::totalIpc
statistics::Formula totalIpc
Stat for the total IPC.
Definition: cpu.hh:686
gem5::o3::CPU::getWritableVecPredReg
TheISA::VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr reg_idx)
Definition: cpu.cc:1189
gem5::o3::CPU::renameMap
UnifiedRenameMap renameMap[MaxThreads]
The rename map.
Definition: cpu.hh:507
gem5::o3::Fetch::clearStates
void clearStates(ThreadID tid)
Clear all thread-specific states.
Definition: fetch.cc:299
gem5::o3::CPU::instList
std::list< DynInstPtr > instList
List of all the instructions in flight.
Definition: cpu.hh:462
gem5::o3::PhysRegFile::getWritableVecPredReg
TheISA::VecPredRegContainer & getWritableVecPredReg(PhysRegIdPtr phys_reg)
Definition: regfile.hh:256
gem5::o3::Fetch::isDrained
bool isDrained() const
Has the stage drained?
Definition: fetch.cc:421
gem5::o3::CPU::verifyMemoryMode
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
Definition: cpu.cc:1112
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:66
gem5::o3::CPU::deactivateThread
void deactivateThread(ThreadID tid)
Remove Thread from Active Threads List.
Definition: cpu.cc:607
gem5::o3::CPU::CPUStats::intRegfileWrites
statistics::Scalar intRegfileWrites
Definition: cpu.hh:690
gem5::o3::CPU::unserializeThread
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Unserialize one thread.
Definition: cpu.cc:914
gem5::EventBase::CPU_Exit_Pri
static const Priority CPU_Exit_Pri
If we want to exit a thread in a CPU, it comes after CPU_Tick_Pri.
Definition: eventq.hh:211
gem5::BaseCPU::schedulePowerGatingEvent
void schedulePowerGatingEvent()
Definition: base.cc:460
gem5::o3::CPU::readFloatReg
RegVal readFloatReg(PhysRegIdPtr phys_reg)
Definition: cpu.cc:1154
gem5::o3::CPU::CPUStats::cpi
statistics::Formula cpi
Stat for the CPI per thread.
Definition: cpu.hh:680
gem5::o3::CPU::drainSanityCheck
void drainSanityCheck() const
Perform sanity checks after a drain.
Definition: cpu.cc:997
gem5::o3::CPU::serializeThread
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Serialize a single thread.
Definition: cpu.cc:908
gem5::o3::CPU::cleanUpRemovedInsts
void cleanUpRemovedInsts()
Cleans up all instructions on the remove list.
Definition: cpu.cc:1543
gem5::o3::Commit::deactivateThread
void deactivateThread(ThreadID tid)
Deschedules a thread from scheduling.
Definition: commit.cc:415
gem5::o3::ROB::resetEntries
void resetEntries()
Re-adjust ROB partitioning.
Definition: rob.cc:148
gem5::o3::CPU::iewQueue
TimeBuffer< IEWStruct > iewQueue
The IEW stage's instruction queue.
Definition: cpu.hh:558
gem5::o3::CPU::ppInstAccessComplete
ProbePointArg< PacketPtr > * ppInstAccessComplete
Definition: cpu.hh:173
gem5::o3::IEW::startupStage
void startupStage()
Initializes stage; sends back the number of free IQ and LSQ entries.
Definition: iew.cc:270
gem5::o3::PhysRegFile::setVecElem
void setVecElem(PhysRegIdPtr phys_reg, const TheISA::VecElem val)
Sets a vector register to the given value.
Definition: regfile.hh:314
gem5::RefCountingPtr< StaticInst >
gem5::o3::LSQ::resetHtmStartsStops
void resetHtmStartsStops(ThreadID tid)
Definition: lsq.cc:369
gem5::o3::CPU::checker
gem5::Checker< DynInstPtr > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
Definition: cpu.hh:602
gem5::o3::CPU::unscheduleTickEvent
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
Definition: cpu.hh:136
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
gem5::o3::CPU::totalInsts
Counter totalInsts() const override
Count the Total Instructions Committed in the CPU.
Definition: cpu.cc:631
gem5::o3::Fetch::drainSanityCheck
void drainSanityCheck() const
Perform sanity checks after a drain.
Definition: fetch.cc:404
gem5::BaseCPU::numThreads
ThreadID numThreads
Number of threads we're actually simulating (<= SMT_MAX_THREADS).
Definition: base.hh:368
gem5::PhysRegIdPtr
PhysRegId * PhysRegIdPtr
Definition: reg_class.hh:308
gem5::o3::CPU::CPUStats::committedInsts
statistics::Vector committedInsts
Stat for the number of committed instructions per thread.
Definition: cpu.hh:675
gem5::o3::CPU::CPUStats::idleCycles
statistics::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
Definition: cpu.hh:670
gem5::o3::CPU::setArchFloatReg
void setArchFloatReg(int reg_idx, RegVal val, ThreadID tid)
Definition: cpu.cc:1327
gem5::o3::IEW::instQueue
InstructionQueue instQueue
Instruction queue.
Definition: iew.hh:355
gem5::o3::CPU::decodeQueue
TimeBuffer< DecodeStruct > decodeQueue
The decode stage's instruction queue.
Definition: cpu.hh:552
gem5::Packet::dataStatic
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1134
gem5::MicroPC
uint16_t MicroPC
Definition: types.hh:149
gem5::o3::Fetch::drainResume
void drainResume()
Resume after a drain.
Definition: fetch.cc:395
gem5::o3::CPU::CPUStats::totalCpi
statistics::Formula totalCpi
Stat for the total CPI.
Definition: cpu.hh:682
gem5::o3::CPU::setArchCCReg
void setArchCCReg(int reg_idx, RegVal val, ThreadID tid)
Definition: cpu.cc:1364
gem5::BaseCPU::deschedulePowerGatingEvent
void deschedulePowerGatingEvent()
Definition: base.cc:452
gem5::o3::Rename::clearStates
void clearStates(ThreadID tid)
Clear all thread-specific states.
Definition: rename.cc:227
gem5::Flags< FlagsType >
gem5::o3::CPU::getWritableVecReg
TheISA::VecRegContainer & getWritableVecReg(PhysRegIdPtr reg_idx)
Read physical vector register for modification.
Definition: cpu.cc:1168
gem5::DrainState
DrainState
Object drain/handover states.
Definition: drain.hh:74
gem5::o3::Commit::generateTCEvent
void generateTCEvent(ThreadID tid)
Records that commit needs to initiate a squash due to an external state update through the TC.
Definition: commit.cc:524
gem5::o3::CPU::setArchVecReg
void setArchVecReg(int reg_idx, const TheISA::VecRegContainer &val, ThreadID tid)
Definition: cpu.cc:1337
gem5::BaseCPU::suspendContext
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
Definition: base.cc:502
gem5::BaseCPU::baseStats
gem5::BaseCPU::BaseCPUStats baseStats
gem5::o3::Decode::takeOverFrom
void takeOverFrom()
Takes over from another CPU's thread.
Definition: decode.hh:132
gem5::o3::Decode::tick
void tick()
Ticks decode, processing all input signals and decoding as many instructions as possible.
Definition: decode.cc:544
gem5::o3::CPU::readArchVecPredReg
const TheISA::VecPredRegContainer & readArchVecPredReg(int reg_idx, ThreadID tid) const
Definition: cpu.cc:1291
gem5::BaseCPU::taskId
uint32_t taskId() const
Get cpu task id.
Definition: base.hh:212
gem5::BaseCPU::_dataRequestorId
RequestorID _dataRequestorId
data side request id that must be placed in all requests
Definition: base.hh:132
gem5::o3::CPU::tryDrain
bool tryDrain()
Check if the pipeline has drained and signal drain done.
Definition: cpu.cc:982
gem5::o3::CPU::wakeup
virtual void wakeup(ThreadID tid) override
Definition: cpu.cc:1614
gem5::o3::CPU
O3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time buff...
Definition: cpu.hh:95
gem5::o3::CPU::insertThread
void insertThread(ThreadID tid)
Setup CPU to insert a thread's context.
Definition: cpu.cc:735
gem5::o3::IEW::isDrained
bool isDrained() const
Has the stage drained?
Definition: iew.cc:355
gem5::o3::CPU::setCCReg
void setCCReg(PhysRegIdPtr phys_reg, RegVal val)
Definition: cpu.cc:1239
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:93
gem5::o3::CPU::CPUStats::vecPredRegfileReads
statistics::Scalar vecPredRegfileReads
Definition: cpu.hh:698
gem5::o3::CPU::setIntReg
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
Definition: cpu.cc:1203
gem5::Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:255
gem5::o3::CPU::scheduleTickEvent
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
Definition: cpu.hh:127
gem5::o3::CPU::totalOps
Counter totalOps() const override
Count the Total Ops (including micro ops) committed in the CPU.
Definition: cpu.cc:643
gem5::o3::CPU::suspendContext
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
Definition: cpu.cc:693
gem5::o3::Commit::isDrained
bool isDrained() const
Has the stage drained?
Definition: commit.cc:373
gem5::o3::CPU::readArchVecElem
const TheISA::VecElem & readArchVecElem(const RegIndex &reg_idx, const ElemIndex &ldx, ThreadID tid) const
Definition: cpu.cc:1282
gem5::ThreadContext::Suspended
@ Suspended
Temporarily inactive.
Definition: thread_context.hh:112
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:186
gem5::o3::CPU::setVectorsAsReady
void setVectorsAsReady(ThreadID tid)
Mark vector fields in scoreboard as ready right after switching vector mode, since software may read ...
Definition: cpu.cc:836
gem5::o3::Commit::rob
ROB * rob
ROB interface.
Definition: commit.hh:352
ADD_STAT
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition: group.hh:75
gem5::o3::Scoreboard::setReg
void setReg(PhysRegIdPtr phys_reg)
Sets the register as ready.
Definition: scoreboard.hh:105
gem5::o3::CPU::fetch
Fetch fetch
The fetch stage.
Definition: cpu.hh:483
gem5::o3::Commit::microPC
Addr microPC(ThreadID tid)
Reads the micro PC of a specific thread.
Definition: commit.hh:322
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
gem5::BaseCPU::BaseCPUStats::numCycles
statistics::Scalar numCycles
Definition: base.hh:597
gem5::o3::CPU::scheduleThreadExitEvent
void scheduleThreadExitEvent(ThreadID tid)
If a thread is trying to exit and its corresponding trap event has been completed,...
Definition: cpu.cc:1680
gem5::MipsISA::PCState
GenericISA::DelaySlotPCState< 4 > PCState
Definition: pcstate.hh:40
gem5::o3::UnifiedRenameMap::switchFreeList
void switchFreeList(UnifiedFreeList *freeList)
Switch freeList of registers from Full to Elem or vicevers depending on vecMode (vector renaming mode...
Definition: rename_map.cc:129
gem5::ArmISA::v
Bitfield< 28 > v
Definition: misc_types.hh:54
cpu.hh
gem5::o3::Decode::isDrained
bool isDrained() const
Has the stage drained?
Definition: decode.cc:207
gem5::RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:92
gem5::o3::CPU::squashFromTC
void squashFromTC(ThreadID tid)
Initiates a squash of all in-flight instructions for a given thread.
Definition: cpu.cc:1404
gem5::o3::CPU::CPUStats::vecPredRegfileWrites
statistics::Scalar vecPredRegfileWrites
Definition: cpu.hh:699
gem5::o3::CPU::readIntReg
RegVal readIntReg(PhysRegIdPtr phys_reg)
Definition: cpu.cc:1147
process.hh
gem5::o3::CPU::readMiscRegNoEffect
RegVal readMiscRegNoEffect(int misc_reg, ThreadID tid) const
Register accessors.
Definition: cpu.cc:1121
gem5::o3::Commit::resetHtmStartsStops
void resetHtmStartsStops(ThreadID)
Definition: commit.cc:435
gem5::o3::CPU::tcBase
gem5::ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
Definition: cpu.hh:590
gem5::o3::CPU::activateThread
void activateThread(ThreadID tid)
Add Thread to Active Threads List.
Definition: cpu.cc:591
gem5::BaseCPU::regProbePoints
void regProbePoints() override
Register probe points for this object.
Definition: base.cc:340
activity.hh
gem5::o3::CPU::thread
std::vector< ThreadState * > thread
Pointers to all of the threads in the CPU.
Definition: cpu.hh:608
gem5::BaseCPU::CPU_STATE_ON
@ CPU_STATE_ON
Definition: base.hh:514
gem5::o3::Fetch::deactivateThread
void deactivateThread(ThreadID tid)
For priority-based fetch policies, need to keep update priorityList.
Definition: fetch.cc:501
gem5::o3::CPU::setArchVecPredReg
void setArchVecPredReg(int reg_idx, const TheISA::VecPredRegContainer &val, ThreadID tid)
Definition: cpu.cc:1355
gem5::o3::Commit::clearStates
void clearStates(ThreadID tid)
Clear all thread-specific states.
Definition: commit.cc:334
gem5::o3::CPU::CPUStats::ccRegfileReads
statistics::Scalar ccRegfileReads
Definition: cpu.hh:701
gem5::o3::CPU::CPUStats::timesIdled
statistics::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
Definition: cpu.hh:668
gem5::InvalidThreadID
const ThreadID InvalidThreadID
Definition: types.hh:243
gem5::o3::CPU::drain
DrainState drain() override
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses.
Definition: cpu.cc:920
gem5::o3::CPU::wakeCPU
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
Definition: cpu.cc:1593
gem5::BaseCPU
Definition: base.hh:107
gem5::o3::CPU::readVecReg
const TheISA::VecRegContainer & readVecReg(PhysRegIdPtr reg_idx) const
Definition: cpu.cc:1161
gem5::o3::CPU::tickEvent
EventFunctionWrapper tickEvent
The tick event used for scheduling CPU ticks.
Definition: cpu.hh:121
gem5::o3::CPU::switchOut
void switchOut() override
Switches out this CPU.
Definition: cpu.cc:1077
gem5::ArmISA::VecRegContainer
gem5::VecRegContainer< NumVecElemPerVecReg *sizeof(VecElem)> VecRegContainer
Definition: vec.hh:62
gem5::o3::CPU::Idle
@ Idle
Definition: cpu.hh:106
gem5::DrainState::Drained
@ Drained
Buffers drained, ready for serialization/handover.
gem5::System::isTimingMode
bool isTimingMode() const
Is the system in timing mode?
Definition: system.hh:276
gem5::ThreadContext::pcState
virtual TheISA::PCState pcState() const =0
gem5::o3::CPU::setMiscRegNoEffect
void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid)
Sets a miscellaneous register.
Definition: cpu.cc:1134
gem5::o3::CPU::renameQueue
TimeBuffer< RenameStruct > renameQueue
The rename stage's instruction queue.
Definition: cpu.hh:555
gem5::ArmISA::t
Bitfield< 5 > t
Definition: misc_types.hh:70
std::pair
STL pair class.
Definition: stl.hh:58
gem5::o3::CPU::rob
ROB rob
The re-order buffer.
Definition: cpu.hh:513
gem5::statistics::DataWrap::precision
Derived & precision(int _precision)
Set the precision and marks this stat to print at the end of simulation.
Definition: statistics.hh:343
gem5::o3::IEW::tick
void tick()
Ticks IEW stage, causing Dispatch, the IQ, the LSQ, Execute, and Writeback to run for one cycle.
Definition: iew.cc:1433
gem5::o3::Fetch::tick
void tick()
Ticks the fetch stage, processing all inputs signals and fetching as many instructions as possible.
Definition: fetch.cc:840
gem5::o3::CPU::Running
@ Running
Definition: cpu.hh:105
gem5::BaseCPU::probeInstCommit
virtual void probeInstCommit(const StaticInstPtr &inst, Addr pc)
Helper method to trigger PMU probes for a committed instruction.
Definition: base.cc:356
gem5::o3::CPU::CPUStats::vecRegfileWrites
statistics::Scalar vecRegfileWrites
Definition: cpu.hh:696
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::o3::CPU::CPUStats::vecRegfileReads
statistics::Scalar vecRegfileReads
Definition: cpu.hh:695
gem5::o3::Commit::instAddr
Addr instAddr(ThreadID tid)
Returns the PC of a specific thread.
Definition: commit.hh:316
gem5::o3::CPU::CPUStats::committedOps
statistics::Vector committedOps
Stat for the number of committed ops (including micro ops) per thread.
Definition: cpu.hh:678
gem5::ElemIndex
uint16_t ElemIndex
Logical vector register elem index type.
Definition: types.hh:179
name
const std::string & name()
Definition: trace.cc:49
gem5::o3::CPU::instAddr
Addr instAddr(ThreadID tid)
Reads the commit PC of a specific thread.
Definition: cpu.cc:1386
gem5::o3::UnifiedFreeList::getCCReg
PhysRegIdPtr getCCReg()
Gets a free cc register.
Definition: free_list.hh:197
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::EventManager::deschedule
void deschedule(Event &event)
Definition: eventq.hh:1028
full_system.hh
gem5::o3::CPU::getWritableArchVecReg
TheISA::VecRegContainer & getWritableArchVecReg(int reg_idx, ThreadID tid)
Read architectural vector register for modification.
Definition: cpu.cc:1274
gem5::ActivityRecorder::activity
void activity()
Records that there is activity this cycle.
Definition: activity.cc:55
gem5::o3::CPU::setFloatReg
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
Definition: cpu.cc:1210
gem5::o3::CPU::setVecPredReg
void setVecPredReg(PhysRegIdPtr reg_idx, const TheISA::VecPredRegContainer &val)
Definition: cpu.cc:1231
gem5::o3::Fetch::startupStage
void startupStage()
Initialize stage.
Definition: fetch.cc:288
gem5::BaseCPU::CPU_STATE_SLEEP
@ CPU_STATE_SLEEP
Definition: base.hh:515
gem5::ProbePointArg
ProbePointArg generates a point for the class of Arg.
Definition: thermal_domain.hh:54
gem5::o3::CPU::regProbePoints
void regProbePoints() override
Register probe points.
Definition: cpu.cc:357
gem5::o3::CPU::system
System * system
Pointer to the system.
Definition: cpu.hh:605
gem5::Drainable::signalDrainDone
void signalDrainDone() const
Signal that an object is drained.
Definition: drain.hh:305
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
gem5::FullSystem
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:223
gem5::ActivityRecorder::reset
void reset()
Clears the time buffer and the activity count.
Definition: activity.cc:125
gem5::SimObject::getProbeManager
ProbeManager * getProbeManager()
Get the probe manager for this object.
Definition: sim_object.cc:120
gem5::o3::CPU::lastRunningCycle
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
Definition: cpu.hh:614
gem5::o3::CPU::updateThreadPriority
void updateThreadPriority()
Update The Order In Which We Process Threads.
Definition: cpu.cc:1639
gem5::o3::MaxThreads
static constexpr int MaxThreads
Definition: limits.hh:38
gem5::o3::CPU::getWritableArchVecPredReg
TheISA::VecPredRegContainer & getWritableArchVecPredReg(int reg_idx, ThreadID tid)
Definition: cpu.cc:1299
stat_control.hh
warn_if
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
Definition: logging.hh:272
gem5::VecRegClass
@ VecRegClass
Vector Register.
Definition: reg_class.hh:60
gem5::o3::CPU::CPUStats::ipc
statistics::Formula ipc
Stat for the IPC per thread.
Definition: cpu.hh:684
gem5::o3::CPU::rename
Rename rename
The dispatch stage.
Definition: cpu.hh:489
gem5::o3::CPU::fetchQueue
TimeBuffer< FetchStruct > fetchQueue
The fetch stage's instruction queue.
Definition: cpu.hh:549
simple_thread.hh
gem5::o3::CPU::takeOverFrom
void takeOverFrom(BaseCPU *oldCPU) override
Takes over from another CPU.
Definition: cpu.cc:1091
gem5::BaseCPU::threadContexts
std::vector< ThreadContext * > threadContexts
Definition: base.hh:262
gem5::o3::UnifiedFreeList::getFloatReg
PhysRegIdPtr getFloatReg()
Gets a free fp register.
Definition: free_list.hh:185
gem5::o3::CPU::iew
IEW iew
The issue/execute/writeback stages.
Definition: cpu.hh:492
gem5::o3::CPU::removeInstsNotInROB
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
Definition: cpu.cc:1451
gem5::o3::IEW::drainSanityCheck
void drainSanityCheck() const
Perform sanity checks after a drain.
Definition: iew.cc:383
gem5::o3::CPU::exitThreads
void exitThreads()
Terminate all threads that are ready to exit.
Definition: cpu.cc:1700
gem5::o3::CPU::lastActivatedCycle
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
Definition: cpu.hh:617
gem5::o3::Commit::drainResume
void drainResume()
Resumes execution after draining.
Definition: commit.cc:351
gem5::BaseCPU::takeOverFrom
virtual void takeOverFrom(BaseCPU *cpu)
Load the state of a CPU from the previous CPU object, invoked on all new CPUs that are about to be sw...
Definition: base.cc:554
gem5::BaseCPU::activateContext
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
Definition: base.cc:488
gem5::o3::Commit::executingHtmTransaction
bool executingHtmTransaction(ThreadID) const
Is the CPU currently processing a HTM transaction?
Definition: commit.cc:426
gem5::statistics::DataWrap::prereq
Derived & prereq(const Stat &prereq)
Set the prerequisite stat and marks this stat to print at the end of simulation.
Definition: statistics.hh:369
gem5::o3::CPU::commitDrained
void commitDrained(ThreadID tid)
Commit has reached a safe point to drain a thread.
Definition: cpu.cc:1045
gem5::System::threads
Threads threads
Definition: system.hh:316
gem5::ArmISA::VecElem
uint32_t VecElem
Definition: vec.hh:60
gem5::pseudo_inst::quiesceCycles
void quiesceCycles(ThreadContext *tc, uint64_t cycles)
Definition: pseudo_inst.cc:136
gem5::o3::CPU::switchRenameMode
void switchRenameMode(ThreadID tid, UnifiedFreeList *freelist)
Check if a change in renaming is needed for vector registers.
Definition: cpu.cc:859
gem5::o3::Fetch::takeOverFrom
void takeOverFrom()
Takes over from another CPU's thread.
Definition: fetch.cc:451
gem5::o3::CPU::microPC
MicroPC microPC(ThreadID tid)
Reads the commit micro PC of a specific thread.
Definition: cpu.cc:1398
gem5::o3::PhysRegFile::readVecPredReg
const TheISA::VecPredRegContainer & readVecPredReg(PhysRegIdPtr phys_reg) const
Reads a predicate register.
Definition: regfile.hh:244
gem5::o3::CPU::commitRenameMap
UnifiedRenameMap commitRenameMap[MaxThreads]
The commit rename map.
Definition: cpu.hh:510
gem5::o3::CPU::trap
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
Traps to handle given fault.
Definition: cpu.cc:901
gem5::o3::CPU::drainResume
void drainResume() override
Resumes execution after a drain.
Definition: cpu.cc:1048
gem5::o3::CPU::getFreeTid
ThreadID getFreeTid()
Gets a free thread id.
Definition: cpu.cc:1626
gem5::o3::CPU::addInst
ListIt addInst(const DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
Definition: cpu.cc:1411
gem5::o3::ROB::isEmpty
bool isEmpty() const
Returns if the ROB is empty.
Definition: rob.hh:195
gem5::o3::CPU::isThreadExiting
bool isThreadExiting(ThreadID tid) const
Is the thread trying to exit?
Definition: cpu.cc:1674
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::o3::Decode::drainSanityCheck
void drainSanityCheck() const
Perform sanity checks after a drain.
Definition: decode.cc:198
gem5::o3::CPU::threadExitEvent
EventFunctionWrapper threadExitEvent
The exit event used for terminating all ready-to-exit threads.
Definition: cpu.hh:124
gem5::o3::UnifiedRenameMap::lookup
PhysRegIdPtr lookup(const RegId &arch_reg) const
Look up the physical register mapped to an architectural register.
Definition: rename_map.hh:266
gem5::statistics::Counter
double Counter
All counters are of 64-bit values.
Definition: types.hh:47
gem5::BaseCPU::switchOut
virtual void switchOut()
Prepare for another CPU to take over execution.
Definition: base.cc:540
gem5::o3::Commit::pcState
TheISA::PCState pcState(ThreadID tid)
Reads the PC of a specific thread.
Definition: commit.hh:309
gem5::statistics::Group
Statistics container.
Definition: group.hh:93
gem5::o3::CPU::readMiscReg
RegVal readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
Definition: cpu.cc:1127
gem5::InstSeqNum
uint64_t InstSeqNum
Definition: inst_seq.hh:40
gem5::PhysRegId
Physical register ID.
Definition: reg_class.hh:198
gem5::o3::PhysRegFile::setFloatReg
void setFloatReg(PhysRegIdPtr phys_reg, RegVal val)
Definition: regfile.hh:290
gem5::o3::Rename::startupStage
void startupStage()
Initializes variables for the stage.
Definition: rename.cc:221
thread_context.hh
gem5::o3::PhysRegFile::setIntReg
void setIntReg(PhysRegIdPtr phys_reg, RegVal val)
Sets an integer register to the given value.
Definition: regfile.hh:278
gem5::CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:66
gem5::o3::CPU::SwitchedOut
@ SwitchedOut
Definition: cpu.hh:109
gem5::o3::CPU::exitingThreads
std::unordered_map< ThreadID, bool > exitingThreads
This is a list of threads that are trying to exit.
Definition: cpu.hh:523
gem5::o3::CPU::CPUStats::fpRegfileReads
statistics::Scalar fpRegfileReads
Definition: cpu.hh:692
gem5::o3::CPU::readArchIntReg
RegVal readArchIntReg(int reg_idx, ThreadID tid)
Definition: cpu.cc:1246
gem5::o3::Fetch::regProbePoints
void regProbePoints()
Registers probes.
Definition: fetch.cc:153
gem5::RiscvISA::sum
Bitfield< 18 > sum
Definition: misc.hh:545
gem5::o3::LSQ::getDataPort
RequestPort & getDataPort()
Definition: lsq.hh:1010
gem5::ActivityRecorder::active
bool active()
Returns if the CPU should be active.
Definition: activity.hh:91
gem5::o3::Commit::tick
void tick()
Ticks the commit stage, which tries to commit instructions.
Definition: commit.cc:629
gem5::o3::Rename::regProbePoints
void regProbePoints()
Registers probes.
Definition: rename.cc:179
gem5::statistics::DataWrap::flags
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
Definition: statistics.hh:355
gem5::o3::CPU::scoreboard
Scoreboard scoreboard
Integer Register Scoreboard.
Definition: cpu.hh:526
gem5::DrainState::Running
@ Running
Running normally.
gem5::o3::IEW::ldstQueue
LSQ ldstQueue
Load / store queue.
Definition: iew.hh:358
gem5::RegIndex
uint16_t RegIndex
Definition: types.hh:176
gem5::o3::CPU::commit
Commit commit
The commit stage.
Definition: cpu.hh:495
cpu.hh
std::list
STL list class.
Definition: stl.hh:51
gem5::o3::CPU::haltContext
void haltContext(ThreadID tid) override
Remove Thread from Active Threads List && Remove Thread Context from CPU.
Definition: cpu.cc:713
gem5::EventBase::CPU_Tick_Pri
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Definition: eventq.hh:204
gem5::o3::PhysRegFile::setVecReg
void setVecReg(PhysRegIdPtr phys_reg, const TheISA::VecRegContainer &val)
Sets a vector register to the given value.
Definition: regfile.hh:302
gem5::o3::CPU::activityRec
ActivityRecorder activityRec
The activity recorder; used to tell if the CPU has any activity remaining or if it can go to idle and...
Definition: cpu.hh:565
gem5::o3::CPU::pcState
void pcState(const TheISA::PCState &newPCState, ThreadID tid)
Sets the commit PC state of a specific thread.
Definition: cpu.cc:1380
fatal_if
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Definition: logging.hh:225
gem5::IntRegClass
@ IntRegClass
Integer register.
Definition: reg_class.hh:57
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::o3::Decode::startupStage
void startupStage()
Definition: decode.cc:92
gem5::o3::CPU::readVecPredReg
const TheISA::VecPredRegContainer & readVecPredReg(PhysRegIdPtr reg_idx) const
Definition: cpu.cc:1182
gem5::Packet::createRead
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
Definition: packet.hh:1007
gem5::statistics::total
const FlagsType total
Print the total.
Definition: info.hh:60
thread_context.hh
limits.hh
gem5::o3::CPU::activateContext
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
Definition: cpu.cc:655
gem5::statistics::VectorBase::init
Derived & init(size_type size)
Set this vector to have the given size.
Definition: statistics.hh:1034
gem5::o3::Rename::takeOverFrom
void takeOverFrom()
Takes over from another CPU's thread.
Definition: rename.cc:319
gem5::o3::UnifiedFreeList::getIntReg
PhysRegIdPtr getIntReg()
Gets a free integer register.
Definition: free_list.hh:182
gem5::o3::CPU::nextInstAddr
Addr nextInstAddr(ThreadID tid)
Reads the next PC of a specific thread.
Definition: cpu.cc:1392
gem5::o3::CPU::tick
void tick()
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should d...
Definition: cpu.cc:501
gem5::o3::PhysRegFile::readCCReg
RegVal readCCReg(PhysRegIdPtr phys_reg)
Reads a condition-code register.
Definition: regfile.hh:265
gem5::o3::CPU::startup
void startup() override
startup() is the final initialization call before simulation.
Definition: cpu.cc:579
gem5::o3::CPU::CPUStats::CPUStats
CPUStats(CPU *cpu)
Definition: cpu.cc:373
thread_context.hh
gem5::o3::CPU::isa
std::vector< TheISA::ISA * > isa
Definition: cpu.hh:528
gem5::o3::Commit::drainSanityCheck
void drainSanityCheck() const
Perform sanity checks after a drain.
Definition: commit.cc:358
gem5::DrainState::Draining
@ Draining
Draining buffers pending serialization/handover.
gem5::o3::CPU::instDone
void instDone(ThreadID tid, const DynInstPtr &inst)
Function to tell the CPU that an instruction has completed.
Definition: cpu.cc:1419
gem5::Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:465
gem5::ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:242
gem5::o3::Commit::nextInstAddr
Addr nextInstAddr(ThreadID tid)
Returns the next PC of a specific thread.
Definition: commit.hh:319
gem5::o3::CPU::init
void init() override
Initialize the CPU.
Definition: cpu.cc:559
gem5::RegId
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:88
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:177
gem5::o3::UnifiedRenameMap::setEntry
void setEntry(const RegId &arch_reg, PhysRegIdPtr phys_reg)
Update rename map with a specific mapping.
Definition: rename_map.hh:309
gem5::o3::CPU::removeFrontInst
void removeFrontInst(const DynInstPtr &inst)
Remove an instruction from the front end of the list.
Definition: cpu.cc:1438
gem5::ArmISA::status
Bitfield< 5, 0 > status
Definition: misc_types.hh:422
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84
gem5::o3::CPU::readArchVecReg
const TheISA::VecRegContainer & readArchVecReg(int reg_idx, ThreadID tid) const
Definition: cpu.cc:1266
gem5::o3::IEW::regProbePoints
void regProbePoints()
Registers probes.
Definition: iew.cc:125
gem5::o3::InstructionQueue::getCount
unsigned getCount(ThreadID tid)
Returns the number of used entries for a thread.
Definition: inst_queue.hh:274

Generated on Wed Jul 28 2021 12:10:19 for gem5 by doxygen 1.8.17