gem5  v20.1.0.0
simple_thread.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2012, 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) 2001-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_SIMPLE_THREAD_HH__
43 #define __CPU_SIMPLE_THREAD_HH__
44 
45 #include <array>
46 
47 #include "arch/decoder.hh"
48 #include "arch/generic/htm.hh"
49 #include "arch/generic/tlb.hh"
50 #include "arch/isa.hh"
51 #include "arch/registers.hh"
52 #include "arch/types.hh"
53 #include "base/types.hh"
54 #include "config/the_isa.hh"
55 #include "cpu/thread_context.hh"
56 #include "cpu/thread_state.hh"
57 #include "debug/CCRegs.hh"
58 #include "debug/FloatRegs.hh"
59 #include "debug/IntRegs.hh"
60 #include "debug/VecPredRegs.hh"
61 #include "debug/VecRegs.hh"
62 #include "mem/htm.hh"
63 #include "mem/page_table.hh"
64 #include "mem/request.hh"
65 #include "sim/byteswap.hh"
66 #include "sim/eventq.hh"
67 #include "sim/full_system.hh"
68 #include "sim/process.hh"
69 #include "sim/serialize.hh"
70 #include "sim/system.hh"
71 
72 class BaseCPU;
73 class CheckerCPU;
74 
89 class SimpleThread : public ThreadState, public ThreadContext
90 {
91  protected:
96  public:
98 
99  protected:
100  std::array<RegVal, TheISA::NumFloatRegs> floatRegs;
101  std::array<RegVal, TheISA::NumIntRegs> intRegs;
102  std::array<VecRegContainer, TheISA::NumVecRegs> vecRegs;
103  std::array<VecPredRegContainer, TheISA::NumVecPredRegs> vecPredRegs;
104  std::array<RegVal, TheISA::NumCCRegs> ccRegs;
105  TheISA::ISA *const isa; // one "instance" of the current ISA.
106 
108 
109  // hardware transactional memory
110  std::unique_ptr<BaseHTMCheckpoint> _htmCheckpoint;
111 
113  bool predicate;
114 
117 
118  public:
119  std::string name() const
120  {
121  return csprintf("%s.[tid:%i]", baseCpu->name(), threadId());
122  }
123 
130 
132 
135 
136  TheISA::Decoder decoder;
137 
138  // hardware transactional memory
141 
142  // constructor: initialize SimpleThread from given process structure
143  // FS
144  SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system,
145  BaseTLB *_itb, BaseTLB *_dtb, BaseISA *_isa);
146  // SE
147  SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system,
148  Process *_process, BaseTLB *_itb, BaseTLB *_dtb,
149  BaseISA *_isa);
150 
151  virtual ~SimpleThread() {}
152 
153  void takeOverFrom(ThreadContext *oldContext) override;
154 
155  void copyState(ThreadContext *oldContext);
156 
157  void serialize(CheckpointOut &cp) const override;
158  void unserialize(CheckpointIn &cp) override;
159 
160  /***************************************************************
161  * SimpleThread functions to provide CPU with access to various
162  * state.
163  **************************************************************/
164 
169  ThreadContext *getTC() { return this; }
170 
171  void demapPage(Addr vaddr, uint64_t asn)
172  {
173  itb->demapPage(vaddr, asn);
174  dtb->demapPage(vaddr, asn);
175  }
176 
177  void demapInstPage(Addr vaddr, uint64_t asn)
178  {
179  itb->demapPage(vaddr, asn);
180  }
181 
182  void demapDataPage(Addr vaddr, uint64_t asn)
183  {
184  dtb->demapPage(vaddr, asn);
185  }
186 
187  /*******************************************
188  * ThreadContext interface functions.
189  ******************************************/
190 
191  bool schedule(PCEvent *e) override { return pcEventQueue.schedule(e); }
192  bool remove(PCEvent *e) override { return pcEventQueue.remove(e); }
193 
194  void
196  {
198  }
199  void
201  {
203  }
204  Tick
206  {
207  return comInstEventQueue.getCurTick();
208  }
209 
210  BaseCPU *getCpuPtr() override { return baseCpu; }
211 
212  int cpuId() const override { return ThreadState::cpuId(); }
213  uint32_t socketId() const override { return ThreadState::socketId(); }
214  int threadId() const override { return ThreadState::threadId(); }
215  void setThreadId(int id) override { ThreadState::setThreadId(id); }
216  ContextID contextId() const override { return ThreadState::contextId(); }
218 
219  BaseTLB *getITBPtr() override { return itb; }
220 
221  BaseTLB *getDTBPtr() override { return dtb; }
222 
223  CheckerCPU *getCheckerCpuPtr() override { return NULL; }
224 
225  BaseISA *getIsaPtr() override { return isa; }
226 
227  TheISA::Decoder *getDecoderPtr() override { return &decoder; }
228 
229  System *getSystemPtr() override { return system; }
230 
233 
234  void initMemProxies(ThreadContext *tc) override
235  {
237  }
238 
241 
242  Status status() const override { return _status; }
243 
244  void setStatus(Status newStatus) override { _status = newStatus; }
245 
247  void activate() override;
248 
250  void suspend() override;
251 
253  void halt() override;
254 
255  Tick
256  readLastActivate() override
257  {
259  }
260  Tick
261  readLastSuspend() override
262  {
264  }
265 
266  void copyArchRegs(ThreadContext *tc) override;
267 
268  void
269  clearArchRegs() override
270  {
271  _pcState = 0;
272  intRegs.fill(0);
273  floatRegs.fill(0);
274  for (auto &vec_reg: vecRegs)
275  vec_reg.zero();
276  for (auto &pred_reg: vecPredRegs)
277  pred_reg.reset();
278  ccRegs.fill(0);
279  isa->clear();
280  }
281 
282  //
283  // New accessors for new decoder.
284  //
285  RegVal
286  readIntReg(RegIndex reg_idx) const override
287  {
288  int flatIndex = isa->flattenIntIndex(reg_idx);
289  assert(flatIndex < TheISA::NumIntRegs);
290  uint64_t regVal(readIntRegFlat(flatIndex));
291  DPRINTF(IntRegs, "Reading int reg %d (%d) as %#x.\n",
292  reg_idx, flatIndex, regVal);
293  return regVal;
294  }
295 
296  RegVal
297  readFloatReg(RegIndex reg_idx) const override
298  {
299  int flatIndex = isa->flattenFloatIndex(reg_idx);
300  assert(flatIndex < TheISA::NumFloatRegs);
301  RegVal regVal(readFloatRegFlat(flatIndex));
302  DPRINTF(FloatRegs, "Reading float reg %d (%d) bits as %#x.\n",
303  reg_idx, flatIndex, regVal);
304  return regVal;
305  }
306 
307  const VecRegContainer&
308  readVecReg(const RegId& reg) const override
309  {
310  int flatIndex = isa->flattenVecIndex(reg.index());
311  assert(flatIndex < TheISA::NumVecRegs);
312  const VecRegContainer& regVal = readVecRegFlat(flatIndex);
313  DPRINTF(VecRegs, "Reading vector reg %d (%d) as %s.\n",
314  reg.index(), flatIndex, regVal.print());
315  return regVal;
316  }
317 
319  getWritableVecReg(const RegId& reg) override
320  {
321  int flatIndex = isa->flattenVecIndex(reg.index());
322  assert(flatIndex < TheISA::NumVecRegs);
323  VecRegContainer& regVal = getWritableVecRegFlat(flatIndex);
324  DPRINTF(VecRegs, "Reading vector reg %d (%d) as %s for modify.\n",
325  reg.index(), flatIndex, regVal.print());
326  return regVal;
327  }
328 
332  template <typename T>
334  readVecLane(const RegId& reg) const
335  {
336  int flatIndex = isa->flattenVecIndex(reg.index());
337  assert(flatIndex < TheISA::NumVecRegs);
338  auto regVal = readVecLaneFlat<T>(flatIndex, reg.elemIndex());
339  DPRINTF(VecRegs, "Reading vector lane %d (%d)[%d] as %lx.\n",
340  reg.index(), flatIndex, reg.elemIndex(), regVal);
341  return regVal;
342  }
343 
345  virtual ConstVecLane8
346  readVec8BitLaneReg(const RegId &reg) const override
347  {
348  return readVecLane<uint8_t>(reg);
349  }
350 
352  virtual ConstVecLane16
353  readVec16BitLaneReg(const RegId &reg) const override
354  {
355  return readVecLane<uint16_t>(reg);
356  }
357 
359  virtual ConstVecLane32
360  readVec32BitLaneReg(const RegId &reg) const override
361  {
362  return readVecLane<uint32_t>(reg);
363  }
364 
366  virtual ConstVecLane64
367  readVec64BitLaneReg(const RegId &reg) const override
368  {
369  return readVecLane<uint64_t>(reg);
370  }
371 
373  template <typename LD>
374  void
375  setVecLaneT(const RegId &reg, const LD &val)
376  {
377  int flatIndex = isa->flattenVecIndex(reg.index());
378  assert(flatIndex < TheISA::NumVecRegs);
379  setVecLaneFlat(flatIndex, reg.elemIndex(), val);
380  DPRINTF(VecRegs, "Reading vector lane %d (%d)[%d] to %lx.\n",
381  reg.index(), flatIndex, reg.elemIndex(), val);
382  }
383  virtual void
385  {
386  return setVecLaneT(reg, val);
387  }
388  virtual void
390  const LaneData<LaneSize::TwoByte> &val) override
391  {
392  return setVecLaneT(reg, val);
393  }
394  virtual void
396  const LaneData<LaneSize::FourByte> &val) override
397  {
398  return setVecLaneT(reg, val);
399  }
400  virtual void
402  const LaneData<LaneSize::EightByte> &val) override
403  {
404  return setVecLaneT(reg, val);
405  }
408  const VecElem &
409  readVecElem(const RegId &reg) const override
410  {
411  int flatIndex = isa->flattenVecElemIndex(reg.index());
412  assert(flatIndex < TheISA::NumVecRegs);
413  const VecElem& regVal = readVecElemFlat(flatIndex, reg.elemIndex());
414  DPRINTF(VecRegs, "Reading element %d of vector reg %d (%d) as"
415  " %#x.\n", reg.elemIndex(), reg.index(), flatIndex, regVal);
416  return regVal;
417  }
418 
419  const VecPredRegContainer &
420  readVecPredReg(const RegId &reg) const override
421  {
422  int flatIndex = isa->flattenVecPredIndex(reg.index());
423  assert(flatIndex < TheISA::NumVecPredRegs);
424  const VecPredRegContainer& regVal = readVecPredRegFlat(flatIndex);
425  DPRINTF(VecPredRegs, "Reading predicate reg %d (%d) as %s.\n",
426  reg.index(), flatIndex, regVal.print());
427  return regVal;
428  }
429 
431  getWritableVecPredReg(const RegId &reg) override
432  {
433  int flatIndex = isa->flattenVecPredIndex(reg.index());
434  assert(flatIndex < TheISA::NumVecPredRegs);
435  VecPredRegContainer& regVal = getWritableVecPredRegFlat(flatIndex);
436  DPRINTF(VecPredRegs,
437  "Reading predicate reg %d (%d) as %s for modify.\n",
438  reg.index(), flatIndex, regVal.print());
439  return regVal;
440  }
441 
442  RegVal
443  readCCReg(RegIndex reg_idx) const override
444  {
445  int flatIndex = isa->flattenCCIndex(reg_idx);
446  assert(0 <= flatIndex);
447  assert(flatIndex < TheISA::NumCCRegs);
448  uint64_t regVal(readCCRegFlat(flatIndex));
449  DPRINTF(CCRegs, "Reading CC reg %d (%d) as %#x.\n",
450  reg_idx, flatIndex, regVal);
451  return regVal;
452  }
453 
454  void
455  setIntReg(RegIndex reg_idx, RegVal val) override
456  {
457  int flatIndex = isa->flattenIntIndex(reg_idx);
458  assert(flatIndex < TheISA::NumIntRegs);
459  DPRINTF(IntRegs, "Setting int reg %d (%d) to %#x.\n",
460  reg_idx, flatIndex, val);
461  setIntRegFlat(flatIndex, val);
462  }
463 
464  void
465  setFloatReg(RegIndex reg_idx, RegVal val) override
466  {
467  int flatIndex = isa->flattenFloatIndex(reg_idx);
468  assert(flatIndex < TheISA::NumFloatRegs);
469  // XXX: Fix array out of bounds compiler error for gem5.fast
470  // when checkercpu enabled
471  if (flatIndex < TheISA::NumFloatRegs)
472  setFloatRegFlat(flatIndex, val);
473  DPRINTF(FloatRegs, "Setting float reg %d (%d) bits to %#x.\n",
474  reg_idx, flatIndex, val);
475  }
476 
477  void
478  setVecReg(const RegId &reg, const VecRegContainer &val) override
479  {
480  int flatIndex = isa->flattenVecIndex(reg.index());
481  assert(flatIndex < TheISA::NumVecRegs);
482  setVecRegFlat(flatIndex, val);
483  DPRINTF(VecRegs, "Setting vector reg %d (%d) to %s.\n",
484  reg.index(), flatIndex, val.print());
485  }
486 
487  void
488  setVecElem(const RegId &reg, const VecElem &val) override
489  {
490  int flatIndex = isa->flattenVecElemIndex(reg.index());
491  assert(flatIndex < TheISA::NumVecRegs);
492  setVecElemFlat(flatIndex, reg.elemIndex(), val);
493  DPRINTF(VecRegs, "Setting element %d of vector reg %d (%d) to"
494  " %#x.\n", reg.elemIndex(), reg.index(), flatIndex, val);
495  }
496 
497  void
498  setVecPredReg(const RegId &reg, const VecPredRegContainer &val) override
499  {
500  int flatIndex = isa->flattenVecPredIndex(reg.index());
501  assert(flatIndex < TheISA::NumVecPredRegs);
502  setVecPredRegFlat(flatIndex, val);
503  DPRINTF(VecPredRegs, "Setting predicate reg %d (%d) to %s.\n",
504  reg.index(), flatIndex, val.print());
505  }
506 
507  void
508  setCCReg(RegIndex reg_idx, RegVal val) override
509  {
510  int flatIndex = isa->flattenCCIndex(reg_idx);
511  assert(flatIndex < TheISA::NumCCRegs);
512  DPRINTF(CCRegs, "Setting CC reg %d (%d) to %#x.\n",
513  reg_idx, flatIndex, val);
514  setCCRegFlat(flatIndex, val);
515  }
516 
517  TheISA::PCState pcState() const override { return _pcState; }
518  void pcState(const TheISA::PCState &val) override { _pcState = val; }
519 
520  void
522  {
523  _pcState = val;
524  }
525 
526  Addr instAddr() const override { return _pcState.instAddr(); }
527  Addr nextInstAddr() const override { return _pcState.nextInstAddr(); }
528  MicroPC microPC() const override { return _pcState.microPC(); }
529  bool readPredicate() const { return predicate; }
530  void setPredicate(bool val) { predicate = val; }
531 
532  RegVal
533  readMiscRegNoEffect(RegIndex misc_reg) const override
534  {
535  return isa->readMiscRegNoEffect(misc_reg);
536  }
537 
538  RegVal
539  readMiscReg(RegIndex misc_reg) override
540  {
541  return isa->readMiscReg(misc_reg);
542  }
543 
544  void
545  setMiscRegNoEffect(RegIndex misc_reg, RegVal val) override
546  {
547  return isa->setMiscRegNoEffect(misc_reg, val);
548  }
549 
550  void
551  setMiscReg(RegIndex misc_reg, RegVal val) override
552  {
553  return isa->setMiscReg(misc_reg, val);
554  }
555 
556  RegId
557  flattenRegId(const RegId& regId) const override
558  {
559  return isa->flattenRegId(regId);
560  }
561 
562  unsigned readStCondFailures() const override { return storeCondFailures; }
563 
564  bool
566  {
567  return memAccPredicate;
568  }
569 
570  void
572  {
574  }
575 
576  void
577  setStCondFailures(unsigned sc_failures) override
578  {
579  storeCondFailures = sc_failures;
580  }
581 
582  Counter
583  readFuncExeInst() const override
584  {
586  }
587 
588  void syscall() override { process->syscall(this); }
589 
590  RegVal readIntRegFlat(RegIndex idx) const override { return intRegs[idx]; }
591  void
593  {
594  intRegs[idx] = val;
595  }
596 
597  RegVal
598  readFloatRegFlat(RegIndex idx) const override
599  {
600  return floatRegs[idx];
601  }
602  void
604  {
605  floatRegs[idx] = val;
606  }
607 
608  const VecRegContainer &
609  readVecRegFlat(RegIndex reg) const override
610  {
611  return vecRegs[reg];
612  }
613 
616  {
617  return vecRegs[reg];
618  }
619 
620  void
622  {
623  vecRegs[reg] = val;
624  }
625 
626  template <typename T>
628  readVecLaneFlat(RegIndex reg, int lId) const
629  {
630  return vecRegs[reg].laneView<T>(lId);
631  }
632 
633  template <typename LD>
634  void
635  setVecLaneFlat(RegIndex reg, int lId, const LD &val)
636  {
637  vecRegs[reg].laneView<typename LD::UnderlyingType>(lId) = val;
638  }
639 
640  const VecElem &
641  readVecElemFlat(RegIndex reg, const ElemIndex &elemIndex) const override
642  {
643  return vecRegs[reg].as<TheISA::VecElem>()[elemIndex];
644  }
645 
646  void
648  const VecElem &val) override
649  {
650  vecRegs[reg].as<TheISA::VecElem>()[elemIndex] = val;
651  }
652 
653  const VecPredRegContainer &
655  {
656  return vecPredRegs[reg];
657  }
658 
661  {
662  return vecPredRegs[reg];
663  }
664 
665  void
667  {
668  vecPredRegs[reg] = val;
669  }
670 
671  RegVal readCCRegFlat(RegIndex idx) const override { return ccRegs[idx]; }
672  void setCCRegFlat(RegIndex idx, RegVal val) override { ccRegs[idx] = val; }
673 
674  // hardware transactional memory
675  void htmAbortTransaction(uint64_t htm_uid,
676  HtmFailureFaultCause cause) override;
677 
679  void setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt) override;
680 };
681 
682 
683 #endif // __CPU_CPU_EXEC_CONTEXT_HH__
SimpleThread::clearArchRegs
void clearArchRegs() override
Definition: simple_thread.hh:269
SimpleThread::setThreadId
void setThreadId(int id) override
Definition: simple_thread.hh:215
SimpleThread::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: simple_thread.cc:122
htm.hh
SimpleThread::htmAbortTransaction
void htmAbortTransaction(uint64_t htm_uid, HtmFailureFaultCause cause) override
Definition: simple_thread.cc:178
SimpleThread::VecElem
TheISA::VecElem VecElem
Definition: simple_thread.hh:94
ThreadState::setProcessPtr
void setProcessPtr(Process *p)
Definition: thread_state.hh:87
SimpleThread::contextId
ContextID contextId() const override
Definition: simple_thread.hh:216
SimpleThread::Status
ThreadContext::Status Status
Definition: simple_thread.hh:97
thread_state.hh
SimpleThread::cpuId
int cpuId() const override
Definition: simple_thread.hh:212
SimpleThread::setVecLane
virtual void setVecLane(const RegId &reg, const LaneData< LaneSize::TwoByte > &val) override
Definition: simple_thread.hh:389
ThreadState::getProcessPtr
Process * getProcessPtr()
Definition: thread_state.hh:85
SimpleThread::setVecLaneFlat
void setVecLaneFlat(RegIndex reg, int lId, const LD &val)
Definition: simple_thread.hh:635
SimpleThread::pcState
TheISA::PCState pcState() const override
Definition: simple_thread.hh:517
SimpleThread::getHtmCheckpointPtr
BaseHTMCheckpointPtr & getHtmCheckpointPtr() override
Definition: simple_thread.cc:191
SimpleThread::setMemAccPredicate
void setMemAccPredicate(bool val)
Definition: simple_thread.hh:571
SimpleThread::readLastSuspend
Tick readLastSuspend() override
Definition: simple_thread.hh:261
system.hh
VecPredRegContainer
Generic predicate register container.
Definition: vec_pred_reg.hh:47
SimpleThread::setVecReg
void setVecReg(const RegId &reg, const VecRegContainer &val) override
Definition: simple_thread.hh:478
ArmISA::VecRegContainer
VecReg::Container VecRegContainer
Definition: registers.hh:71
SimpleThread::readVecReg
const VecRegContainer & readVecReg(const RegId &reg) const override
Definition: simple_thread.hh:308
serialize.hh
SimpleThread::getITBPtr
BaseTLB * getITBPtr() override
Definition: simple_thread.hh:219
SimpleThread::readFloatRegFlat
RegVal readFloatRegFlat(RegIndex idx) const override
Definition: simple_thread.hh:598
SimpleThread::readVecLaneFlat
VecLaneT< T, true > readVecLaneFlat(RegIndex reg, int lId) const
Definition: simple_thread.hh:628
Process
Definition: process.hh:65
SimpleThread::readVec8BitLaneReg
virtual ConstVecLane8 readVec8BitLaneReg(const RegId &reg) const override
Reads source vector 8bit operand.
Definition: simple_thread.hh:346
SimpleThread::setProcessPtr
void setProcessPtr(Process *p) override
Definition: simple_thread.hh:240
ArmISA::MachInst
uint32_t MachInst
Definition: types.hh:52
SimpleThread::getDecoderPtr
TheISA::Decoder * getDecoderPtr() override
Definition: simple_thread.hh:227
SimpleThread::setFloatRegFlat
void setFloatRegFlat(RegIndex idx, RegVal val) override
Definition: simple_thread.hh:603
SimpleThread::readLastActivate
Tick readLastActivate() override
Definition: simple_thread.hh:256
ContextID
int ContextID
Globally unique thread context ID.
Definition: types.hh:231
SimpleThread::getWritableVecReg
VecRegContainer & getWritableVecReg(const RegId &reg) override
Definition: simple_thread.hh:319
SimpleThread::vecPredRegs
std::array< VecPredRegContainer, TheISA::NumVecPredRegs > vecPredRegs
Definition: simple_thread.hh:103
SimpleThread::readMiscRegNoEffect
RegVal readMiscRegNoEffect(RegIndex misc_reg) const override
Definition: simple_thread.hh:533
ThreadState::socketId
uint32_t socketId() const
Definition: thread_state.hh:59
tlb.hh
htm.hh
SimpleThread::setPredicate
void setPredicate(bool val)
Definition: simple_thread.hh:530
SimpleThread::readVec16BitLaneReg
virtual ConstVecLane16 readVec16BitLaneReg(const RegId &reg) const override
Reads source vector 16bit operand.
Definition: simple_thread.hh:353
VecPredRegContainer::print
const std::string print() const
Returns a string representation of the register content.
Definition: vec_pred_reg.hh:332
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
ArmISA::VecPredRegContainer
VecPredReg::Container VecPredRegContainer
Definition: registers.hh:77
SimpleThread::setIntReg
void setIntReg(RegIndex reg_idx, RegVal val) override
Definition: simple_thread.hh:455
SimpleThread::suspend
void suspend() override
Set the status to Suspended.
Definition: simple_thread.cc:148
SimpleThread::setCCReg
void setCCReg(RegIndex reg_idx, RegVal val) override
Definition: simple_thread.hh:508
SimpleThread::pcEventQueue
PCEventQueue pcEventQueue
Definition: simple_thread.hh:124
SimpleThread::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: simple_thread.cc:130
SimpleThread::isa
TheISA::ISA *const isa
Definition: simple_thread.hh:105
SimpleThread::readVec64BitLaneReg
virtual ConstVecLane64 readVec64BitLaneReg(const RegId &reg) const override
Reads source vector 64bit operand.
Definition: simple_thread.hh:367
CheckerCPU
CheckerCPU class.
Definition: cpu.hh:85
SimpleThread::pcStateNoRecord
void pcStateNoRecord(const TheISA::PCState &val) override
Definition: simple_thread.hh:521
SimpleThread::setHtmCheckpointPtr
void setHtmCheckpointPtr(BaseHTMCheckpointPtr new_cpt) override
Definition: simple_thread.cc:197
PCEventQueue
Definition: pc_event.hh:71
ThreadState::setThreadId
void setThreadId(ThreadID id)
Definition: thread_state.hh:65
HtmFailureFaultCause
HtmFailureFaultCause
Definition: htm.hh:44
X86ISA::count
count
Definition: misc.hh:703
SimpleThread::status
Status status() const override
Definition: simple_thread.hh:242
SimpleThread::readVecElemFlat
const VecElem & readVecElemFlat(RegIndex reg, const ElemIndex &elemIndex) const override
Definition: simple_thread.hh:641
SimpleThread::readCCReg
RegVal readCCReg(RegIndex reg_idx) const override
Definition: simple_thread.hh:443
Process::syscall
virtual void syscall(ThreadContext *tc)
Definition: process.hh:78
X86ISA::reg
Bitfield< 5, 3 > reg
Definition: types.hh:87
SimpleThread::decoder
TheISA::Decoder decoder
Definition: simple_thread.hh:136
SimpleThread::getWritableVecPredRegFlat
VecPredRegContainer & getWritableVecPredRegFlat(RegIndex reg) override
Definition: simple_thread.hh:660
request.hh
BaseTLB
Definition: tlb.hh:50
SimpleThread::scheduleInstCountEvent
void scheduleInstCountEvent(Event *event, Tick count) override
Definition: simple_thread.hh:195
SimpleThread::readStCondFailures
unsigned readStCondFailures() const override
Definition: simple_thread.hh:562
SimpleThread::setMiscRegNoEffect
void setMiscRegNoEffect(RegIndex misc_reg, RegVal val) override
Definition: simple_thread.hh:545
RegId
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:75
SimpleThread
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Definition: simple_thread.hh:89
EventQueue::getCurTick
Tick getCurTick() const
While curTick() is useful for any object assigned to this event queue, if an object that is assigned ...
Definition: eventq.hh:850
SimpleThread::setMiscReg
void setMiscReg(RegIndex misc_reg, RegVal val) override
Definition: simple_thread.hh:551
SimpleThread::demapPage
void demapPage(Addr vaddr, uint64_t asn)
Definition: simple_thread.hh:171
SimpleThread::_htmCheckpoint
std::unique_ptr< BaseHTMCheckpoint > _htmCheckpoint
Definition: simple_thread.hh:110
ThreadState
Struct for holding general thread state that is needed across CPU models.
Definition: thread_state.hh:46
ThreadState::_status
ThreadContext::Status _status
Definition: thread_state.hh:132
Counter
int64_t Counter
Statistics counter type.
Definition: types.hh:58
SimpleThread::pcState
void pcState(const TheISA::PCState &val) override
Definition: simple_thread.hh:518
SimpleThread::floatRegs
std::array< RegVal, TheISA::NumFloatRegs > floatRegs
Definition: simple_thread.hh:100
SimpleThread::getWritableVecRegFlat
VecRegContainer & getWritableVecRegFlat(RegIndex reg) override
Definition: simple_thread.hh:615
ArmISA::VecElem
uint32_t VecElem
Definition: registers.hh:68
cp
Definition: cprintf.cc:40
SimpleThread::getSystemPtr
System * getSystemPtr() override
Definition: simple_thread.hh:229
SimpleThread::demapInstPage
void demapInstPage(Addr vaddr, uint64_t asn)
Definition: simple_thread.hh:177
SimpleThread::setVecRegFlat
void setVecRegFlat(RegIndex reg, const VecRegContainer &val) override
Definition: simple_thread.hh:621
SimpleThread::htmTransactionStops
int64_t htmTransactionStops
Definition: simple_thread.hh:140
SimpleThread::instAddr
Addr instAddr() const override
Definition: simple_thread.hh:526
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
SimpleThread::takeOverFrom
void takeOverFrom(ThreadContext *oldContext) override
Definition: simple_thread.cc:97
SimpleThread::setStatus
void setStatus(Status newStatus) override
Definition: simple_thread.hh:244
SimpleThread::getTC
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
Definition: simple_thread.hh:169
Event
Definition: eventq.hh:246
VecLaneT
Vector Lane abstraction Another view of a container.
Definition: vec_reg.hh:262
SimpleThread::descheduleInstCountEvent
void descheduleInstCountEvent(Event *event) override
Definition: simple_thread.hh:200
SimpleThread::predicate
bool predicate
Did this instruction execute or is it predicated false.
Definition: simple_thread.hh:113
SimpleThread::setIntRegFlat
void setIntRegFlat(RegIndex idx, RegVal val) override
Definition: simple_thread.hh:592
System
Definition: system.hh:73
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
SimpleThread::getWritableVecPredReg
VecPredRegContainer & getWritableVecPredReg(const RegId &reg) override
Definition: simple_thread.hh:431
SimpleThread::setStCondFailures
void setStCondFailures(unsigned sc_failures) override
Definition: simple_thread.hh:577
SimpleThread::system
System * system
Definition: simple_thread.hh:131
MipsISA::vaddr
vaddr
Definition: pra_constants.hh:275
MipsISA::event
Bitfield< 10, 5 > event
Definition: pra_constants.hh:297
SimpleThread::getCpuPtr
BaseCPU * getCpuPtr() override
Definition: simple_thread.hh:210
VecRegContainer::print
const std::string print() const
Definition: vec_reg.hh:366
ThreadState::getPhysProxy
PortProxy & getPhysProxy()
Definition: thread_state.cc:107
SimpleThread::memAccPredicate
bool memAccPredicate
True if the memory access should be skipped for this instruction.
Definition: simple_thread.hh:116
SimpleThread::getPhysProxy
PortProxy & getPhysProxy() override
Definition: simple_thread.hh:231
SimpleThread::setVecLane
virtual void setVecLane(const RegId &reg, const LaneData< LaneSize::EightByte > &val) override
Definition: simple_thread.hh:401
SimpleThread::setCCRegFlat
void setCCRegFlat(RegIndex idx, RegVal val) override
Definition: simple_thread.hh:672
SimpleThread::SimpleThread
SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system, BaseTLB *_itb, BaseTLB *_dtb, BaseISA *_isa)
Definition: simple_thread.cc:82
process.hh
SimpleThread::readMiscReg
RegVal readMiscReg(RegIndex misc_reg) override
Definition: simple_thread.hh:539
SimpleThread::readVec32BitLaneReg
virtual ConstVecLane32 readVec32BitLaneReg(const RegId &reg) const override
Reads source vector 32bit operand.
Definition: simple_thread.hh:360
SimpleThread::name
std::string name() const
Definition: simple_thread.hh:119
SimpleThread::copyState
void copyState(ThreadContext *oldContext)
Definition: simple_thread.cc:109
ArmISA::NumVecPredRegs
const int NumVecPredRegs
Definition: registers.hh:98
SimpleThread::MachInst
TheISA::MachInst MachInst
Definition: simple_thread.hh:92
PCEventQueue::schedule
bool schedule(PCEvent *event) override
Definition: pc_event.cc:70
SimpleThread::_pcState
TheISA::PCState _pcState
Definition: simple_thread.hh:107
SimpleThread::syscall
void syscall() override
Definition: simple_thread.hh:588
SimpleThread::readVecLane
VecLaneT< T, true > readVecLane(const RegId &reg) const
Vector Register Lane Interfaces.
Definition: simple_thread.hh:334
SimpleThread::getVirtProxy
PortProxy & getVirtProxy() override
Definition: simple_thread.hh:232
SimpleThread::setVecElem
void setVecElem(const RegId &reg, const VecElem &val) override
Definition: simple_thread.hh:488
ThreadState::process
Process * process
Definition: thread_state.hh:151
SimpleThread::copyArchRegs
void copyArchRegs(ThreadContext *tc) override
Definition: simple_thread.cc:171
SimpleThread::readMemAccPredicate
bool readMemAccPredicate()
Definition: simple_thread.hh:565
ArmISA::NumFloatRegs
const int NumFloatRegs
Definition: registers.hh:83
SimpleThread::remove
bool remove(PCEvent *e) override
Definition: simple_thread.hh:192
SimpleThread::readIntReg
RegVal readIntReg(RegIndex reg_idx) const override
Definition: simple_thread.hh:286
ThreadState::setContextId
void setContextId(ContextID id)
Definition: thread_state.hh:63
SimpleThread::setVecElemFlat
void setVecElemFlat(RegIndex reg, const ElemIndex &elemIndex, const VecElem &val) override
Definition: simple_thread.hh:647
SimpleThread::readFuncExeInst
Counter readFuncExeInst() const override
Definition: simple_thread.hh:583
SimpleThread::nextInstAddr
Addr nextInstAddr() const override
Definition: simple_thread.hh:527
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
SimpleThread::setVecPredReg
void setVecPredReg(const RegId &reg, const VecPredRegContainer &val) override
Definition: simple_thread.hh:498
ArmISA::NumIntRegs
const int NumIntRegs
Definition: registers.hh:82
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
ThreadContext::Status
Status
Definition: thread_context.hh:98
SimpleThread::readFloatReg
RegVal readFloatReg(RegIndex reg_idx) const override
Definition: simple_thread.hh:297
BaseHTMCheckpointPtr
std::unique_ptr< BaseHTMCheckpoint > BaseHTMCheckpointPtr
Definition: htm.hh:122
SimpleThread::microPC
MicroPC microPC() const override
Definition: simple_thread.hh:528
ThreadState::baseCpu
BaseCPU * baseCpu
Definition: thread_state.hh:135
SimpleThread::setFloatReg
void setFloatReg(RegIndex reg_idx, RegVal val) override
Definition: simple_thread.hh:465
SimpleThread::readVecPredReg
const VecPredRegContainer & readVecPredReg(const RegId &reg) const override
Definition: simple_thread.hh:420
SimpleThread::activate
void activate() override
Set the status to Active.
Definition: simple_thread.cc:137
full_system.hh
ArmISA::e
Bitfield< 9 > e
Definition: miscregs_types.hh:61
SimpleThread::ccRegs
std::array< RegVal, TheISA::NumCCRegs > ccRegs
Definition: simple_thread.hh:104
EventQueue::schedule
void schedule(Event *event, Tick when, bool global=false)
Schedule the given event on this queue.
Definition: eventq.hh:757
BaseCPU
Definition: cpu_dummy.hh:43
SimpleThread::initMemProxies
void initMemProxies(ThreadContext *tc) override
Initialise the physical and virtual port proxies and tie them to the data port of the CPU.
Definition: simple_thread.hh:234
SimpleThread::comInstEventQueue
EventQueue comInstEventQueue
An instruction-based event queue.
Definition: simple_thread.hh:129
BaseTLB::demapPage
virtual void demapPage(Addr vaddr, uint64_t asn)=0
SimpleThread::getDTBPtr
BaseTLB * getDTBPtr() override
Definition: simple_thread.hh:221
SimpleThread::vecRegs
std::array< VecRegContainer, TheISA::NumVecRegs > vecRegs
Definition: simple_thread.hh:102
ArmISA::NumCCRegs
const int NumCCRegs
Definition: registers.hh:84
PortProxy
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition: port_proxy.hh:80
ThreadState::initMemProxies
void initMemProxies(ThreadContext *tc)
Initialise the physical and virtual port proxies and tie them to the data port of the CPU.
Definition: thread_state.cc:83
SimpleThread::htmTransactionStarts
int64_t htmTransactionStarts
Definition: simple_thread.hh:139
MipsISA::PCState
GenericISA::DelaySlotPCState< MachInst > PCState
Definition: types.hh:41
types.hh
RegIndex
uint16_t RegIndex
Definition: types.hh:52
PCEventQueue::remove
bool remove(PCEvent *event) override
Definition: pc_event.cc:50
SimpleThread::readVecPredRegFlat
const VecPredRegContainer & readVecPredRegFlat(RegIndex reg) const override
Definition: simple_thread.hh:654
ThreadState::getVirtProxy
PortProxy & getVirtProxy()
Definition: thread_state.cc:115
ThreadState::storeCondFailures
unsigned storeCondFailures
Definition: thread_state.hh:171
SimpleThread::dtb
BaseTLB * dtb
Definition: simple_thread.hh:134
SimpleThread::readCCRegFlat
RegVal readCCRegFlat(RegIndex idx) const override
Definition: simple_thread.hh:671
SimpleThread::demapDataPage
void demapDataPage(Addr vaddr, uint64_t asn)
Definition: simple_thread.hh:182
EventQueue::deschedule
void deschedule(Event *event)
Deschedule the specified event.
Definition: eventq.hh:790
ElemIndex
uint16_t ElemIndex
Logical vector register elem index type.
Definition: types.hh:55
SimpleThread::threadId
int threadId() const override
Definition: simple_thread.hh:214
ThreadState::readLastSuspend
Tick readLastSuspend() const
Definition: thread_state.hh:71
SimpleThread::~SimpleThread
virtual ~SimpleThread()
Definition: simple_thread.hh:151
SimpleThread::setVecPredRegFlat
void setVecPredRegFlat(RegIndex reg, const VecPredRegContainer &val) override
Definition: simple_thread.hh:666
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
PCEvent
Definition: pc_event.hh:42
SimpleThread::getCurrentInstCount
Tick getCurrentInstCount() override
Definition: simple_thread.hh:205
SimpleThread::getIsaPtr
BaseISA * getIsaPtr() override
Definition: simple_thread.hh:225
SimpleThread::readIntRegFlat
RegVal readIntRegFlat(RegIndex idx) const override
Flat register interfaces.
Definition: simple_thread.hh:590
SimpleThread::readVecRegFlat
const VecRegContainer & readVecRegFlat(RegIndex reg) const override
Definition: simple_thread.hh:609
SimpleThread::setVecLaneT
void setVecLaneT(const RegId &reg, const LD &val)
Write a lane of the destination vector register.
Definition: simple_thread.hh:375
ArmISA::NumVecRegs
const int NumVecRegs
Definition: registers.hh:97
SimpleThread::halt
void halt() override
Set the status to Halted.
Definition: simple_thread.cc:161
SimpleThread::socketId
uint32_t socketId() const override
Definition: simple_thread.hh:213
EventQueue
Queue of events sorted in time order.
Definition: eventq.hh:617
SimpleThread::setVecLane
virtual void setVecLane(const RegId &reg, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector register.
Definition: simple_thread.hh:384
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
MicroPC
uint16_t MicroPC
Definition: types.hh:144
ThreadState::threadId
ThreadID threadId() const
Definition: thread_state.hh:67
SimpleThread::getProcessPtr
Process * getProcessPtr() override
Definition: simple_thread.hh:239
page_table.hh
CheckpointIn
Definition: serialize.hh:67
ThreadState::readLastActivate
Tick readLastActivate() const
Definition: thread_state.hh:69
SimpleThread::schedule
bool schedule(PCEvent *e) override
Definition: simple_thread.hh:191
SimpleThread::itb
BaseTLB * itb
Definition: simple_thread.hh:133
SimpleThread::readVecElem
const VecElem & readVecElem(const RegId &reg) const override
Definition: simple_thread.hh:409
SimpleThread::setVecLane
virtual void setVecLane(const RegId &reg, const LaneData< LaneSize::FourByte > &val) override
Definition: simple_thread.hh:395
BaseISA
Definition: isa.hh:47
SimpleThread::flattenRegId
RegId flattenRegId(const RegId &regId) const override
Definition: simple_thread.hh:557
SimpleThread::intRegs
std::array< RegVal, TheISA::NumIntRegs > intRegs
Definition: simple_thread.hh:101
SimpleThread::setContextId
void setContextId(ContextID id) override
Definition: simple_thread.hh:217
csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:158
thread_context.hh
LaneData
LaneSize is an abstraction of a LS byte value for the execution and thread contexts to handle values ...
Definition: vec_reg.hh:458
ThreadState::contextId
ContextID contextId() const
Definition: thread_state.hh:61
RegVal
uint64_t RegVal
Definition: types.hh:168
SimpleThread::readPredicate
bool readPredicate() const
Definition: simple_thread.hh:529
VecRegContainer
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
Definition: vec_reg.hh:156
byteswap.hh
ThreadState::cpuId
int cpuId() const
Definition: thread_state.hh:57
SimpleThread::getCheckerCpuPtr
CheckerCPU * getCheckerCpuPtr() override
Definition: simple_thread.hh:223
ThreadState::readFuncExeInst
Counter readFuncExeInst() const
Reads the number of instructions functionally executed and committed.
Definition: thread_state.hh:92
eventq.hh

Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17