28#ifndef __ARCH_ARM_FASTMODEL_IRIS_THREAD_CONTEXT_HH__
29#define __ARCH_ARM_FASTMODEL_IRIS_THREAD_CONTEXT_HH__
35#include <unordered_map>
41#include "iris/IrisInstance.h"
42#include "iris/detail/IrisErrorCode.h"
43#include "iris/detail/IrisObjects.h"
57 typedef std::map<std::string, iris::ResourceInfo>
ResourceMap;
62 typedef std::unordered_map<Iris::CanonicalMsn, iris::MemorySpaceId>
74 iris::InstanceId
_instId = iris::IRIS_UINT64_MAX;
99 iris::ResourceId
pcRscId = iris::IRIS_UINT64_MAX;
149 uint64_t esId,
const iris::IrisValueMap &fields, uint64_t time,
150 uint64_t sInstId,
bool syncEc, std::string &error_message_out);
152 uint64_t esId,
const iris::IrisValueMap &fields, uint64_t time,
153 uint64_t sInstId,
bool syncEc, std::string &error_message_out);
155 uint64_t esId,
const iris::IrisValueMap &fields, uint64_t time,
156 uint64_t sInstId,
bool syncEc, std::string &error_message_out);
158 uint64_t esId,
const iris::IrisValueMap &fields, uint64_t time,
159 uint64_t sInstId,
bool syncEc, std::string &error_message_out);
161 uint64_t esId,
const iris::IrisValueMap &fields, uint64_t time,
162 uint64_t sInstId,
bool syncEc, std::string &error_message_out);
171 iris::IrisCppAdapter &
call()
const {
return client.irisCall(); }
174 mutable ArmISA::PCState
pc;
176 void readMem(iris::MemorySpaceId space,
178 void writeMem(iris::MemorySpaceId space,
181 Addr vaddr, iris::MemorySpaceId v_space);
186 iris::IrisConnectionInterface *iris_if,
187 const std::string &iris_path);
219 panic(
"%s not implemented.", __FUNCTION__);
235 panic(
"%s not implemented.", __FUNCTION__);
240 panic(
"%s not implemented.", __FUNCTION__);
252 panic(
"%s not implemented.", __FUNCTION__);
262 panic(
"%s not implemented.", __FUNCTION__);
266 panic(
"%s not implemented.", __FUNCTION__);
272 panic(
"%s not implemented.", __FUNCTION__);
278 warn(
"Ignoring clearArchRegs()");
299 panic(
"%s not implemented.", __FUNCTION__);
305 panic(
"%s not implemented.", __FUNCTION__);
314 panic(
"%s not implemented.", __FUNCTION__);
328 panic(
"%s not implemented.", __FUNCTION__);
334 panic(
"%s not implemented.", __FUNCTION__);
341 panic(
"%s not implemented.", __FUNCTION__);
375 panic(
"%s not implemented.", __FUNCTION__);
381 panic(
"%s not implemented.", __FUNCTION__);
404 panic(
"%s not implemented.", __FUNCTION__);
409 panic(
"%s not implemented.", __FUNCTION__);
415 panic(
"%s not implemented.", __FUNCTION__);
420 panic(
"%s not implemented.", __FUNCTION__);
427 panic(
"%s not implemented.", __FUNCTION__);
433 panic(
"%s not implemented.", __FUNCTION__);
445 panic(
"%s not implemented.", __FUNCTION__);
451 panic(
"%s not implemented.", __FUNCTION__);
457 panic(
"%s not implemented.", __FUNCTION__);
uint32_t socketId() const
Reads this CPU's Socket ID.
int cpuId() const
Reads this CPU's ID.
Queue of events sorted in time order.
EventQueue comInstEventQueue
void clearArchRegs() override
virtual void initFromIrisInstance(const ResourceMap &resources)
virtual void setVecPredReg(const RegId ®, const ArmISA::VecPredRegContainer &val)
void * getWritableReg(const RegId ®) override
std::vector< iris::ResourceId > ResourceIds
int cpuId() const override
ThreadContext(gem5::BaseCPU *cpu, int id, System *system, gem5::BaseMMU *mmu, gem5::BaseISA *isa, iris::IrisConnectionInterface *iris_if, const std::string &iris_path)
iris::ResourceId getMiscRegRscId(RegIndex misc_reg) const
void htmAbortTransaction(uint64_t htm_uid, HtmFailureFaultCause cause) override
void copyArchRegs(gem5::ThreadContext *tc) override
bool remove(PCEvent *e) override
void uninstallBp(BpInfoIt it)
void setStatus(Status new_status) override
void readMemWithCurrentMsn(Addr vaddr, size_t size, char *data)
virtual RegVal readVecElemFlat(RegIndex idx) const
virtual void setCCReg(RegIndex reg_idx, RegVal val)
virtual void setVecReg(const RegId ®, const ArmISA::VecRegContainer &val)
void activate() override
Set the status to Active.
MemorySpaceMap memorySpaceIds
std::vector< iris::MemorySupportedAddressTranslationResult > translations
ResourceIds vecPredRegIds
virtual ArmISA::VecRegContainer & getWritableVecReg(const RegId ®)
virtual RegVal readCCRegFlat(RegIndex idx) const
Process * getProcessPtr() override
void installBp(BpInfoIt it)
iris::ResourceId getIntRegFlatRscId(RegIndex int_reg) const
Flat register interfaces.
Tick readLastActivate() override
void halt() override
Set the status to Halted.
ResourceIds flattenedIntIds
void descheduleInstCountEvent(Event *event) override
virtual RegVal readCCReg(RegIndex reg_idx) const
BaseMMU * getMMUPtr() override
Status status() const override
void takeOverFrom(gem5::ThreadContext *old_context) override
virtual bool translateAddress(Addr &paddr, Addr vaddr)=0
virtual ArmISA::VecRegContainer & getWritableVecRegFlat(RegIndex idx)
void sendFunctional(PacketPtr pkt) override
void extractResourceMap(ResourceIds &ids, const ResourceMap &resources, const IdxNameMap &idx_names)
iris::ResourceId getVecPredRegRscId(RegIndex vec_reg) const
bool translateAddress(Addr &paddr, iris::MemorySpaceId p_space, Addr vaddr, iris::MemorySpaceId v_space)
iris::ResourceId getVecRegRscId(RegIndex vec_reg) const
void writeMem(iris::MemorySpaceId space, Addr addr, const void *p, size_t size)
std::map< Addr, BpInfoPtr > BpInfoMap
iris::IrisErrorCode phaseInitLeave(uint64_t esId, const iris::IrisValueMap &fields, uint64_t time, uint64_t sInstId, bool syncEc, std::string &error_message_out)
virtual RegVal readIntRegFlat(RegIndex idx) const
void regStats(const std::string &name) override
void setStCondFailures(unsigned sc_failures) override
Tick getCurrentInstCount() override
const PCStateBase & pcState() const override
void setMiscReg(RegIndex misc_reg, const RegVal val) override
InstDecoder * getDecoderPtr() override
virtual const ArmISA::VecPredRegContainer & readVecPredReg(const RegId ®) const
virtual void setVecPredRegFlat(RegIndex idx, const ArmISA::VecPredRegContainer &val)
iris::IrisErrorCode semihostingEvent(uint64_t esId, const iris::IrisValueMap &fields, uint64_t time, uint64_t sInstId, bool syncEc, std::string &error_message_out)
virtual RegVal readVecElem(const RegId ®) const
iris::IrisErrorCode simulationTimeEvent(uint64_t esId, const iris::IrisValueMap &fields, uint64_t time, uint64_t sInstId, bool syncEc, std::string &error_message_out)
iris::IrisCppAdapter & noThrow() const
virtual const std::vector< iris::MemorySpaceId > & getBpSpaceIds() const =0
virtual const ArmISA::VecRegContainer & readVecReg(const RegId ®) const
iris::ResourceId getCCRegFlatRscId(RegIndex cc_reg) const
BaseHTMCheckpointPtr & getHtmCheckpointPtr() override
std::unique_ptr< BpInfo > BpInfoPtr
RegVal getReg(const RegId ®) const override
iris::EventStreamId regEventStreamId
virtual void setVecRegFlat(RegIndex idx, const ArmISA::VecRegContainer &val)
iris::EventStreamId initEventStreamId
iris::EventStreamId semihostingEventStreamId
void readMem(iris::MemorySpaceId space, Addr addr, void *p, size_t size)
CheckerCPU * getCheckerCpuPtr() override
BpInfoIt getOrAllocBp(Addr pc)
Tick readLastSuspend() override
void setProcessPtr(Process *p) override
gem5::BaseCPU * getCpuPtr() override
std::vector< ArmISA::VecRegContainer > vecRegs
void setThreadId(int id) override
std::map< std::string, iris::ResourceInfo > ResourceMap
std::map< int, std::string > IdxNameMap
virtual void setVecElemFlat(RegIndex idx, RegVal val)
iris::ResourceId icountRscId
iris::MemorySpaceId getMemorySpaceId(const Iris::CanonicalMsn &msn) const
RegVal readMiscRegNoEffect(RegIndex misc_reg) const override
std::unordered_map< Iris::CanonicalMsn, iris::MemorySpaceId > MemorySpaceMap
void suspend() override
Set the status to Suspended.
void setHtmCheckpointPtr(BaseHTMCheckpointPtr cpt) override
iris::IrisErrorCode breakpointHit(uint64_t esId, const iris::IrisValueMap &fields, uint64_t time, uint64_t sInstId, bool syncEc, std::string &error_message_out)
BaseISA * getIsaPtr() const override
void setContextId(int id) override
virtual ArmISA::VecPredRegContainer & getWritableVecPredRegFlat(RegIndex idx)
virtual ArmISA::VecPredRegContainer & getWritableVecPredReg(const RegId ®)
std::vector< ArmISA::VecPredRegContainer > vecPredRegs
virtual void setIntRegFlat(RegIndex idx, uint64_t val)
iris::IrisCppAdapter & call() const
int threadId() const override
RegVal readMiscReg(RegIndex misc_reg) override
virtual ArmISA::VecPredRegContainer readVecPredRegFlat(RegIndex idx) const
BpInfoMap::iterator BpInfoIt
iris::ResourceId extractResourceId(const ResourceMap &resources, const std::string &name)
void writeMemWithCurrentMsn(Addr vaddr, size_t size, const char *data)
virtual RegVal readIntReg(RegIndex reg_idx) const
std::vector< iris::MemorySpaceInfo > memorySpaces
virtual void setVecElem(const RegId ®, RegVal val)
virtual void setIntReg(RegIndex reg_idx, RegVal val)
System * getSystemPtr() override
iris::EventStreamId timeEventStreamId
bool schedule(PCEvent *e) override
iris::ResourceId getIntRegRscId(RegIndex int_reg) const
iris::EventStreamId breakpointEventStreamId
virtual void setCCRegFlat(RegIndex idx, RegVal val)
void scheduleInstCountEvent(Event *event, Tick count) override
virtual const ArmISA::VecRegContainer & readVecRegFlat(RegIndex idx) const
iris::IrisErrorCode instanceRegistryChanged(uint64_t esId, const iris::IrisValueMap &fields, uint64_t time, uint64_t sInstId, bool syncEc, std::string &error_message_out)
unsigned readStCondFailures() const override
int contextId() const override
void pcStateNoRecord(const PCStateBase &val) override
void setReg(const RegId ®, RegVal val) override
iris::IrisInstance client
std::optional< Addr > bpAddr
void setMiscRegNoEffect(RegIndex misc_reg, const RegVal val) override
Event * enableAfterPseudoEvent
uint32_t socketId() const override
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Register ID: describe an architectural register with its class and index.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
@ Halted
Permanently shut down.
@ Suspended
Temporarily inactive.
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
#define panic(...)
This implements a cprintf based panic() function.
VecPredReg::Container VecPredRegContainer
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
int ContextID
Globally unique thread context ID.
std::unique_ptr< BaseHTMCheckpoint > BaseHTMCheckpointPtr
std::shared_ptr< EventList > events
const std::string & name()