41 #ifndef __CPU_SIMPLE_ATOMIC_HH__ 42 #define __CPU_SIMPLE_ATOMIC_HH__ 47 #include "params/AtomicSimpleCPU.hh" 125 panic(
"Atomic CPU doesn't expect recvTimingResp!\n");
131 panic(
"Atomic CPU doesn't expect recvRetry!\n");
143 cacheBlockMask = ~(cpu->cacheLineSize() - 1);
215 int& frag_size,
int& size_left)
const;
239 #endif // __CPU_SIMPLE_ATOMIC_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.
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
Ports are used to interface objects to each other.
Tick recvAtomicSnoop(PacketPtr pkt) override
Default implementations.
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
std::shared_ptr< Request > RequestPtr
EventFunctionWrapper tickEvent
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
Port & getInstPort() override
Return a reference to the instruction port.
void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
RequestPtr data_write_req
An AtomicCPUPort overrides the default behaviour of the recvAtomicSnoop and ignores the packet instea...
Port & getDataPort() override
Return a reference to the data port.
void drainResume() override
Resume execution after a successful drain.
DrainState
Object drain/handover states.
bool isSnooping() const
Determine if this master port is snooping or not.
bool genMemFragmentRequest(const RequestPtr &req, 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 set up the request for a single fragment of a memory access.
bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
AtomicCPUDPort(const std::string &_name, BaseSimpleCPU *_cpu)
const bool simulate_inst_stalls
uint64_t Tick
Tick count type.
virtual Tick sendPacket(MasterPort &port, const PacketPtr &pkt)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void printAddr(Addr a)
Inject a PrintReq for the given address to print the state of that address throughout the memory syst...
virtual ~AtomicSimpleCPU()
ProbePointArg< std::pair< SimpleThread *, const StaticInstPtr > > * ppCommit
Probe Points.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
DrainState drain() override
Notify an object that it needs to drain its state.
Fault amoMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, AtomicOpFunctorPtr amo_op) override
void activateContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now active.
void switchOut() override
Prepare for another CPU to take over execution.
int16_t ThreadID
Thread index/ID type.
void threadSnoop(PacketPtr pkt, ThreadID sender)
Perform snoop for other cpu-local thread contexts.
ProbePointArg generates a point for the class of Arg.
bool isCpuDrained() const
Check if a system is in a drained state.
void takeOverFrom(Port *old)
A utility function to make it easier to swap out ports.
AtomicSimpleCPU(AtomicSimpleCPUParams *params)
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >()) override
std::vector< SimpleExecContext * > threadInfo
MicroPC microPC() const override
const bool simulate_data_stalls
bool tryCompleteDrain()
Try to complete a drain request.
AtomicCPUPort(const std::string &_name, BaseSimpleCPU *_cpu)
void verifyMemoryMode() const override
Verify that the system is in a memory mode supported by the CPU.
void regProbePoints() override
Register probe points for this object.
AtomicCPUDPort dcachePort
std::shared_ptr< FaultBase > Fault
const Params * params() const
void suspendContext(ThreadID thread_num) override
Notify the CPU that the indicated context is now suspended.