gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cpu.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2013, 2016-2019 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-2005 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  * Authors: Kevin Lim
43  * Korey Sewell
44  * Rick Strong
45  */
46 
47 #ifndef __CPU_O3_CPU_HH__
48 #define __CPU_O3_CPU_HH__
49 
50 #include <iostream>
51 #include <list>
52 #include <queue>
53 #include <set>
54 #include <vector>
55 
56 #include "arch/generic/types.hh"
57 #include "arch/types.hh"
58 #include "base/statistics.hh"
59 #include "config/the_isa.hh"
60 #include "cpu/o3/comm.hh"
61 #include "cpu/o3/cpu_policy.hh"
62 #include "cpu/o3/scoreboard.hh"
63 #include "cpu/o3/thread_state.hh"
64 #include "cpu/activity.hh"
65 #include "cpu/base.hh"
66 #include "cpu/simple_thread.hh"
67 #include "cpu/timebuf.hh"
68 //#include "cpu/o3/thread_context.hh"
69 #include "params/DerivO3CPU.hh"
70 #include "sim/process.hh"
71 
72 template <class>
73 class Checker;
74 class ThreadContext;
75 template <class>
77 
78 class Checkpoint;
79 class Process;
80 
81 struct BaseCPUParams;
82 
83 class BaseO3CPU : public BaseCPU
84 {
85  //Stuff that's pretty ISA independent will go here.
86  public:
87  BaseO3CPU(BaseCPUParams *params);
88 
89  void regStats();
90 };
91 
97 template <class Impl>
98 class FullO3CPU : public BaseO3CPU
99 {
100  public:
101  // Typedefs from the Impl here.
102  typedef typename Impl::CPUPol CPUPolicy;
103  typedef typename Impl::DynInstPtr DynInstPtr;
104  typedef typename Impl::O3CPU O3CPU;
105 
108 
110 
113 
115 
116  friend class O3ThreadContext<Impl>;
117 
118  public:
119  enum Status {
124  SwitchedOut
125  };
126 
130 
133 
134  private:
135 
138 
141 
144  {
145  if (tickEvent.squashed())
146  reschedule(tickEvent, clockEdge(delay));
147  else if (!tickEvent.scheduled())
148  schedule(tickEvent, clockEdge(delay));
149  }
150 
153  {
154  if (tickEvent.scheduled())
155  tickEvent.squash();
156  }
157 
169  bool tryDrain();
170 
180  void drainSanityCheck() const;
181 
183  bool isCpuDrained() const;
184 
185  public:
187  FullO3CPU(DerivO3CPUParams *params);
189  ~FullO3CPU();
190 
192  void regStats() override;
193 
196 
198  void regProbePoints() override;
199 
200  void demapPage(Addr vaddr, uint64_t asn)
201  {
202  this->itb->demapPage(vaddr, asn);
203  this->dtb->demapPage(vaddr, asn);
204  }
205 
206  void demapInstPage(Addr vaddr, uint64_t asn)
207  {
208  this->itb->demapPage(vaddr, asn);
209  }
210 
211  void demapDataPage(Addr vaddr, uint64_t asn)
212  {
213  this->dtb->demapPage(vaddr, asn);
214  }
215 
219  void tick();
220 
222  void init() override;
223 
224  void startup() override;
225 
228  { return activeThreads.size(); }
229 
231  void activateThread(ThreadID tid);
232 
234  void deactivateThread(ThreadID tid);
235 
237  void insertThread(ThreadID tid);
238 
240  void removeThread(ThreadID tid);
241 
243  Counter totalInsts() const override;
244 
246  Counter totalOps() const override;
247 
249  void activateContext(ThreadID tid) override;
250 
252  void suspendContext(ThreadID tid) override;
253 
257  void haltContext(ThreadID tid) override;
258 
260  void updateThreadPriority();
261 
263  bool isDraining() const { return drainState() == DrainState::Draining; }
264 
265  void serializeThread(CheckpointOut &cp, ThreadID tid) const override;
266  void unserializeThread(CheckpointIn &cp, ThreadID tid) override;
267 
269  void addThreadToExitingList(ThreadID tid);
270 
272  bool isThreadExiting(ThreadID tid) const;
273 
278  void scheduleThreadExitEvent(ThreadID tid);
279 
281  void exitThreads();
282 
283  public:
287  void syscall(ThreadID tid, Fault *fault);
288 
291  DrainState drain() override;
292 
294  void drainResume() override;
295 
303  void commitDrained(ThreadID tid);
304 
306  void switchOut() override;
307 
309  void takeOverFrom(BaseCPU *oldCPU) override;
310 
311  void verifyMemoryMode() const override;
312 
315  { return globalSeqNum++; }
316 
318  void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst);
319 
326  void switchRenameMode(ThreadID tid, UnifiedFreeList* freelist);
327 
329  Fault getInterrupts();
330 
332  void processInterrupts(const Fault &interrupt);
333 
335  void halt() { panic("Halt not implemented!\n"); }
336 
340  RegVal readMiscRegNoEffect(int misc_reg, ThreadID tid) const;
341 
345  RegVal readMiscReg(int misc_reg, ThreadID tid);
346 
348  void setMiscRegNoEffect(int misc_reg, RegVal val, ThreadID tid);
349 
353  void setMiscReg(int misc_reg, RegVal val, ThreadID tid);
354 
355  RegVal readIntReg(PhysRegIdPtr phys_reg);
356 
357  RegVal readFloatReg(PhysRegIdPtr phys_reg);
358 
359  const VecRegContainer& readVecReg(PhysRegIdPtr reg_idx) const;
360 
365 
367  Enums::VecRegRenameMode vecRenameMode() const { return vecMode; }
368 
370  void vecRenameMode(Enums::VecRegRenameMode vec_mode)
371  { vecMode = vec_mode; }
372 
376  template<typename VecElem, int LaneIdx>
378  readVecLane(PhysRegIdPtr phys_reg) const
379  {
380  vecRegfileReads++;
381  return regFile.readVecLane<VecElem, LaneIdx>(phys_reg);
382  }
383 
387  template<typename VecElem>
389  readVecLane(PhysRegIdPtr phys_reg) const
390  {
391  vecRegfileReads++;
392  return regFile.readVecLane<VecElem>(phys_reg);
393  }
394 
396  template<typename LD>
397  void
398  setVecLane(PhysRegIdPtr phys_reg, const LD& val)
399  {
400  vecRegfileWrites++;
401  return regFile.setVecLane(phys_reg, val);
402  }
403 
404  const VecElem& readVecElem(PhysRegIdPtr reg_idx) const;
405 
406  const VecPredRegContainer& readVecPredReg(PhysRegIdPtr reg_idx) const;
407 
409 
410  RegVal readCCReg(PhysRegIdPtr phys_reg);
411 
412  void setIntReg(PhysRegIdPtr phys_reg, RegVal val);
413 
414  void setFloatReg(PhysRegIdPtr phys_reg, RegVal val);
415 
416  void setVecReg(PhysRegIdPtr reg_idx, const VecRegContainer& val);
417 
418  void setVecElem(PhysRegIdPtr reg_idx, const VecElem& val);
419 
420  void setVecPredReg(PhysRegIdPtr reg_idx, const VecPredRegContainer& val);
421 
422  void setCCReg(PhysRegIdPtr phys_reg, RegVal val);
423 
424  RegVal readArchIntReg(int reg_idx, ThreadID tid);
425 
426  RegVal readArchFloatReg(int reg_idx, ThreadID tid);
427 
428  const VecRegContainer& readArchVecReg(int reg_idx, ThreadID tid) const;
430  VecRegContainer& getWritableArchVecReg(int reg_idx, ThreadID tid);
431 
433  template<typename VecElem>
435  readArchVecLane(int reg_idx, int lId, ThreadID tid) const
436  {
437  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
438  RegId(VecRegClass, reg_idx));
439  return readVecLane<VecElem>(phys_reg);
440  }
441 
442 
444  template<typename LD>
445  void
446  setArchVecLane(int reg_idx, int lId, ThreadID tid, const LD& val)
447  {
448  PhysRegIdPtr phys_reg = commitRenameMap[tid].lookup(
449  RegId(VecRegClass, reg_idx));
450  setVecLane(phys_reg, val);
451  }
452 
453  const VecElem& readArchVecElem(const RegIndex& reg_idx,
454  const ElemIndex& ldx, ThreadID tid) const;
455 
456  const VecPredRegContainer& readArchVecPredReg(int reg_idx,
457  ThreadID tid) const;
458 
459  VecPredRegContainer& getWritableArchVecPredReg(int reg_idx, ThreadID tid);
460 
461  RegVal readArchCCReg(int reg_idx, ThreadID tid);
462 
468  void setArchIntReg(int reg_idx, RegVal val, ThreadID tid);
469 
470  void setArchFloatReg(int reg_idx, RegVal val, ThreadID tid);
471 
472  void setArchVecPredReg(int reg_idx, const VecPredRegContainer& val,
473  ThreadID tid);
474 
475  void setArchVecReg(int reg_idx, const VecRegContainer& val, ThreadID tid);
476 
477  void setArchVecElem(const RegIndex& reg_idx, const ElemIndex& ldx,
478  const VecElem& val, ThreadID tid);
479 
480  void setArchCCReg(int reg_idx, RegVal val, ThreadID tid);
481 
483  void pcState(const TheISA::PCState &newPCState, ThreadID tid);
484 
487 
489  Addr instAddr(ThreadID tid);
490 
492  MicroPC microPC(ThreadID tid);
493 
496 
501  void squashFromTC(ThreadID tid);
502 
506  ListIt addInst(const DynInstPtr &inst);
507 
509  void instDone(ThreadID tid, const DynInstPtr &inst);
510 
514  void removeFrontInst(const DynInstPtr &inst);
515 
518  void removeInstsNotInROB(ThreadID tid);
519 
521  void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid);
522 
524  inline void squashInstIt(const ListIt &instIt, ThreadID tid);
525 
527  void cleanUpRemovedInsts();
528 
530  void dumpInsts();
531 
532  public:
533 #ifndef NDEBUG
534 
536 #endif
537 
540 
544  std::queue<ListIt> removeList;
545 
546 #ifdef DEBUG
547 
550  std::set<InstSeqNum> snList;
551 #endif
552 
557 
558  protected:
560  typename CPUPolicy::Fetch fetch;
561 
563  typename CPUPolicy::Decode decode;
564 
566  typename CPUPolicy::Rename rename;
567 
569  typename CPUPolicy::IEW iew;
570 
572  typename CPUPolicy::Commit commit;
573 
575  Enums::VecRegRenameMode vecMode;
576 
579 
581  typename CPUPolicy::FreeList freeList;
582 
584  typename CPUPolicy::RenameMap renameMap[Impl::MaxThreads];
585 
587  typename CPUPolicy::RenameMap commitRenameMap[Impl::MaxThreads];
588 
590  typename CPUPolicy::ROB rob;
591 
594 
600  std::unordered_map<ThreadID, bool> exitingThreads;
601 
604 
606 
607  public:
612  enum StageIdx {
618  NumStages };
619 
623  typedef typename CPUPolicy::TimeStruct TimeStruct;
624 
625  typedef typename CPUPolicy::FetchStruct FetchStruct;
626 
627  typedef typename CPUPolicy::DecodeStruct DecodeStruct;
628 
629  typedef typename CPUPolicy::RenameStruct RenameStruct;
630 
631  typedef typename CPUPolicy::IEWStruct IEWStruct;
632 
635 
638 
641 
644 
647 
648  private:
654 
655  public:
657  void activityThisCycle() { activityRec.activity(); }
658 
660  void activateStage(const StageIdx idx)
661  { activityRec.activateStage(idx); }
662 
664  void deactivateStage(const StageIdx idx)
665  { activityRec.deactivateStage(idx); }
666 
668  void wakeCPU();
669 
670  virtual void wakeup(ThreadID tid) override;
671 
673  ThreadID getFreeTid();
674 
675  public:
677  ThreadContext *
679  {
680  return thread[tid]->getTC();
681  }
682 
684  InstSeqNum globalSeqNum;//[Impl::MaxThreads];
685 
691 
694 
697 
700 
703 
706 
708  std::map<ThreadID, unsigned> threadMap;
709 
712 
714  Fault pushRequest(const DynInstPtr& inst, bool isLoad, uint8_t *data,
715  unsigned int size, Addr addr, Request::Flags flags,
716  uint64_t *res, AtomicOpFunctorPtr amo_op = nullptr,
717  const std::vector<bool>& byte_enable =
719 
720  {
721  return iew.ldstQueue.pushRequest(inst, isLoad, data, size, addr,
722  flags, res, std::move(amo_op), byte_enable);
723  }
724 
726  Fault read(LSQRequest* req, int load_idx)
727  {
728  return this->iew.ldstQueue.read(req, load_idx);
729  }
730 
732  Fault write(LSQRequest* req, uint8_t *data, int store_idx)
733  {
734  return this->iew.ldstQueue.write(req, data, store_idx);
735  }
736 
738  Port &
739  getInstPort() override
740  {
741  return this->fetch.getInstPort();
742  }
743 
745  Port &
746  getDataPort() override
747  {
748  return this->iew.ldstQueue.getDataPort();
749  }
750 
770 
771  //number of integer register file accesses
774  //number of float register file accesses
777  //number of vector register file accesses
780  //number of predicate register file accesses
783  //number of CC register file accesses
786  //number of misc
789 };
790 
791 #endif // __CPU_O3_CPU_HH__
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:167
RegVal readMiscReg(RegIndex misc_reg) override
Reads a misc.
virtual void unserializeThread(CheckpointIn &cp, ThreadID tid)
Unserialize one thread.
Definition: base.hh:431
std::vector< ThreadID > tids
Available thread ids in the cpu.
Definition: cpu.hh:711
Stats::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
Definition: cpu.hh:752
Ports are used to interface objects to each other.
Definition: port.hh:60
void demapDataPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:211
bool removeInstsThisCycle
Records if instructions need to be removed this cycle due to being retired or squashed.
Definition: cpu.hh:556
const VecPredRegContainer & readVecPredReg(const RegId &id) const override
Fault write(LSQRequest *req, uint8_t *data, int store_idx)
CPU write function, forwards write to LSQ.
Definition: cpu.hh:732
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
VecLaneT< VecElem, true > readVecLane(PhysRegIdPtr phys_reg) const
Read physical vector register lane.
Definition: cpu.hh:389
std::unordered_map< ThreadID, bool > exitingThreads
This is a list of threads that are trying to exit.
Definition: cpu.hh:600
void setArchVecLane(int reg_idx, int lId, ThreadID tid, const LD &val)
Write a lane of the destination vector register.
Definition: cpu.hh:446
void demapInstPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:206
Class that has various thread state, such as the status, the current instruction being processed...
Definition: commit.hh:59
System * system
Pointer to the system.
Definition: cpu.hh:693
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
Definition: cpu.hh:143
std::vector< Thread * > thread
Pointers to all of the threads in the CPU.
Definition: cpu.hh:696
DrainState
Object drain/handover states.
Definition: drain.hh:71
Port & getInstPort() override
Used by the fetch unit to get a hold of the instruction port.
Definition: cpu.hh:739
Running normally.
Vector Register Abstraction This generic class is the model in a particularization of MVC...
Definition: vec_reg.hh:160
Simple physical register file class.
Definition: regfile.hh:63
Stats::Formula ipc
Stat for the IPC per thread.
Definition: cpu.hh:767
Stats::Scalar intRegfileReads
Definition: cpu.hh:772
CPUPolicy::FetchStruct FetchStruct
Definition: cpu.hh:625
TheISA::VecElem VecElem
Definition: cpu.hh:106
bool isDraining() const
Is the CPU draining?
Definition: cpu.hh:263
Stats::Scalar vecPredRegfileWrites
Definition: cpu.hh:782
void setIntReg(RegIndex reg_idx, RegVal val) override
Sets an integer register to a value.
ip6_addr_t addr
Definition: inet.hh:335
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Definition: amo.hh:230
Fault read(LSQRequest *req, int load_idx)
CPU read function, forwards read to LSQ.
Definition: cpu.hh:726
Stats::Vector committedInsts
Stat for the number of committed instructions per thread.
Definition: cpu.hh:759
Stats::Scalar vecRegfileReads
Definition: cpu.hh:778
Status _status
Overall CPU status.
Definition: cpu.hh:132
CPUPolicy::Decode decode
The decode stage.
Definition: cpu.hh:563
DrainState drainState() const
Return the current drain state of an object.
Definition: drain.hh:282
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
Definition: base.cc:491
void activity()
Records that there is activity this cycle.
Definition: activity.cc:56
BaseO3CPU(BaseCPUParams *params)
Definition: cpu.cc:82
RegVal readFloatReg(RegIndex reg_idx) const override
CPUPolicy::FreeList freeList
The free list.
Definition: cpu.hh:581
uint64_t RegVal
Definition: types.hh:168
Stats::Scalar miscRegfileReads
Definition: cpu.hh:787
EventFunctionWrapper threadExitEvent
The exit event used for terminating all ready-to-exit threads.
Definition: cpu.hh:140
Definition: system.hh:77
A vector of scalar stats.
Definition: statistics.hh:2550
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
Definition: cpu.hh:195
void setVecLane(PhysRegIdPtr phys_reg, const LD &val)
Write a lane of the destination vector register.
Definition: cpu.hh:398
Stats::Vector committedOps
Stat for the number of committed ops (including micro ops) per thread.
Definition: cpu.hh:761
Definition: cprintf.cc:42
BaseTLB * itb
Definition: cpu.hh:127
void setCCReg(RegIndex reg_idx, RegVal val) override
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Declaration of Statistics objects.
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
Definition: cpu.hh:634
CPUPolicy::Fetch fetch
The fetch stage.
Definition: cpu.hh:560
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2508
CPUPolicy::ROB rob
The re-order buffer.
Definition: cpu.hh:590
STL vector class.
Definition: stl.hh:40
void setVecLane(const RegId &reg, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector register.
Bitfield< 63 > val
Definition: misc.hh:771
Templated Checker class.
Definition: cpu.hh:622
bool squashed() const
Check whether the event is squashed.
Definition: eventq.hh:391
void deactivateStage(const int idx)
Deactivates a stage.
Definition: activity.cc:109
void setMiscReg(RegIndex misc_reg, RegVal val) override
Sets a misc.
std::map< ThreadID, unsigned > threadMap
Mapping for system thread id to cpu id.
Definition: cpu.hh:708
RegVal readCCReg(RegIndex reg_idx) const override
int numActiveThreads()
Returns the Number of Active Threads in the CPU.
Definition: cpu.hh:227
Impl::CPUPol CPUPolicy
Definition: cpu.hh:102
Stats::Formula totalCpi
Stat for the total CPI.
Definition: cpu.hh:765
virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const
Serialize a single thread.
Definition: base.hh:423
virtual Counter totalInsts() const =0
void setFloatReg(RegIndex reg_idx, RegVal val) override
Definition: tlb.hh:52
Implements a simple scoreboard to track which registers are ready.
Definition: scoreboard.hh:52
Definition: cpu.hh:83
std::list< ThreadID > activeThreads
Active Threads List.
Definition: cpu.hh:593
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:385
uint16_t RegIndex
Definition: types.hh:42
Port & getDataPort() override
Get the dcache port (used to find block size for translations).
Definition: cpu.hh:746
CPUPolicy::RenameStruct RenameStruct
Definition: cpu.hh:629
Enums::VecRegRenameMode vecRenameMode() const
Returns current vector renaming mode.
Definition: cpu.hh:367
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:559
::DummyVecPredRegContainer VecPredRegContainer
Definition: registers.hh:60
uint64_t Tick
Tick count type.
Definition: types.hh:63
Addr instAddr() const override
Reads this thread&#39;s PC.
::DummyVecRegContainer VecRegContainer
Definition: registers.hh:53
Stats::Scalar miscRegfileWrites
Definition: cpu.hh:788
Stats::Scalar intRegfileWrites
Definition: cpu.hh:773
typename LSQ< O3CPUImpl >::LSQRequest LSQRequest
Definition: cpu.hh:129
void activateStage(const int idx)
Marks a stage as active.
Definition: activity.cc:92
CPUPolicy::Commit commit
The commit stage.
Definition: cpu.hh:572
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
Definition: cpu.hh:702
TheISA::PCState pcState() const override
Reads this thread&#39;s PC state.
void startup() override
startup() is the final initialization call before simulation.
Definition: base.cc:324
ActivityRecorder helper class that informs the CPU if it can switch over to being idle or not...
Definition: activity.hh:52
CPUPolicy::DecodeStruct DecodeStruct
Definition: cpu.hh:627
ProbePointArg< PacketPtr > * ppInstAccessComplete
Definition: cpu.hh:194
TimeBuffer< DecodeStruct > decodeQueue
The decode stage&#39;s instruction queue.
Definition: cpu.hh:640
EventFunctionWrapper tickEvent
The tick event used for scheduling CPU ticks.
Definition: cpu.hh:137
const VecRegContainer & readVecReg(const RegId &id) const override
uint16_t MicroPC
Definition: types.hh:144
uint64_t InstSeqNum
Definition: inst_seq.hh:40
TimeBuffer< FetchStruct > fetchQueue
The fetch stage&#39;s instruction queue.
Definition: cpu.hh:637
STL list class.
Definition: stl.hh:54
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
Definition: cpu.hh:705
static void wakeup(ThreadID tid)
Definition: cpu_dummy.hh:50
void squash()
Squash the current event.
Definition: eventq.hh:388
void setMiscRegNoEffect(RegIndex misc_reg, RegVal val) override
Sets a misc.
virtual void verifyMemoryMode() const
Verify that the system is in a memory mode supported by the CPU.
Definition: base.hh:378
int instcount
Count of total number of dynamic instructions in flight.
Definition: cpu.hh:535
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
Definition: cpu.hh:152
void activateStage(const StageIdx idx)
Changes a stage&#39;s status to active within the activity recorder.
Definition: cpu.hh:660
virtual Counter totalOps() const =0
void setVecElem(const RegId &reg, const VecElem &val) override
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
void regStats()
Callback to set stat parameters.
Definition: cpu.cc:88
Stats::Scalar fpRegfileReads
Definition: cpu.hh:775
int64_t Counter
Statistics counter type.
Definition: types.hh:58
Enums::VecRegRenameMode vecMode
The rename mode of the vector registers.
Definition: cpu.hh:575
Stats::Scalar fpRegfileWrites
Definition: cpu.hh:776
MicroPC microPC() const override
Reads this thread&#39;s next PC.
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...
Stats::Scalar vecRegfileWrites
Definition: cpu.hh:779
Stats::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
Definition: cpu.hh:757
void halt()
Halts the CPU.
Definition: cpu.hh:335
RegVal readMiscRegNoEffect(RegIndex misc_reg) const override
Reads a miscellaneous register.
std::queue< ListIt > removeList
List of all the instructions that will be removed at the end of this cycle.
Definition: cpu.hh:544
virtual void switchOut()
Prepare for another CPU to take over execution.
Definition: base.cc:543
CPUPolicy::TimeStruct TimeStruct
Typedefs from the Impl to get the structs that each of the time buffers should use.
Definition: cpu.hh:623
Stats::Formula cpi
Stat for the CPI per thread.
Definition: cpu.hh:763
Checker< Impl > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
Definition: cpu.hh:690
A formula for statistics that is calculated when printed.
Definition: statistics.hh:3012
FreeList class that simply holds the list of free integer and floating point registers.
Definition: free_list.hh:117
Physical register ID.
Definition: reg_class.hh:229
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:227
StageIdx
Enum to give each stage a specific index, so when calling activateStage() or deactivateStage(), they can specify which stage is being activated/deactivated.
Definition: cpu.hh:612
void reschedule(Event &event, Tick when, bool always=false)
Definition: eventq.hh:756
void setVecPredReg(const RegId &reg, const VecPredRegContainer &val) override
ProbePointArg generates a point for the class of Arg.
void regProbePoints() override
Register probe points for this object.
Definition: base.cc:354
ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
Definition: cpu.hh:678
void syscall(Fault *fault) override
Executes a syscall in SE mode.
void wakeCPU(ThreadContext *tc, uint64_t cpuid)
Definition: pseudo_inst.cc:146
TimeBuffer< IEWStruct > iewQueue
The IEW stage&#39;s instruction queue.
Definition: cpu.hh:646
VecRegContainer & getWritableVecReg(const RegId &id) override
Read vector register operand for modification, hierarchical indexing.
std::ostream CheckpointOut
Definition: serialize.hh:68
O3ThreadState< Impl > Thread
Definition: cpu.hh:112
uint16_t ElemIndex
Logical vector register elem index type.
Definition: types.hh:45
void setVecReg(const RegId &reg, const VecRegContainer &val) override
InstSeqNum getAndIncrementInstSeq()
Get the current instruction sequence number, and increment it.
Definition: cpu.hh:314
PhysRegFile regFile
The register file.
Definition: cpu.hh:578
XReg readVecElem(VReg src, int index, int eSize)
Read a single NEON vector element.
Definition: neon64_mem.hh:94
GenericISA::SimplePCState< MachInst > PCState
Definition: types.hh:43
void vecRenameMode(Enums::VecRegRenameMode vec_mode)
Sets the current vector renaming mode.
Definition: cpu.hh:370
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:653
virtual void drainResume()
Resume execution after a successful drain.
Definition: drain.hh:257
Stats::Scalar vecPredRegfileReads
Definition: cpu.hh:781
Stats::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
Definition: cpu.hh:754
Generic predicate register container.
Definition: vec_pred_reg.hh:51
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: base.cc:281
DrainState drain() override
Provide a default implementation of the drain interface for objects that don&#39;t need draining...
Definition: sim_object.hh:189
void schedule(Event &event, Tick when)
Definition: eventq.hh:744
Stats::Scalar ccRegfileReads
Definition: cpu.hh:784
Impl::O3CPU O3CPU
Definition: cpu.hh:104
InstSeqNum globalSeqNum
The global sequence number counter.
Definition: cpu.hh:684
virtual void demapPage(Addr vaddr, uint64_t asn)=0
TimeBuffer< RenameStruct > renameQueue
The rename stage&#39;s instruction queue.
Definition: cpu.hh:643
CPUPolicy::IEWStruct IEWStruct
Definition: cpu.hh:631
Scoreboard scoreboard
Integer Register Scoreboard.
Definition: cpu.hh:603
Derived ThreadContext class for use with the O3CPU.
Definition: cpu.hh:76
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:79
Memory operation metadata.
Definition: lsq.hh:232
virtual void haltContext(ThreadID thread_num)
Notify the CPU that the indicated context is now halted.
Definition: base.cc:531
::DummyVecElem VecElem
Definition: registers.hh:50
CPUPolicy::IEW iew
The issue/execute/writeback stages.
Definition: cpu.hh:569
Vector Register.
Definition: reg_class.hh:60
void demapPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:200
std::list< DynInstPtr >::iterator ListIt
Definition: cpu.hh:114
std::vector< TheISA::ISA * > isa
Definition: cpu.hh:605
std::list< DynInstPtr > instList
List of all the instructions in flight.
Definition: cpu.hh:539
Fault pushRequest(const DynInstPtr &inst, bool isLoad, uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res, AtomicOpFunctorPtr amo_op=nullptr, const std::vector< bool > &byte_enable=std::vector< bool >())
CPU pushRequest function, forwards request to LSQ.
Definition: cpu.hh:714
Vector Lane abstraction Another view of a container.
Definition: vec_reg.hh:262
Impl::DynInstPtr DynInstPtr
Definition: cpu.hh:103
O3ThreadState< Impl > ImplState
Definition: cpu.hh:111
O3ThreadState< Impl > * thread
Pointer to the thread state that this TC corrseponds to.
VecLaneT< VecElem, true > readVecLane(PhysRegIdPtr phys_reg) const
Read physical vector register lane.
Definition: cpu.hh:378
const char data[]
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
const Params * params() const
Definition: base.hh:311
std::list< int > cpuWaitList
Threads Scheduled to Enter CPU.
Definition: cpu.hh:699
Addr nextInstAddr() const override
Reads this thread&#39;s next PC.
RegVal readIntReg(RegIndex reg_idx) const override
VecLaneT< VecElem, true > readArchVecLane(int reg_idx, int lId, ThreadID tid) const
Read architectural vector register lane.
Definition: cpu.hh:435
Stats::Formula totalIpc
Stat for the total IPC.
Definition: cpu.hh:769
void deactivateStage(const StageIdx idx)
Changes a stage&#39;s status to inactive within the activity recorder.
Definition: cpu.hh:664
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.
Definition: base.cc:505
FullO3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time ...
Definition: cpu.hh:98
BaseTLB * dtb
Definition: cpu.hh:128
void activityThisCycle()
Records that there was time buffer activity this cycle.
Definition: cpu.hh:657
Stats::Scalar ccRegfileWrites
Definition: cpu.hh:785
CPUPolicy::Rename rename
The dispatch stage.
Definition: cpu.hh:566
VecPredRegContainer & getWritableVecPredReg(const RegId &id) override

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