gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cpu.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2013 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/types.hh"
57 #include "base/statistics.hh"
58 #include "config/the_isa.hh"
59 #include "cpu/o3/comm.hh"
60 #include "cpu/o3/cpu_policy.hh"
61 #include "cpu/o3/scoreboard.hh"
62 #include "cpu/o3/thread_state.hh"
63 #include "cpu/activity.hh"
64 #include "cpu/base.hh"
65 #include "cpu/simple_thread.hh"
66 #include "cpu/timebuf.hh"
67 //#include "cpu/o3/thread_context.hh"
68 #include "params/DerivO3CPU.hh"
69 #include "sim/process.hh"
70 
71 template <class>
72 class Checker;
73 class ThreadContext;
74 template <class>
76 
77 class Checkpoint;
78 class MemObject;
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 
111  friend class O3ThreadContext<Impl>;
112 
113  public:
114  enum Status {
120  };
121 
122  TheISA::TLB * itb;
123  TheISA::TLB * dtb;
124 
127 
128  private:
129 
133  class IcachePort : public MasterPort
134  {
135  protected:
138 
139  public:
142  : MasterPort(_cpu->name() + ".icache_port", _cpu), fetch(_fetch)
143  { }
144 
145  protected:
146 
149  virtual bool recvTimingResp(PacketPtr pkt);
150 
152  virtual void recvReqRetry();
153  };
154 
158  class DcachePort : public MasterPort
159  {
160  protected:
161 
165 
166  public:
169  : MasterPort(_cpu->name() + ".dcache_port", _cpu), lsq(_lsq),
170  cpu(_cpu)
171  { }
172 
173  protected:
174 
178  virtual bool recvTimingResp(PacketPtr pkt);
179  virtual void recvTimingSnoopReq(PacketPtr pkt);
180 
181  virtual void recvFunctionalSnoop(PacketPtr pkt)
182  {
183  // @todo: Is there a need for potential invalidation here?
184  }
185 
187  virtual void recvReqRetry();
188 
195  virtual bool isSnooping() const { return true; }
196  };
197 
198  class TickEvent : public Event
199  {
200  private:
203 
204  public:
207 
209  void process();
211  const char *description() const;
212  };
213 
215  TickEvent tickEvent;
216 
219  {
220  if (tickEvent.squashed())
221  reschedule(tickEvent, clockEdge(delay));
222  else if (!tickEvent.scheduled())
223  schedule(tickEvent, clockEdge(delay));
224  }
225 
228  {
229  if (tickEvent.scheduled())
230  tickEvent.squash();
231  }
232 
244  bool tryDrain();
245 
255  void drainSanityCheck() const;
256 
258  bool isDrained() const;
259 
260  public:
262  FullO3CPU(DerivO3CPUParams *params);
264  ~FullO3CPU();
265 
267  void regStats() override;
268 
271 
273  void regProbePoints() override;
274 
275  void demapPage(Addr vaddr, uint64_t asn)
276  {
277  this->itb->demapPage(vaddr, asn);
278  this->dtb->demapPage(vaddr, asn);
279  }
280 
281  void demapInstPage(Addr vaddr, uint64_t asn)
282  {
283  this->itb->demapPage(vaddr, asn);
284  }
285 
286  void demapDataPage(Addr vaddr, uint64_t asn)
287  {
288  this->dtb->demapPage(vaddr, asn);
289  }
290 
294  void tick();
295 
297  void init() override;
298 
299  void startup() override;
300 
303  { return activeThreads.size(); }
304 
306  void activateThread(ThreadID tid);
307 
309  void deactivateThread(ThreadID tid);
310 
312  void insertThread(ThreadID tid);
313 
315  void removeThread(ThreadID tid);
316 
318  Counter totalInsts() const override;
319 
321  Counter totalOps() const override;
322 
324  void activateContext(ThreadID tid) override;
325 
327  void suspendContext(ThreadID tid) override;
328 
332  void haltContext(ThreadID tid) override;
333 
335  void updateThreadPriority();
336 
338  bool isDraining() const { return drainState() == DrainState::Draining; }
339 
340  void serializeThread(CheckpointOut &cp, ThreadID tid) const override;
341  void unserializeThread(CheckpointIn &cp, ThreadID tid) override;
342 
343  public:
347  void syscall(int64_t callnum, ThreadID tid, Fault *fault);
348 
351  DrainState drain() override;
352 
354  void drainResume() override;
355 
363  void commitDrained(ThreadID tid);
364 
366  void switchOut() override;
367 
369  void takeOverFrom(BaseCPU *oldCPU) override;
370 
371  void verifyMemoryMode() const override;
372 
375  { return globalSeqNum++; }
376 
378  void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst);
379 
381  Fault hwrei(ThreadID tid);
382 
383  bool simPalCheck(int palFunc, ThreadID tid);
384 
387 
389  void processInterrupts(const Fault &interrupt);
390 
392  void halt() { panic("Halt not implemented!\n"); }
393 
397  TheISA::MiscReg readMiscRegNoEffect(int misc_reg, ThreadID tid) const;
398 
402  TheISA::MiscReg readMiscReg(int misc_reg, ThreadID tid);
403 
405  void setMiscRegNoEffect(int misc_reg, const TheISA::MiscReg &val,
406  ThreadID tid);
407 
411  void setMiscReg(int misc_reg, const TheISA::MiscReg &val,
412  ThreadID tid);
413 
414  uint64_t readIntReg(int reg_idx);
415 
416  TheISA::FloatReg readFloatReg(int reg_idx);
417 
419 
420  TheISA::CCReg readCCReg(int reg_idx);
421 
422  void setIntReg(int reg_idx, uint64_t val);
423 
424  void setFloatReg(int reg_idx, TheISA::FloatReg val);
425 
426  void setFloatRegBits(int reg_idx, TheISA::FloatRegBits val);
427 
428  void setCCReg(int reg_idx, TheISA::CCReg val);
429 
430  uint64_t readArchIntReg(int reg_idx, ThreadID tid);
431 
432  float readArchFloatReg(int reg_idx, ThreadID tid);
433 
434  uint64_t readArchFloatRegInt(int reg_idx, ThreadID tid);
435 
436  TheISA::CCReg readArchCCReg(int reg_idx, ThreadID tid);
437 
443  void setArchIntReg(int reg_idx, uint64_t val, ThreadID tid);
444 
445  void setArchFloatReg(int reg_idx, float val, ThreadID tid);
446 
447  void setArchFloatRegInt(int reg_idx, uint64_t val, ThreadID tid);
448 
449  void setArchCCReg(int reg_idx, TheISA::CCReg val, ThreadID tid);
450 
452  void pcState(const TheISA::PCState &newPCState, ThreadID tid);
453 
456 
458  Addr instAddr(ThreadID tid);
459 
461  MicroPC microPC(ThreadID tid);
462 
465 
470  void squashFromTC(ThreadID tid);
471 
475  ListIt addInst(DynInstPtr &inst);
476 
478  void instDone(ThreadID tid, DynInstPtr &inst);
479 
483  void removeFrontInst(DynInstPtr &inst);
484 
487  void removeInstsNotInROB(ThreadID tid);
488 
490  void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid);
491 
493  inline void squashInstIt(const ListIt &instIt, ThreadID tid);
494 
496  void cleanUpRemovedInsts();
497 
499  void dumpInsts();
500 
501  public:
502 #ifndef NDEBUG
503 
505 #endif
506 
509 
513  std::queue<ListIt> removeList;
514 
515 #ifdef DEBUG
516 
519  std::set<InstSeqNum> snList;
520 #endif
521 
526 
527  protected:
530 
533 
536 
538  typename CPUPolicy::IEW iew;
539 
542 
545 
548 
550  typename CPUPolicy::RenameMap renameMap[Impl::MaxThreads];
551 
553  typename CPUPolicy::RenameMap commitRenameMap[Impl::MaxThreads];
554 
556  typename CPUPolicy::ROB rob;
557 
560 
563 
565 
567  IcachePort icachePort;
568 
570  DcachePort dcachePort;
571 
572  public:
577  enum StageIdx {
584 
589 
591 
593 
595 
596  typedef typename CPUPolicy::IEWStruct IEWStruct;
597 
600 
603 
606 
609 
612 
613  private:
619 
620  public:
623 
625  void activateStage(const StageIdx idx)
626  { activityRec.activateStage(idx); }
627 
629  void deactivateStage(const StageIdx idx)
630  { activityRec.deactivateStage(idx); }
631 
633  void wakeCPU();
634 
635  virtual void wakeup(ThreadID tid) override;
636 
639 
640  public:
642  ThreadContext *
644  {
645  return thread[tid]->getTC();
646  }
647 
649  InstSeqNum globalSeqNum;//[Impl::MaxThreads];
650 
656 
659 
662 
665 
668 
671 
673  std::map<ThreadID, unsigned> threadMap;
674 
677 
679  Fault read(RequestPtr &req, RequestPtr &sreqLow, RequestPtr &sreqHigh,
680  int load_idx)
681  {
682  return this->iew.ldstQueue.read(req, sreqLow, sreqHigh, load_idx);
683  }
684 
686  Fault write(RequestPtr &req, RequestPtr &sreqLow, RequestPtr &sreqHigh,
687  uint8_t *data, int store_idx)
688  {
689  return this->iew.ldstQueue.write(req, sreqLow, sreqHigh,
690  data, store_idx);
691  }
692 
694  MasterPort &getInstPort() override { return icachePort; }
695 
697  MasterPort &getDataPort() override { return dcachePort; }
698 
718 
719  //number of integer register file accesses
722  //number of float register file accesses
725  //number of CC register file accesses
728  //number of misc
731 };
732 
733 #endif // __CPU_O3_CPU_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
Definition: port.hh:167
void unserializeThread(CheckpointIn &cp, ThreadID tid) override
Definition: cpu.cc:1002
DcachePort dcachePort
Data port.
Definition: cpu.hh:570
DcachePort(LSQ< Impl > *_lsq, FullO3CPU< Impl > *_cpu)
Default constructor.
Definition: cpu.hh:168
MasterPort & getDataPort() override
Get the dcache port (used to find block size for translations).
Definition: cpu.hh:697
std::vector< ThreadID > tids
Available thread ids in the cpu.
Definition: cpu.hh:676
Stats::Scalar timesIdled
Stat for total number of times the CPU is descheduled.
Definition: cpu.hh:700
void demapDataPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:286
uint8_t CCReg
Definition: registers.hh:57
bool removeInstsThisCycle
Records if instructions need to be removed this cycle due to being retired or squashed.
Definition: cpu.hh:525
Struct that defines the information passed from IEW to commit.
Definition: comm.hh:94
DefaultRename handles both single threaded and SMT rename.
Definition: rename.hh:70
virtual void recvReqRetry()
Handles doing a retry of a failed fetch.
Definition: cpu.cc:107
void setArchFloatReg(int reg_idx, float val, ThreadID tid)
Definition: cpu.cc:1352
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
void syscall(int64_t callnum, ThreadID tid, Fault *fault)
Executes a syscall.
Definition: cpu.cc:975
ThreadID getFreeTid()
Gets a free thread id.
Definition: cpu.cc:1655
const char * description() const
Returns the description of the tick event.
Definition: cpu.cc:153
void squashFromTC(ThreadID tid)
Initiates a squash of all in-flight instructions for a given thread.
Definition: cpu.cc:1417
void demapInstPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:281
IcachePort icachePort
Instruction port.
Definition: cpu.hh:567
System * system
Pointer to the system.
Definition: cpu.hh:658
uint64_t readIntReg(int reg_idx)
Definition: cpu.cc:1238
void scheduleTickEvent(Cycles delay)
Schedule tick event, regardless of its current state.
Definition: cpu.hh:218
std::vector< Thread * > thread
Pointers to all of the threads in the CPU.
Definition: cpu.hh:661
DrainState
Object drain/handover states.
Definition: drain.hh:71
Fault getInterrupts()
Returns the Fault for any valid interrupt.
Definition: cpu.cc:941
#define panic(...)
Definition: misc.hh:153
Running normally.
TickEvent(FullO3CPU< Impl > *c)
Constructs a tick event.
Definition: cpu.cc:139
void activateContext(ThreadID tid) override
Add Thread to Active Threads List.
Definition: cpu.cc:707
Simple physical register file class.
Definition: regfile.hh:51
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:99
Stats::Formula ipc
Stat for the IPC per thread.
Definition: cpu.hh:715
DefaultIEW handles both single threaded and SMT IEW (issue/execute/writeback).
Definition: iew.hh:80
void takeOverFrom(BaseCPU *oldCPU) override
Takes over from another CPU.
Definition: cpu.cc:1174
Stats::Scalar intRegfileReads
Definition: cpu.hh:720
Fault hwrei(ThreadID tid)
HW return from error interrupt.
Definition: cpu.cc:900
CPUPolicy::FetchStruct FetchStruct
Definition: cpu.hh:590
~FullO3CPU()
Destructor.
Definition: cpu.cc:406
void wakeCPU()
Wakes the CPU, rescheduling the CPU if it's not already active.
Definition: cpu.cc:1619
Stats::Vector committedInsts
Stat for the number of committed instructions per thread.
Definition: cpu.hh:707
TheISA::CCReg readArchCCReg(int reg_idx, ThreadID tid)
Definition: cpu.cc:1332
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:381
Status _status
Overall CPU status.
Definition: cpu.hh:126
CPUPolicy::Decode decode
The decode stage.
Definition: cpu.hh:532
void activity()
Records that there is activity this cycle.
Definition: activity.cc:56
BaseO3CPU(BaseCPUParams *params)
Definition: cpu.cc:81
CPUPolicy::FreeList freeList
The free list.
Definition: cpu.hh:547
uint64_t MiscReg
Definition: registers.hh:54
Stats::Scalar miscRegfileReads
Definition: cpu.hh:729
Definition: system.hh:83
A vector of scalar stats.
Definition: statistics.hh:2499
ProbePointArg< std::pair< DynInstPtr, PacketPtr > > * ppDataAccessComplete
Definition: cpu.hh:270
DefaultDecode class handles both single threaded and SMT decode.
Definition: decode.hh:61
TheISA::MiscReg readMiscReg(int misc_reg, ThreadID tid)
Reads a misc.
Definition: cpu.cc:1213
uint64_t readArchIntReg(int reg_idx, ThreadID tid)
Definition: cpu.cc:1302
void setArchIntReg(int reg_idx, uint64_t val, ThreadID tid)
Architectural register accessors.
Definition: cpu.cc:1342
Stats::Vector committedOps
Stat for the number of committed ops (including micro ops) per thread.
Definition: cpu.hh:709
IcachePort(DefaultFetch< Impl > *_fetch, FullO3CPU< Impl > *_cpu)
Default constructor.
Definition: cpu.hh:141
void insertThread(ThreadID tid)
Setup CPU to insert a thread's context.
Definition: cpu.cc:779
Definition: lsq.hh:58
FullO3CPU(DerivO3CPUParams *params)
Constructs a CPU with the given parameters.
Definition: cpu.cc:159
ThreadContext is the external interface to all thread state for anything outside of the CPU...
void tick()
Ticks CPU, calling tick() on each stage, and checking the overall activity to see if the CPU should d...
Definition: cpu.cc:540
Declaration of Statistics objects.
TimeBuffer< TimeStruct > timeBuffer
The main time buffer to do backwards communication.
Definition: cpu.hh:599
CPUPolicy::Fetch fetch
The fetch stage.
Definition: cpu.hh:529
MasterPort & getInstPort() override
Used by the fetch unit to get a hold of the instruction port.
Definition: cpu.hh:694
void trap(const Fault &fault, ThreadID tid, const StaticInstPtr &inst)
Traps to handle given fault.
Definition: cpu.cc:966
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2475
void setMiscRegNoEffect(int misc_reg, const TheISA::MiscReg &val, ThreadID tid)
Sets a miscellaneous register.
Definition: cpu.cc:1221
void removeFrontInst(DynInstPtr &inst)
Remove an instruction from the front end of the list.
Definition: cpu.cc:1456
CPUPolicy::ROB rob
The re-order buffer.
Definition: cpu.hh:556
void removeInstsUntil(const InstSeqNum &seq_num, ThreadID tid)
Remove all instructions younger than the given sequence number.
Definition: cpu.cc:1515
void squashInstIt(const ListIt &instIt, ThreadID tid)
Removes the instruction pointed to by the iterator.
Definition: cpu.cc:1544
void drainSanityCheck() const
Perform sanity checks after a drain.
Definition: cpu.cc:1074
Bitfield< 63 > val
Definition: misc.hh:770
Templated Checker class.
Definition: cpu.hh:433
void deactivateStage(const int idx)
Deactivates a stage.
Definition: activity.cc:109
const char data[]
Definition: circlebuf.cc:43
std::map< ThreadID, unsigned > threadMap
Mapping for system thread id to cpu id.
Definition: cpu.hh:673
int numActiveThreads()
Returns the Number of Active Threads in the CPU.
Definition: cpu.hh:302
Impl::CPUPol CPUPolicy
Definition: cpu.hh:102
Stats::Formula totalCpi
Stat for the total CPI.
Definition: cpu.hh:713
DefaultCommit handles single threaded and SMT commit.
Definition: commit.hh:83
void verifyMemoryMode() const override
Definition: cpu.cc:1196
virtual void recvReqRetry()
Handles doing a retry of the previous send.
Definition: cpu.cc:133
Implements a simple scoreboard to track which registers are ready.
Definition: scoreboard.hh:56
void setArchFloatRegInt(int reg_idx, uint64_t val, ThreadID tid)
Definition: cpu.cc:1362
void deactivateThread(ThreadID tid)
Remove Thread from Active Threads List.
Definition: cpu.cc:660
Definition: cpu.hh:83
std::list< ThreadID > activeThreads
Active Threads List.
Definition: cpu.hh:559
FullO3CPU< Impl > * cpu
Definition: cpu.hh:164
uint64_t FloatRegBits
Definition: registers.hh:51
void serializeThread(CheckpointOut &cp, ThreadID tid) const override
Definition: cpu.cc:995
CPUPolicy::RenameStruct RenameStruct
Definition: cpu.hh:594
void suspendContext(ThreadID tid) override
Remove Thread from Active Threads List.
Definition: cpu.cc:746
void haltContext(ThreadID tid) override
Remove Thread from Active Threads List && Remove Thread Context from CPU.
Definition: cpu.cc:767
uint64_t Tick
Tick count type.
Definition: types.hh:63
Stats::Scalar miscRegfileWrites
Definition: cpu.hh:730
Stats::Scalar intRegfileWrites
Definition: cpu.hh:721
DefaultFetch class handles both single threaded and SMT fetch.
Definition: fetch.hh:71
void activateStage(const int idx)
Marks a stage as active.
Definition: activity.cc:92
CPUPolicy::Commit commit
The commit stage.
Definition: cpu.hh:541
Cycles lastRunningCycle
The cycle that the CPU was last running, used for statistics.
Definition: cpu.hh:667
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:592
Addr instAddr(ThreadID tid)
Reads the commit PC of a specific thread.
Definition: cpu.cc:1396
ProbePointArg< PacketPtr > * ppInstAccessComplete
Definition: cpu.hh:269
bool squashed() const
Check whether the event is squashed.
Definition: eventq.hh:387
TimeBuffer< DecodeStruct > decodeQueue
The decode stage's instruction queue.
Definition: cpu.hh:605
Unified register rename map for all classes of registers.
Definition: rename_map.hh:159
uint16_t MicroPC
Definition: types.hh:144
ListIt addInst(DynInstPtr &inst)
Function to add instruction onto the head of the list of the instructions.
Definition: cpu.cc:1425
MicroPC microPC(ThreadID tid)
Reads the commit micro PC of a specific thread.
Definition: cpu.cc:1410
uint64_t InstSeqNum
Definition: inst_seq.hh:40
Counter totalInsts() const override
Count the Total Instructions Committed in the CPU.
Definition: cpu.cc:681
TheISA::CCReg readCCReg(int reg_idx)
Definition: cpu.cc:1262
virtual void recvTimingSnoopReq(PacketPtr pkt)
Receive a timing snoop request from the slave port.
Definition: cpu.cc:121
TimeBuffer< FetchStruct > fetchQueue
The fetch stage's instruction queue.
Definition: cpu.hh:602
void activateThread(ThreadID tid)
Add Thread to Active Threads List.
Definition: cpu.cc:642
STL list class.
Definition: stl.hh:54
Tick lastActivatedCycle
The cycle that the CPU was last activated by a new thread.
Definition: cpu.hh:670
virtual void recvFunctionalSnoop(PacketPtr pkt)
Receive a functional snoop request packet from the slave port.
Definition: cpu.hh:181
void init() override
Initialize the CPU.
Definition: cpu.cc:599
void squash()
Squash the current event.
Definition: eventq.hh:384
int instcount
Count of total number of dynamic instructions in flight.
Definition: cpu.hh:504
void unscheduleTickEvent()
Unschedule tick event, regardless of its current state.
Definition: cpu.hh:227
double FloatReg
Definition: registers.hh:50
void activateStage(const StageIdx idx)
Changes a stage's status to active within the activity recorder.
Definition: cpu.hh:625
TheISA::TLB * dtb
Definition: cpu.hh:123
void removeThread(ThreadID tid)
Remove all of a thread's context from CPU.
Definition: cpu.cc:834
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
void regStats()
Definition: cpu.cc:87
Fault read(RequestPtr &req, RequestPtr &sreqLow, RequestPtr &sreqHigh, int load_idx)
CPU read function, forwards read to LSQ.
Definition: cpu.hh:679
IcachePort class for instruction fetch.
Definition: cpu.hh:133
Stats::Scalar fpRegfileReads
Definition: cpu.hh:723
int64_t Counter
Statistics counter type.
Definition: types.hh:58
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
Stats::Scalar fpRegfileWrites
Definition: cpu.hh:724
virtual bool recvTimingResp(PacketPtr pkt)
Timing version of receive.
Definition: cpu.cc:114
bool tryDrain()
Check if the pipeline has drained and signal drain done.
Definition: cpu.cc:1058
Struct that defines the information passed from fetch to decode.
Definition: comm.hh:61
DcachePort class for the load/store queue.
Definition: cpu.hh:158
Stats::Scalar quiesceCycles
Stat for total number of cycles the CPU spends descheduled due to a quiesce operation or waiting for ...
Definition: cpu.hh:705
void halt()
Halts the CPU.
Definition: cpu.hh:392
std::queue< ListIt > removeList
List of all the instructions that will be removed at the end of this cycle.
Definition: cpu.hh:513
CPUPolicy::TimeStruct TimeStruct
Typedefs from the Impl to get the structs that each of the time buffers should use.
Definition: cpu.hh:588
void removeInstsNotInROB(ThreadID tid)
Remove all instructions that are not currently in the ROB.
Definition: cpu.cc:1470
Stats::Formula cpi
Stat for the CPI per thread.
Definition: cpu.hh:711
Checker< Impl > * checker
Pointer to the checker, which can dynamically verify instruction results at run time.
Definition: cpu.hh:655
A formula for statistics that is calculated when printed.
Definition: statistics.hh:2895
cbk_int func interrupt
Definition: gpu_nomali.cc:94
LSQ< Impl > * lsq
Pointer to LSQ.
Definition: cpu.hh:163
FreeList class that simply holds the list of free integer and floating point registers.
Definition: free_list.hh:95
void setIntReg(int reg_idx, uint64_t val)
Definition: cpu.cc:1270
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:171
TheISA::FloatReg readFloatReg(int reg_idx)
Definition: cpu.cc:1246
DefaultFetch< Impl > * fetch
Pointer to fetch.
Definition: cpu.hh:137
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:577
void switchOut() override
Switches out this CPU.
Definition: cpu.cc:1159
ProbePointArg generates a point for the class of Arg.
Bitfield< 29 > c
Definition: miscregs.hh:1365
ThreadContext * tcBase(ThreadID tid)
Returns a pointer to a thread context.
Definition: cpu.hh:643
TimeBuffer< IEWStruct > iewQueue
The IEW stage's instruction queue.
Definition: cpu.hh:611
void process()
Processes a tick event, calling tick() on the CPU.
Definition: cpu.cc:146
bool simPalCheck(int palFunc, ThreadID tid)
Definition: cpu.cc:915
std::ostream CheckpointOut
Definition: serialize.hh:67
O3ThreadState< Impl > Thread
Definition: cpu.hh:107
void startup() override
Definition: cpu.cc:627
InstSeqNum getAndIncrementInstSeq()
Get the current instruction sequence number, and increment it.
Definition: cpu.hh:374
::ROB< Impl > ROB
Typedef for the ROB.
Definition: cpu_policy.hh:68
PhysRegFile regFile
The register file.
Definition: cpu.hh:544
void setMiscReg(int misc_reg, const TheISA::MiscReg &val, ThreadID tid)
Sets a misc.
Definition: cpu.cc:1229
void dumpInsts()
Debug function to print all instructions on the list.
Definition: cpu.cc:1591
Definition: eventq.hh:185
GenericISA::SimplePCState< MachInst > PCState
Definition: types.hh:43
void setFloatRegBits(int reg_idx, TheISA::FloatRegBits val)
Definition: cpu.cc:1286
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:618
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
Definition: mem_object.hh:60
void setFloatReg(int reg_idx, TheISA::FloatReg val)
Definition: cpu.cc:1278
Stats::Scalar idleCycles
Stat for total number of cycles the CPU spends descheduled.
Definition: cpu.hh:702
TheISA::FloatRegBits readFloatRegBits(int reg_idx)
Definition: cpu.cc:1254
virtual bool isSnooping() const
As this CPU requires snooping to maintain the load store queue change the behaviour from the base CPU...
Definition: cpu.hh:195
Addr nextInstAddr(ThreadID tid)
Reads the next PC of a specific thread.
Definition: cpu.cc:1403
uint64_t readArchFloatRegInt(int reg_idx, ThreadID tid)
Definition: cpu.cc:1322
void setCCReg(int reg_idx, TheISA::CCReg val)
Definition: cpu.cc:1294
TheISA::TLB * itb
Definition: cpu.hh:122
CPUPolicy::RenameMap commitRenameMap[Impl::MaxThreads]
The commit rename map.
Definition: cpu.hh:553
Counter totalOps() const override
Count the Total Ops (including micro ops) committed in the CPU.
Definition: cpu.cc:694
Stats::Scalar ccRegfileReads
Definition: cpu.hh:726
Impl::O3CPU O3CPU
Definition: cpu.hh:104
InstSeqNum globalSeqNum
The global sequence number counter.
Definition: cpu.hh:649
TimeBuffer< RenameStruct > renameQueue
The rename stage's instruction queue.
Definition: cpu.hh:608
TheISA::MiscReg readMiscRegNoEffect(int misc_reg, ThreadID tid) const
Register accessors.
Definition: cpu.cc:1206
CPUPolicy::IEWStruct IEWStruct
Definition: cpu.hh:596
Scoreboard scoreboard
Integer Register Scoreboard.
Definition: cpu.hh:562
Derived ThreadContext class for use with the O3CPU.
Definition: cpu.hh:75
void regStats() override
Registers statistics.
Definition: cpu.cc:427
Struct that defines the information passed from rename to IEW.
Definition: comm.hh:84
DrainState drain() override
Starts draining the CPU's pipeline of all instructions in order to stop all memory accesses...
Definition: cpu.cc:1009
Struct that defines all backwards communication.
Definition: comm.hh:122
CPUPolicy::IEW iew
The issue/execute/writeback stages.
Definition: cpu.hh:538
void setArchCCReg(int reg_idx, TheISA::CCReg val, ThreadID tid)
Definition: cpu.cc:1372
void demapPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:275
std::list< DynInstPtr >::iterator ListIt
Definition: cpu.hh:109
float readArchFloatReg(int reg_idx, ThreadID tid)
Definition: cpu.cc:1312
FullO3CPU< Impl > * cpu
Pointer to the CPU.
Definition: cpu.hh:202
std::vector< TheISA::ISA * > isa
Definition: cpu.hh:564
Fault write(RequestPtr &req, RequestPtr &sreqLow, RequestPtr &sreqHigh, uint8_t *data, int store_idx)
CPU write function, forwards write to LSQ.
Definition: cpu.hh:686
std::list< DynInstPtr > instList
List of all the instructions in flight.
Definition: cpu.hh:508
void cleanUpRemovedInsts()
Cleans up all instructions on the remove list.
Definition: cpu.cc:1565
virtual bool recvTimingResp(PacketPtr pkt)
Timing version of receive.
Definition: cpu.cc:94
TickEvent tickEvent
The tick event used for scheduling CPU ticks.
Definition: cpu.hh:215
void drainResume() override
Resumes execution after a drain.
Definition: cpu.cc:1132
Impl::DynInstPtr DynInstPtr
Definition: cpu.hh:103
O3ThreadState< Impl > ImplState
Definition: cpu.hh:106
void commitDrained(ThreadID tid)
Commit has reached a safe point to drain a thread.
Definition: cpu.cc:1125
virtual void wakeup(ThreadID tid) override
Definition: cpu.cc:1642
std::shared_ptr< FaultBase > Fault
Definition: types.hh:184
std::list< int > cpuWaitList
Threads Scheduled to Enter CPU.
Definition: cpu.hh:664
void instDone(ThreadID tid, DynInstPtr &inst)
Function to tell the CPU that an instruction has completed.
Definition: cpu.cc:1434
void updateThreadPriority()
Update The Order In Which We Process Threads.
Definition: cpu.cc:1669
void processInterrupts(const Fault &interrupt)
Processes any an interrupt fault.
Definition: cpu.cc:949
Stats::Formula totalIpc
Stat for the total IPC.
Definition: cpu.hh:717
CPUPolicy::RenameMap renameMap[Impl::MaxThreads]
The rename map.
Definition: cpu.hh:550
bool isDrained() const
Check if a system is in a drained state.
Definition: cpu.cc:1086
Struct that defines the information passed from decode to rename.
Definition: comm.hh:74
void deactivateStage(const StageIdx idx)
Changes a stage's status to inactive within the activity recorder.
Definition: cpu.hh:629
void pcState(const TheISA::PCState &newPCState, ThreadID tid)
Sets the commit PC state of a specific thread.
Definition: cpu.cc:1389
FullO3CPU class, has each of the stages (fetch through commit) within it, as well as all of the time ...
Definition: cpu.hh:98
void regProbePoints() override
Register probe points.
Definition: cpu.cc:412
void activityThisCycle()
Records that there was time buffer activity this cycle.
Definition: cpu.hh:622
Stats::Scalar ccRegfileWrites
Definition: cpu.hh:727
bool isDraining() const
Is the CPU draining?
Definition: cpu.hh:338
CPUPolicy::Rename rename
The dispatch stage.
Definition: cpu.hh:535

Generated on Fri Jun 9 2017 13:03:42 for gem5 by doxygen 1.8.6