44 #ifndef __CPU_CHECKER_CPU_HH__ 45 #define __CPU_CHECKER_CPU_HH__ 51 #include "arch/types.hh" 60 #include "debug/Checker.hh" 62 #include "params/CheckerCPU.hh" 268 template <
typename LD>
469 DPRINTF(
Checker,
"Setting misc reg %d with no effect to check later\n",
471 miscRegIdxs.push(misc_reg);
478 DPRINTF(
Checker,
"Setting misc reg %d with effect to check later\n",
480 miscRegIdxs.push(misc_reg);
555 int& frag_size,
int& size_left)
const;
570 panic(
"AMO is not supported yet in CPU checker\n");
594 Addr pAddr,
int flags);
621 template <
class Impl>
629 :
CheckerCPU(p), updateThisCycle(false), unverifiedInst(NULL)
637 void verify(
const DynInstPtr &inst);
639 void validateInst(
const DynInstPtr &inst);
640 void validateExecution(
const DynInstPtr &inst);
641 void validateState();
643 void copyResult(
const DynInstPtr &inst,
const InstResult& mismatch_val,
645 void handlePendingInt();
653 updateThisCycle =
true;
668 #endif // __CPU_CHECKER_CPU_HH__ A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
#define panic(...)
This implements a cprintf based panic() function.
virtual void setVecLane(const RegId ®, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector register.
Ports are used to interface objects to each other.
void setPredicate(bool val) override
unsigned int readStCondFailures() const override
Returns the number of consecutive store conditional failures.
AddressMonitor * getCpuAddrMonitor(ThreadID tid)
void setMemAccPredicate(bool val) override
bool isMiscReg() const
true if it is a condition-code physical register.
std::list< DynInstPtr >::iterator InstListIt
DynInstPtr unverifiedInst
Impl::DynInstPtr DynInstPtr
std::queue< int > miscRegIdxs
Vector Register Abstraction This generic class is the model in a particularization of MVC...
bool readPredicate() const
unsigned readStCondFailures() const override
RegVal readCCReg(RegIndex reg_idx) const override
void wakeup(ThreadID tid) override
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::EightByte > &val) override
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::TwoByte > &val) override
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
virtual Counter totalOps() const override
std::shared_ptr< Request > RequestPtr
bool readPredicate() const override
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::Byte > &val) override
Write a lane of the destination vector operand.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
bool checkFlags(const RequestPtr &unverified_req, Addr vAddr, Addr pAddr, int flags)
Checks if the flags set by the Checker and Checkee match.
const VecPredRegContainer & readVecPredRegOperand(const StaticInst *si, int idx) const override
Predicate registers interface.
virtual Counter totalInsts() const override
bool readMemAccPredicate() const override
std::list< DynInstPtr > instList
TheISA::PCState pcState() const override
void setVecElemResult(T &&t)
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'th source reg.
const VecRegContainer & readVecRegOperand(const StaticInst *si, int idx) const override
Read source vector register operand.
InstResult unverifiedResult
void setMemAccPredicate(bool val)
StaticInstPtr curMacroStaticInst
void setDcachePort(MasterPort *dcache_port)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Declaration of Statistics objects.
VecPredRegContainer & getWritableVecPredReg(const RegId ®) override
RegVal readMiscReg(RegIndex misc_reg) override
ThreadContext * tcBase() override
Returns a pointer to the ThreadContext.
VecRegContainer & getWritableVecReg(const RegId ®) override
void armMonitor(ThreadID tid, Addr address)
bool isCCReg() const
true if it is a condition-code physical register.
void setVecLaneOperandT(const StaticInst *si, int idx, const LD &val)
Write a lane of the destination vector operand.
void setVecElem(const RegId ®, const VecElem &val) override
virtual ConstVecLane32 readVec32BitLaneReg(const RegId ®) const override
Reads source vector 32bit operand.
bool isVecElem() const
true if it is a condition-code physical register.
AddressMonitor * getAddrMonitor() override
void setIntReg(RegIndex reg_idx, RegVal val) override
void setStCondFailures(unsigned int sc_failures) override
Sets the number of consecutive store conditional failures.
LaneSize is an abstraction of a LS byte value for the execution and thread contexts to handle values ...
Addr nextInstAddr() const override
virtual ConstVecLane64 readVec64BitLaneReg(const RegId ®) const override
Reads source vector 64bit operand.
virtual ConstVecLane64 readVec64BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 64bit operand.
void pcState(const TheISA::PCState &val) override
virtual ConstVecLane16 readVec16BitLaneReg(const RegId ®) const override
Reads source vector 16bit operand.
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
bool readMemAccPredicate()
TheISA::PCState pcState() const override
void setCCReg(RegIndex reg_idx, RegVal val) override
bool mwait(PacketPtr pkt) override
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.
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...
MasterID masterId
id attached to all issued requests
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.
::DummyVecRegContainer VecRegContainer
VecRegContainer & getWritableVecRegOperand(const StaticInst *si, int idx) override
Read destination vector register operand for modification.
virtual void setVecLaneOperand(const StaticInst *si, int idx, const LaneData< LaneSize::FourByte > &val) override
void setMiscRegNoEffect(RegIndex misc_reg, RegVal val) override
const VecPredRegContainer & readVecPredReg(const RegId ®) const override
SimpleThread * threadBase()
uint8_t * unverifiedMemData
void setVecElemOperand(const StaticInst *si, int idx, const VecElem val) override
Sets a vector register to a value.
void demapInstPage(Addr vaddr, uint64_t asn)
void mwaitAtomic(ThreadID tid, ThreadContext *tc, BaseTLB *dtb)
void setMiscReg(RegIndex misc_reg, RegVal val) override
RegVal readCCRegOperand(const StaticInst *si, int idx) override
RegVal readMiscReg(int misc_reg) override
Reads a miscellaneous register, handling any architectural side effects due to reading that register...
virtual ConstVecLane16 readVec16BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 16bit operand.
std::queue< InstResult > result
void handleError(const DynInstPtr &inst)
Fault amoMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op) override
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
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void advancePC(PCState &pc, const StaticInstPtr &inst)
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.
void setMiscReg(int misc_reg, RegVal val) override
Sets a miscellaneous register, handling any architectural side effects due to writing that register...
int64_t Counter
Statistics counter type.
void syscall(Fault *fault) override
Executes a syscall.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Addr instAddr() const override
RegVal readMiscRegNoEffect(int misc_reg) const
virtual void switchOut()
Prepare for another CPU to take over execution.
Port & getInstPort() override
Purely virtual method that returns a reference to the instruction port.
void setMiscRegNoEffect(int misc_reg, RegVal val)
Addr dbg_vtophys(Addr addr)
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >()) override
virtual ConstVecLane32 readVec32BitLaneOperand(const StaticInst *si, int idx) const override
Reads source vector 32bit operand.
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
bool isVecReg() const
true if it is a condition-code physical register.
VecPredRegContainer & getWritableVecPredRegOperand(const StaticInst *si, int idx) override
Gets destination predicate register operand for modification.
int16_t ThreadID
Thread index/ID type.
bool mwait(ThreadID tid, PacketPtr pkt)
void setIcachePort(MasterPort *icache_port)
void setVecPredResult(T &&t)
std::ostream CheckpointOut
std::vector< Process * > workload
void setSystem(System *system)
GenericISA::SimplePCState< MachInst > PCState
void demapPage(Addr vaddr, uint64_t asn) override
Invalidate a page in the DTLB and ITLB.
const VecElem & readVecElem(const RegId ®) const override
Generic predicate register container.
RegVal readMiscRegOperand(const StaticInst *si, int idx) override
RegVal readFloatReg(RegIndex reg_idx) const override
MicroPC microPC() const override
Base, ISA-independent static instruction class.
const RegIndex & index() const
Index accessors.
void setVecPredReg(const RegId ®, 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'th destination reg.
Defines a dynamic instruction context.
Register ID: describe an architectural register with its class and index.
void setIntRegOperand(const StaticInst *si, int idx, RegVal val) override
Sets an integer register to a value.
void recordPCChange(const TheISA::PCState &val)
void armMonitor(Addr address) override
void setMiscRegOperand(const StaticInst *si, int idx, RegVal val) override
TheISA::MachInst MachInst
bool isVecPredReg() const
true if it is a predicate physical register.
void setVecReg(const RegId ®, const VecRegContainer &val) override
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void setScalarResult(T &&t)
void setVecPredRegOperand(const StaticInst *si, int idx, const VecPredRegContainer &val) override
Sets a destination predicate register operand to a value.
void demapDataPage(Addr vaddr, uint64_t asn)
Vector Lane abstraction Another view of a container.
void setCCRegOperand(const StaticInst *si, int idx, RegVal val) override
void setVecRegOperand(const StaticInst *si, int idx, const VecRegContainer &val) override
Sets a destination vector register operand to a value.
TheISA::PCState newPCState
StaticInstPtr curStaticInst
Port & getDataPort() override
Purely virtual method that returns a reference to the data port.
std::shared_ptr< FaultBase > Fault
virtual ConstVecLane8 readVec8BitLaneReg(const RegId ®) const override
Reads source vector 8bit operand.
const VecRegContainer & readVecReg(const RegId ®) const override
RegVal readFloatRegOperandBits(const StaticInst *si, int idx) override
Reads a floating point register in its binary format, instead of by value.
void mwaitAtomic(ThreadContext *tc) override
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
virtual ConstVecLane8 readVec8BitLaneOperand(const StaticInst *si, int idx) const override
Vector Register Lane Interfaces.
RegVal readMiscRegNoEffect(RegIndex misc_reg) const override
void setPredicate(bool val)
VecElem readVecElemOperand(const StaticInst *si, int idx) const override
Vector Elem Interfaces.