30#ifndef __ARCH_RISCV_STATIC_INST_HH__
31#define __ARCH_RISCV_STATIC_INST_HH__
67 template <
typename T32,
typename T64>
89 std::unique_ptr<PCStateBase>
96 return std::unique_ptr<PCStateBase>{ret_pc_ptr};
118 flags[IsMacroop] =
true;
132 panic(
"Tried to execute a macroop directly!\n");
139 panic(
"Tried to execute a macroop directly!\n");
145 panic(
"Tried to execute a macroop directly!\n");
148 void size(
size_t newSize)
override
168 flags[IsMicroop] =
true;
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
virtual PCStateBase * clone() const =0
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Base class for all RISC-V Macroops.
void size(size_t newSize) override
std::vector< StaticInstPtr > microops
Fault initiateAcc(ExecContext *xc, trace::InstRecord *traceData) const override
Fault completeAcc(PacketPtr pkt, ExecContext *xc, trace::InstRecord *traceData) const override
RiscvMacroInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
StaticInstPtr fetchMicroop(MicroPC upc) const override
Return the microop that goes with a particular micropc.
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
Base class for all RISC-V Microops.
RiscvMicroInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
void advancePC(PCStateBase &pcState) const override
Base class for all RISC-V static instructions.
size_t asBytes(void *buf, size_t size) override
Instruction classes can override this function to return a a representation of themselves as a blob o...
std::unique_ptr< PCStateBase > buildRetPC(const PCStateBase &cur_pc, const PCStateBase &call_pc) const override
void advancePC(ThreadContext *tc) const override
int64_t rvSext(int64_t x) const
T rvSelect(T v32, T v64) const
void advancePC(PCStateBase &pc) const override
uint64_t rvZext(uint64_t x) const
RiscvStaticInst(const char *_mnemonic, ExtMachInst _machInst, OpClass __opClass)
Base, ISA-independent static instruction class.
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
size_t _size
Instruction size in bytes.
std::bitset< Num_Flags > flags
Flag values for this instruction.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual const PCStateBase & pcState() const =0
#define panic(...)
This implements a cprintf based panic() function.
constexpr enums::RiscvType RV32
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< FaultBase > Fault
Declaration of the Packet class.