gem5  v20.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, 2016-2018, 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) 2006 The Regents of The University of Michigan
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #ifndef __CPU_CHECKER_CPU_HH__
43 #define __CPU_CHECKER_CPU_HH__
44 
45 #include <list>
46 #include <map>
47 #include <queue>
48 
49 #include "arch/types.hh"
50 #include "base/statistics.hh"
51 #include "cpu/base.hh"
52 #include "cpu/base_dyn_inst.hh"
53 #include "cpu/exec_context.hh"
54 #include "cpu/inst_res.hh"
55 #include "cpu/pc_event.hh"
56 #include "cpu/simple_thread.hh"
57 #include "cpu/static_inst.hh"
58 #include "debug/Checker.hh"
59 #include "mem/request.hh"
60 #include "params/CheckerCPU.hh"
61 #include "sim/eventq.hh"
62 
63 class BaseTLB;
64 template <class>
65 class BaseDynInst;
66 class ThreadContext;
67 class Request;
68 
85 class CheckerCPU : public BaseCPU, public ExecContext
86 {
87  protected:
90 
93  public:
94  void init() override;
95 
96  typedef CheckerCPUParams Params;
97  CheckerCPU(Params *p);
98  virtual ~CheckerCPU();
99 
100  void setSystem(System *system);
101 
102  void setIcachePort(MasterPort *icache_port);
103 
104  void setDcachePort(MasterPort *dcache_port);
105 
106  Port &
107  getDataPort() override
108  {
109  // the checker does not have ports on its own so return the
110  // data port of the actual CPU core
111  assert(dcachePort);
112  return *dcachePort;
113  }
114 
115  Port &
116  getInstPort() override
117  {
118  // the checker does not have ports on its own so return the
119  // data port of the actual CPU core
120  assert(icachePort);
121  return *icachePort;
122  }
123 
124  protected:
125 
127 
129 
132 
134 
137 
138  // ISAs like ARM can have multiple destination registers to check,
139  // keep them all in a std::queue
140  std::queue<InstResult> result;
141 
144 
145  // number of simulated instructions
148 
149  std::queue<int> miscRegIdxs;
150 
151  public:
152 
153  // Primary thread being run.
155 
156  BaseTLB* getITBPtr() { return itb; }
157  BaseTLB* getDTBPtr() { return dtb; }
158 
159  virtual Counter totalInsts() const override
160  {
161  return 0;
162  }
163 
164  virtual Counter totalOps() const override
165  {
166  return 0;
167  }
168 
169  // number of simulated loads
172 
173  void serialize(CheckpointOut &cp) const override;
174  void unserialize(CheckpointIn &cp) override;
175 
176  // The register accessor methods provide the index of the
177  // instruction's operand (e.g., 0 or 1), not the architectural
178  // register index, to simplify the implementation of register
179  // renaming. We find the architectural register index by indexing
180  // into the instruction's own operand index table. Note that a
181  // raw pointer to the StaticInst is provided instead of a
182  // ref-counted StaticInstPtr to redice overhead. This is fine as
183  // long as these methods don't copy the pointer into any long-term
184  // storage (which is pretty hard to imagine they would have reason
185  // to do).
186 
187  RegVal
188  readIntRegOperand(const StaticInst *si, int idx) override
189  {
190  const RegId& reg = si->srcRegIdx(idx);
191  assert(reg.isIntReg());
192  return thread->readIntReg(reg.index());
193  }
194 
195  RegVal
196  readFloatRegOperandBits(const StaticInst *si, int idx) override
197  {
198  const RegId& reg = si->srcRegIdx(idx);
199  assert(reg.isFloatReg());
200  return thread->readFloatReg(reg.index());
201  }
202 
206  const VecRegContainer &
207  readVecRegOperand(const StaticInst *si, int idx) const override
208  {
209  const RegId& reg = si->srcRegIdx(idx);
210  assert(reg.isVecReg());
211  return thread->readVecReg(reg);
212  }
213 
218  getWritableVecRegOperand(const StaticInst *si, int idx) override
219  {
220  const RegId& reg = si->destRegIdx(idx);
221  assert(reg.isVecReg());
222  return thread->getWritableVecReg(reg);
223  }
224 
228  virtual ConstVecLane8
229  readVec8BitLaneOperand(const StaticInst *si, int idx) const override
230  {
231  const RegId& reg = si->destRegIdx(idx);
232  assert(reg.isVecReg());
233  return thread->readVec8BitLaneReg(reg);
234  }
235 
237  virtual ConstVecLane16
238  readVec16BitLaneOperand(const StaticInst *si, int idx) const override
239  {
240  const RegId& reg = si->destRegIdx(idx);
241  assert(reg.isVecReg());
242  return thread->readVec16BitLaneReg(reg);
243  }
244 
246  virtual ConstVecLane32
247  readVec32BitLaneOperand(const StaticInst *si, int idx) const override
248  {
249  const RegId& reg = si->destRegIdx(idx);
250  assert(reg.isVecReg());
251  return thread->readVec32BitLaneReg(reg);
252  }
253 
255  virtual ConstVecLane64
256  readVec64BitLaneOperand(const StaticInst *si, int idx) const override
257  {
258  const RegId& reg = si->destRegIdx(idx);
259  assert(reg.isVecReg());
260  return thread->readVec64BitLaneReg(reg);
261  }
262 
264  template <typename LD>
265  void
266  setVecLaneOperandT(const StaticInst *si, int idx, const LD& val)
267  {
268  const RegId& reg = si->destRegIdx(idx);
269  assert(reg.isVecReg());
270  return thread->setVecLane(reg, val);
271  }
272  virtual void
273  setVecLaneOperand(const StaticInst *si, int idx,
274  const LaneData<LaneSize::Byte>& val) override
275  {
276  setVecLaneOperandT(si, idx, val);
277  }
278  virtual void
279  setVecLaneOperand(const StaticInst *si, int idx,
280  const LaneData<LaneSize::TwoByte>& val) override
281  {
282  setVecLaneOperandT(si, idx, val);
283  }
284  virtual void
285  setVecLaneOperand(const StaticInst *si, int idx,
286  const LaneData<LaneSize::FourByte>& val) override
287  {
288  setVecLaneOperandT(si, idx, val);
289  }
290  virtual void
291  setVecLaneOperand(const StaticInst *si, int idx,
292  const LaneData<LaneSize::EightByte>& val) override
293  {
294  setVecLaneOperandT(si, idx, val);
295  }
298  VecElem
299  readVecElemOperand(const StaticInst *si, int idx) const override
300  {
301  const RegId& reg = si->srcRegIdx(idx);
302  return thread->readVecElem(reg);
303  }
304 
305  const VecPredRegContainer&
306  readVecPredRegOperand(const StaticInst *si, int idx) const override
307  {
308  const RegId& reg = si->srcRegIdx(idx);
309  assert(reg.isVecPredReg());
310  return thread->readVecPredReg(reg);
311  }
312 
314  getWritableVecPredRegOperand(const StaticInst *si, int idx) override
315  {
316  const RegId& reg = si->destRegIdx(idx);
317  assert(reg.isVecPredReg());
318  return thread->getWritableVecPredReg(reg);
319  }
320 
321  RegVal
322  readCCRegOperand(const StaticInst *si, int idx) override
323  {
324  const RegId& reg = si->srcRegIdx(idx);
325  assert(reg.isCCReg());
326  return thread->readCCReg(reg.index());
327  }
328 
329  template<typename T>
330  void
332  {
333  result.push(InstResult(std::forward<T>(t),
335  }
336 
337  template<typename T>
338  void
340  {
341  result.push(InstResult(std::forward<T>(t),
343  }
344 
345  template<typename T>
346  void
348  {
349  result.push(InstResult(std::forward<T>(t),
351  }
352 
353  template<typename T>
354  void
356  {
357  result.push(InstResult(std::forward<T>(t),
359  }
360 
361  void
362  setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
363  {
364  const RegId& reg = si->destRegIdx(idx);
365  assert(reg.isIntReg());
366  thread->setIntReg(reg.index(), val);
367  setScalarResult(val);
368  }
369 
370  void
371  setFloatRegOperandBits(const StaticInst *si, int idx, RegVal val) override
372  {
373  const RegId& reg = si->destRegIdx(idx);
374  assert(reg.isFloatReg());
375  thread->setFloatReg(reg.index(), val);
376  setScalarResult(val);
377  }
378 
379  void
380  setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
381  {
382  const RegId& reg = si->destRegIdx(idx);
383  assert(reg.isCCReg());
384  thread->setCCReg(reg.index(), val);
385  setScalarResult((uint64_t)val);
386  }
387 
388  void
389  setVecRegOperand(const StaticInst *si, int idx,
390  const VecRegContainer& val) override
391  {
392  const RegId& reg = si->destRegIdx(idx);
393  assert(reg.isVecReg());
394  thread->setVecReg(reg, val);
395  setVecResult(val);
396  }
397 
398  void
399  setVecElemOperand(const StaticInst *si, int idx,
400  const VecElem val) override
401  {
402  const RegId& reg = si->destRegIdx(idx);
403  assert(reg.isVecElem());
404  thread->setVecElem(reg, val);
405  setVecElemResult(val);
406  }
407 
408  void setVecPredRegOperand(const StaticInst *si, int idx,
409  const VecPredRegContainer& val) override
410  {
411  const RegId& reg = si->destRegIdx(idx);
412  assert(reg.isVecPredReg());
413  thread->setVecPredReg(reg, val);
414  setVecPredResult(val);
415  }
416 
417  bool readPredicate() const override { return thread->readPredicate(); }
418 
419  void
420  setPredicate(bool val) override
421  {
422  thread->setPredicate(val);
423  }
424 
425  bool
426  readMemAccPredicate() const override
427  {
428  return thread->readMemAccPredicate();
429  }
430 
431  void
432  setMemAccPredicate(bool val) override
433  {
434  thread->setMemAccPredicate(val);
435  }
436 
437  TheISA::PCState pcState() const override { return thread->pcState(); }
438  void
439  pcState(const TheISA::PCState &val) override
440  {
441  DPRINTF(Checker, "Changing PC to %s, old PC %s.\n",
442  val, thread->pcState());
443  thread->pcState(val);
444  }
445  Addr instAddr() { return thread->instAddr(); }
446  Addr nextInstAddr() { return thread->nextInstAddr(); }
447  MicroPC microPC() { return thread->microPC(); }
449 
450  RegVal
451  readMiscRegNoEffect(int misc_reg) const
452  {
453  return thread->readMiscRegNoEffect(misc_reg);
454  }
455 
456  RegVal
457  readMiscReg(int misc_reg) override
458  {
459  return thread->readMiscReg(misc_reg);
460  }
461 
462  void
464  {
465  DPRINTF(Checker, "Setting misc reg %d with no effect to check later\n",
466  misc_reg);
467  miscRegIdxs.push(misc_reg);
468  return thread->setMiscRegNoEffect(misc_reg, val);
469  }
470 
471  void
472  setMiscReg(int misc_reg, RegVal val) override
473  {
474  DPRINTF(Checker, "Setting misc reg %d with effect to check later\n",
475  misc_reg);
476  miscRegIdxs.push(misc_reg);
477  return thread->setMiscReg(misc_reg, val);
478  }
479 
480  RegVal
481  readMiscRegOperand(const StaticInst *si, int idx) override
482  {
483  const RegId& reg = si->srcRegIdx(idx);
484  assert(reg.isMiscReg());
485  return thread->readMiscReg(reg.index());
486  }
487 
488  void
489  setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
490  {
491  const RegId& reg = si->destRegIdx(idx);
492  assert(reg.isMiscReg());
493  return this->setMiscReg(reg.index(), val);
494  }
495 
497 
498  void
500  {
501  changedPC = true;
502  newPCState = val;
503  }
504 
505  void
506  demapPage(Addr vaddr, uint64_t asn) override
507  {
508  this->itb->demapPage(vaddr, asn);
509  this->dtb->demapPage(vaddr, asn);
510  }
511 
512  // monitor/mwait funtions
513  void armMonitor(Addr address) override { BaseCPU::armMonitor(0, address); }
514  bool mwait(PacketPtr pkt) override { return BaseCPU::mwait(0, pkt); }
515  void mwaitAtomic(ThreadContext *tc) override
516  { return BaseCPU::mwaitAtomic(0, tc, thread->dtb); }
518  { return BaseCPU::getCpuAddrMonitor(0); }
519 
520  void
521  demapInstPage(Addr vaddr, uint64_t asn)
522  {
523  this->itb->demapPage(vaddr, asn);
524  }
525 
526  void
527  demapDataPage(Addr vaddr, uint64_t asn)
528  {
529  this->dtb->demapPage(vaddr, asn);
530  }
531 
548  RequestPtr genMemFragmentRequest(Addr frag_addr, int size,
549  Request::Flags flags,
550  const std::vector<bool>& byte_enable,
551  int& frag_size, int& size_left) const;
552 
553  Fault readMem(Addr addr, uint8_t *data, unsigned size,
554  Request::Flags flags,
555  const std::vector<bool>& byte_enable = std::vector<bool>())
556  override;
557 
558  Fault writeMem(uint8_t *data, unsigned size, Addr addr,
559  Request::Flags flags, uint64_t *res,
560  const std::vector<bool>& byte_enable = std::vector<bool>())
561  override;
562 
563  Fault amoMem(Addr addr, uint8_t* data, unsigned size,
564  Request::Flags flags, AtomicOpFunctorPtr amo_op) override
565  {
566  panic("AMO is not supported yet in CPU checker\n");
567  }
568 
569  unsigned int
570  readStCondFailures() const override {
571  return thread->readStCondFailures();
572  }
573 
574  void setStCondFailures(unsigned int sc_failures) override {}
576 
577  void wakeup(ThreadID tid) override { }
578  // Assume that the normal CPU's call to syscall was successful.
579  // The checker's state would have already been updated by the syscall.
580  void syscall(Fault *fault) override { }
581 
582  void
584  {
585  if (exitOnError)
586  dumpAndExit();
587  }
588 
589  bool checkFlags(const RequestPtr &unverified_req, Addr vAddr,
590  Addr pAddr, int flags);
591 
592  void dumpAndExit();
593 
594  ThreadContext *tcBase() const override { return tc; }
596 
600 
601  bool changedPC;
607 
609 };
610 
617 template <class Impl>
618 class Checker : public CheckerCPU
619 {
620  private:
621  typedef typename Impl::DynInstPtr DynInstPtr;
622 
623  public:
625  : CheckerCPU(p), updateThisCycle(false), unverifiedInst(NULL)
626  { }
627 
628  void switchOut();
629  void takeOverFrom(BaseCPU *oldCPU);
630 
631  void advancePC(const Fault &fault);
632 
633  void verify(const DynInstPtr &inst);
634 
635  void validateInst(const DynInstPtr &inst);
636  void validateExecution(const DynInstPtr &inst);
637  void validateState();
638 
639  void copyResult(const DynInstPtr &inst, const InstResult& mismatch_val,
640  int start_idx);
641  void handlePendingInt();
642 
643  private:
644  void handleError(const DynInstPtr &inst)
645  {
646  if (exitOnError) {
647  dumpAndExit(inst);
648  } else if (updateOnError) {
649  updateThisCycle = true;
650  }
651  }
652 
653  void dumpAndExit(const DynInstPtr &inst);
654 
656 
657  DynInstPtr unverifiedInst;
658 
661  void dumpInsts();
662 };
663 
664 #endif // __CPU_CHECKER_CPU_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
Definition: port.hh:71
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:163
uint32_t MachInst
Definition: types.hh:52
#define DPRINTF(x,...)
Definition: trace.hh:225
RequestPtr unverifiedReq
Definition: cpu.hh:598
virtual void setVecLane(const RegId &reg, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector register.
Ports are used to interface objects to each other.
Definition: port.hh:56
BaseCPUParams Params
Definition: base.hh:306
void setPredicate(bool val) override
Definition: cpu.hh:420
Bitfield< 5, 3 > reg
Definition: types.hh:87
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
Definition: cpu.hh:570
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
Definition: base.hh:610
void setMemAccPredicate(bool val) override
Definition: cpu.hh:432
bool isMiscReg() const
true if it is a condition-code physical register.
Definition: reg_class.hh:161
std::list< DynInstPtr >::iterator InstListIt
Definition: cpu.hh:660
CheckerCPU class.
Definition: cpu.hh:85
DynInstPtr unverifiedInst
Definition: cpu.hh:657
bool changedPC
Definition: cpu.hh:601
Impl::DynInstPtr DynInstPtr
Definition: cpu.hh:621
std::queue< int > miscRegIdxs
Definition: cpu.hh:149
Vector Register Abstraction This generic class is the model in a particularization of MVC...
Definition: vec_reg.hh:156
bool readPredicate() const
ThreadContext * tcBase() const override
Returns a pointer to the ThreadContext.
Definition: cpu.hh:594
unsigned readStCondFailures() const override
RegVal readCCReg(RegIndex reg_idx) const override
void wakeup(ThreadID tid) override
Definition: cpu.hh:577
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::EightByte > &val) override
Definition: cpu.hh:291
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::TwoByte > &val) override
Definition: cpu.hh:279
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
virtual Counter totalOps() const override
Definition: cpu.hh:164
std::shared_ptr< Request > RequestPtr
Definition: request.hh:81
bool readPredicate() const override
Definition: cpu.hh:417
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector operand.
Definition: cpu.hh:273
ip6_addr_t addr
Definition: inet.hh:330
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Definition: amo.hh:228
bool checkFlags(const RequestPtr &unverified_req, Addr vAddr, Addr pAddr, int flags)
Checks if the flags set by the Checker and Checkee match.
Definition: cpu.cc:362
const VecPredRegContainer & readVecPredRegOperand(const StaticInst *si, int idx) const override
Predicate registers interface.
Definition: cpu.hh:306
virtual Counter totalInsts() const override
Definition: cpu.hh:159
bool readMemAccPredicate() const override
Definition: cpu.hh:426
std::list< DynInstPtr > instList
Definition: cpu.hh:659
Addr instAddr()
Definition: cpu.hh:445
TheISA::PCState pcState() const override
void setVecElemResult(T &&t)
Definition: cpu.hh:347
uint64_t RegVal
Definition: types.hh:166
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i&#39;th source reg.
Definition: static_inst.hh:222
System * systemPtr
Definition: cpu.hh:128
Definition: system.hh:72
const VecRegContainer & readVecRegOperand(const StaticInst *si, int idx) const override
Read source vector register operand.
Definition: cpu.hh:207
InstResult unverifiedResult
Definition: cpu.hh:597
System * system
Definition: base.hh:382
Definition: cprintf.cc:40
void setMemAccPredicate(bool val)
bool willChangePC
Definition: cpu.hh:602
StaticInstPtr curMacroStaticInst
Definition: cpu.hh:143
Addr nextInstAddr()
Definition: cpu.hh:446
void setDcachePort(MasterPort *dcache_port)
Definition: cpu.cc:124
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Declaration of Statistics objects.
VecPredRegContainer & getWritableVecPredReg(const RegId &reg) override
RegVal readMiscReg(RegIndex misc_reg) override
STL vector class.
Definition: stl.hh:37
bool updateOnError
Definition: cpu.hh:605
Bitfield< 63 > val
Definition: misc.hh:769
VecRegContainer & getWritableVecReg(const RegId &reg) override
Templated Checker class.
Definition: cpu.hh:618
void armMonitor(ThreadID tid, Addr address)
Definition: base.cc:210
bool isCCReg() const
true if it is a condition-code physical register.
Definition: reg_class.hh:158
Bitfield< 15, 0 > si
Definition: types.hh:53
void setVecLaneOperandT(const StaticInst *si, int idx, const LD &val)
Write a lane of the destination vector operand.
Definition: cpu.hh:266
void setVecElem(const RegId &reg, const VecElem &val) override
virtual ConstVecLane32 readVec32BitLaneReg(const RegId &reg) const override
Reads source vector 32bit operand.
bool isVecElem() const
true if it is a condition-code physical register.
Definition: reg_class.hh:152
AddressMonitor * getAddrMonitor() override
Definition: cpu.hh:517
void setIntReg(RegIndex reg_idx, RegVal val) override
void setStCondFailures(unsigned int sc_failures) override
Sets the number of consecutive store conditional failures.
Definition: cpu.hh:574
Definition: tlb.hh:50
LaneSize is an abstraction of a LS byte value for the execution and thread contexts to handle values ...
Definition: vec_reg.hh:458
Addr nextInstAddr() const override
virtual ConstVecLane64 readVec64BitLaneReg(const RegId &reg) const override
Reads source vector 64bit operand.
virtual ConstVecLane64 readVec64BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 64bit operand.
Definition: cpu.hh:256
void pcState(const TheISA::PCState &val) override
Definition: cpu.hh:439
virtual ConstVecLane16 readVec16BitLaneReg(const RegId &reg) const override
Reads source vector 16bit operand.
ThreadContext * tc
Definition: cpu.hh:133
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
Definition: exec_context.hh:70
bool readMemAccPredicate()
TheISA::PCState pcState() const override
Definition: cpu.hh:437
void setCCReg(RegIndex reg_idx, RegVal val) override
MicroPC microPC()
Definition: cpu.hh:447
bool mwait(PacketPtr pkt) override
Definition: cpu.hh:514
RegVal readIntReg(RegIndex reg_idx) const override
void setFloatReg(RegIndex reg_idx, RegVal val) override
RegVal readIntRegOperand(const StaticInst *si, int idx) override
Reads an integer register.
Definition: cpu.hh:188
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:555
MasterID masterId
id attached to all issued requests
Definition: cpu.hh:92
RequestPtr genMemFragmentRequest(Addr frag_addr, int size, Request::Flags flags, const std::vector< bool > &byte_enable, int &frag_size, int &size_left) const
Helper function used to generate the request for a single fragment of a memory access.
Definition: cpu.cc:140
VecRegContainer & getWritableVecRegOperand(const StaticInst *si, int idx) override
Read destination vector register operand for modification.
Definition: cpu.hh:218
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::FourByte > &val) override
Definition: cpu.hh:285
void setMiscRegNoEffect(RegIndex misc_reg, RegVal val) override
const VecPredRegContainer & readVecPredReg(const RegId &reg) const override
SimpleThread * threadBase()
Definition: cpu.hh:595
uint8_t * unverifiedMemData
Definition: cpu.hh:599
void setVecElemOperand(const StaticInst *si, int idx, const VecElem val) override
Sets a vector register to a value.
Definition: cpu.hh:399
bool exitOnError
Definition: cpu.hh:604
uint16_t MicroPC
Definition: types.hh:142
uint64_t InstSeqNum
Definition: inst_seq.hh:37
void demapInstPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:521
bool isIntReg() const
Definition: reg_class.hh:143
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseTLB *dtb)
Definition: base.cc:245
void setMiscReg(RegIndex misc_reg, RegVal val) override
RegVal readCCRegOperand(const StaticInst *si, int idx) override
Definition: cpu.hh:322
RegVal readMiscReg(int misc_reg) override
Reads a miscellaneous register, handling any architectural side effects due to reading that register...
Definition: cpu.hh:457
virtual ConstVecLane16 readVec16BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 16bit operand.
Definition: cpu.hh:238
void advancePC(PCState &pc, const StaticInstPtr &inst)
Definition: utility.hh:393
Counter startNumInst
Definition: cpu.hh:147
std::queue< InstResult > result
Definition: cpu.hh:140
BaseTLB * getDTBPtr()
Definition: cpu.hh:157
void handleError(const DynInstPtr &inst)
Definition: cpu.hh:644
Fault amoMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op) override
Definition: cpu.hh:563
Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable=std::vector< bool >()) override
Definition: cpu.cc:257
bool isFloatReg() const
Definition: reg_class.hh:146
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:140
bool updateThisCycle
Definition: cpu.hh:655
uint16_t MasterID
Definition: request.hh:84
void setFloatRegOperandBits(const StaticInst *si, int idx, RegVal val) override
Sets the bits of a floating point register of single width to a binary value.
Definition: cpu.hh:371
void setMiscReg(int misc_reg, RegVal val) override
Sets a miscellaneous register, handling any architectural side effects due to writing that register...
Definition: cpu.hh:472
int64_t Counter
Statistics counter type.
Definition: types.hh:56
void syscall(Fault *fault) override
Executes a syscall.
Definition: cpu.hh:580
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:249
Addr instAddr() const override
RegVal readMiscRegNoEffect(int misc_reg) const
Definition: cpu.hh:451
virtual void switchOut()
Prepare for another CPU to take over execution.
Definition: base.cc:539
Port & getInstPort() override
Purely virtual method that returns a reference to the instruction port.
Definition: cpu.hh:116
void setMiscRegNoEffect(int misc_reg, RegVal val)
Definition: cpu.hh:463
SimpleThread * thread
Definition: cpu.hh:154
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >()) override
Definition: cpu.cc:173
virtual ConstVecLane32 readVec32BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 32bit operand.
Definition: cpu.hh:247
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
Definition: cpu.cc:130
bool isVecReg() const
true if it is a condition-code physical register.
Definition: reg_class.hh:149
VecPredRegContainer & getWritableVecPredRegOperand(const StaticInst *si, int idx) override
Gets destination predicate register operand for modification.
Definition: cpu.hh:314
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:225
CheckerCPUParams Params
Definition: cpu.hh:96
bool mwait(ThreadID tid, PacketPtr pkt)
Definition: base.cc:222
void setVecResult(T &&t)
Definition: cpu.hh:339
Counter startNumLoad
Definition: cpu.hh:171
void setIcachePort(MasterPort *icache_port)
Definition: cpu.cc:118
Counter numInst
Definition: cpu.hh:146
void setVecPredResult(T &&t)
Definition: cpu.hh:355
MasterPort * icachePort
Definition: cpu.hh:130
std::ostream CheckpointOut
Definition: serialize.hh:63
VecReg::Container VecRegContainer
Definition: registers.hh:71
std::vector< Process * > workload
Definition: cpu.hh:126
void setSystem(System *system)
Definition: cpu.cc:95
void demapPage(Addr vaddr, uint64_t asn) override
Invalidate a page in the DTLB and ITLB.
Definition: cpu.hh:506
const VecElem & readVecElem(const RegId &reg) const override
Generic predicate register container.
Definition: vec_pred_reg.hh:47
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
Definition: cpu.hh:481
virtual ~CheckerCPU()
Definition: cpu.cc:90
RegVal readFloatReg(RegIndex reg_idx) const override
bool warnOnlyOnLoadError
Definition: cpu.hh:606
MicroPC microPC() const override
Base, ISA-independent static instruction class.
Definition: static_inst.hh:85
const RegIndex & index() const
Index accessors.
Definition: reg_class.hh:173
void setVecPredReg(const RegId &reg, const VecPredRegContainer &val) override
virtual void demapPage(Addr vaddr, uint64_t asn)=0
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i&#39;th destination reg.
Definition: static_inst.hh:218
Defines a dynamic instruction context.
Counter numLoad
Definition: cpu.hh:170
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:75
BaseTLB * itb
Definition: cpu.hh:135
void setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
Sets an integer register to a value.
Definition: cpu.hh:362
void recordPCChange(const TheISA::PCState &val)
Definition: cpu.hh:499
void armMonitor(Addr address) override
Definition: cpu.hh:513
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
Definition: cpu.hh:489
TheISA::MachInst MachInst
Definition: cpu.hh:88
bool isVecPredReg() const
true if it is a predicate physical register.
Definition: reg_class.hh:155
void setVecReg(const RegId &reg, const VecRegContainer &val) override
Bitfield< 5 > t
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: cpu.cc:59
void setScalarResult(T &&t)
Definition: cpu.hh:331
void setVecPredRegOperand(const StaticInst *si, int idx, const VecPredRegContainer &val) override
Sets a destination predicate register operand to a value.
Definition: cpu.hh:408
CheckerCPU(Params *p)
Definition: cpu.cc:64
BaseTLB * getITBPtr()
Definition: cpu.hh:156
void demapDataPage(Addr vaddr, uint64_t asn)
Definition: cpu.hh:527
Vector Lane abstraction Another view of a container.
Definition: vec_reg.hh:262
void setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
Definition: cpu.hh:380
void setVecRegOperand(const StaticInst *si, int idx, const VecRegContainer &val) override
Sets a destination vector register operand to a value.
Definition: cpu.hh:389
TheISA::PCState newPCState
Definition: cpu.hh:603
GenericISA::DelaySlotPCState< MachInst > PCState
Definition: types.hh:41
TheISA::VecElem VecElem
Definition: exec_context.hh:75
Bitfield< 0 > p
StaticInstPtr curStaticInst
Definition: cpu.hh:142
Port & getDataPort() override
Purely virtual method that returns a reference to the data port.
Definition: cpu.hh:107
const char data[]
std::shared_ptr< FaultBase > Fault
Definition: types.hh:238
virtual ConstVecLane8 readVec8BitLaneReg(const RegId &reg) const override
Reads source vector 8bit operand.
BaseTLB * dtb
Definition: cpu.hh:136
const VecRegContainer & readVecReg(const RegId &reg) const override
RegVal readFloatRegOperandBits(const StaticInst *si, int idx) override
Reads a floating point register in its binary format, instead of by value.
Definition: cpu.hh:196
InstSeqNum youngestSN
Definition: cpu.hh:608
void mwaitAtomic(ThreadContext *tc) override
Definition: cpu.hh:515
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
Definition: cpu.cc:135
MasterPort * dcachePort
Definition: cpu.hh:131
virtual ConstVecLane8 readVec8BitLaneOperand(const StaticInst *si, int idx) const override
Vector Register Lane Interfaces.
Definition: cpu.hh:229
void dumpAndExit()
Definition: cpu.cc:379
void handleError()
Definition: cpu.hh:583
RegVal readMiscRegNoEffect(RegIndex misc_reg) const override
BaseTLB * dtb
void setPredicate(bool val)
Checker(Params *p)
Definition: cpu.hh:624
VecElem readVecElemOperand(const StaticInst *si, int idx) const override
Vector Elem Interfaces.
Definition: cpu.hh:299

Generated on Thu May 28 2020 16:11:00 for gem5 by doxygen 1.8.13