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

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