61 static std::string modulePath;
77 auto libPathLoc = archLib.find_last_of(
"/\\");
78 auto libPath = archLib.substr(0, libPathLoc);
79 auto pluginsPathLoc = libPath.find_last_of(
"/\\");
80 auto pluginsPath = libPath.substr(0, pluginsPathLoc);
81 auto archPathLoc = pluginsPath.find_last_of(
"/\\");
82 return libPath.substr(0, archPathLoc);
120 std::string requiredJitFilesPath =
jitFiles();
122 std::string cfgPar =
"";
123 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_headers",
";");
124 etiss::cfg().
set<std::string>(
"jit.external_headers", cfgPar +
"etiss/jit/libsoftfloat.h");
126 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_libs",
";");
127 etiss::cfg().
set<std::string>(
"jit.external_libs", cfgPar +
"softfloat");
129 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_header_paths",
";");
130 etiss::cfg().
set<std::string>(
"jit.external_header_paths", cfgPar +
"etiss/jit" + requiredJitFilesPath);
132 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_lib_paths",
";");
133 etiss::cfg().
set<std::string>(
"jit.external_lib_paths", cfgPar +
"etiss/jit");
145 std::cout << iset.
print() << std::endl;
155 using namespace etiss;
170error_code += R_error_code_0.
read(ba) << 0;
178 cp.
code() = std::string(
"//trap_entry 32\n");
182cp.
code() +=
"{ // procedure\n";
183cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, " + std::to_string(error_code) +
"ULL);\n";
185cp.
code() +=
"} // procedure\n";
188cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
195 cp.
code() = std::string(
"//trap_entry 32\n");
198cp.
code() +=
"return cpu->exception;\n";
219error_code += R_error_code_0.
read(ba) << 0;
227 cp.
code() = std::string(
"//trap_entry 16\n");
231cp.
code() +=
"{ // procedure\n";
232cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, " + std::to_string(error_code) +
"ULL);\n";
234cp.
code() +=
"} // procedure\n";
237cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
244 cp.
code() = std::string(
"//trap_entry 16\n");
247cp.
code() +=
"return cpu->exception;\n";
264 else if ((opRd & 0x3f) == 0x1f)
266 else if (((opRd & 0x1f) >= 0x3) && ((opRd & 0x1f) < 0x1f))
268 else if(opRd == 0x7f)
270 else if ((opRd & 0x3) != 0x3)
292 if (((opRd & 0x3) != 0x3) || (opRd == 0))
299 updateRV64IMACFDInstrLength(ic, opRd);
303 if ((((opRd & 0x1f) >= 0x3) || ((opRd & 0x1f) < 0x1f)) || (opRd == 0))
308 else if(opRd == 0x7f)
310 updateRV64IMACFDInstrLength(ic, opRd);
315 updateRV64IMACFDInstrLength(ic, opRd);
319 if (((opRd & 0x3f) == 0x1f) || (opRd == 0))
326 updateRV64IMACFDInstrLength(ic, opRd);
330 if ((opRd == 0x3f) || (opRd == 0))
337 updateRV64IMACFDInstrLength(ic, opRd);
382 for (
uint32_t i = 0; i < 32; i += 1)
386 for (
uint32_t i = 0; i < 32; i += 1)
394 for (
uint32_t i = 768; i < 775; i += 1)
398 for (
uint32_t i = 832; i < 837; i += 1)
406 for (
uint32_t i = 3072; i < 3075; i += 1)
410 for (
uint32_t i = 3200; i < 3203; i += 1)
414 for (
uint32_t i = 3857; i < 3861; i += 1)
435 std::vector<etiss::uint64 *> vec;
436 std::vector<etiss::uint64 *> mask;
static std::string GetCurrentModulePath()
See etiss/src/Misc.cpp.
static etiss::ModuleHandle GetCurrentModule()
See etiss/src/Misc.cpp.
static std::string GetCurrentModulePath()
See etiss/src/Misc.cpp.
etiss::instr::InstructionCollection RV64IMACFDISA
void RV64IMACFD_translate_exc_code(ETISS_CPU *const cpu, ETISS_System *const system, void *const *const plugin_pointers, etiss_int32 cause)
static __inline__ uint32_t
virtual void compensateEndianess(ETISS_CPU *cpu, etiss::instr::BitArray &ba) const
Target architecture may have inconsistent endianess.
virtual std::string installDir() const
This function will return the base installation directory of the ArchLib.
virtual etiss::int32 handleException(etiss::int32 code, ETISS_CPU *cpu)
This function will be called automatically in order to handling architecure dependent exceptions such...
virtual void initInstrSet(etiss::instr::ModedInstructionSet &) const
This function is called during CPUArch initialization.
virtual etiss::InterruptVector * createInterruptVector(ETISS_CPU *cpu)
If interrupt handling is expected, vector table could be provided to support interrupt triggering.
virtual void deleteInterruptEnable(etiss::InterruptEnable *en, ETISS_CPU *cpu)
virtual void deleteInterruptVector(etiss::InterruptVector *vec, ETISS_CPU *cpu)
delete an allocated interrupt vector object
virtual std::shared_ptr< etiss::VirtualStruct > getVirtualStruct(ETISS_CPU *cpu)
get the VirtualStruct of the core to mitigate register access
virtual etiss::InterruptEnable * createInterruptEnable(ETISS_CPU *cpu)
virtual std::string jitFiles() const
This function will return the include prefix relative to the base installation directory of the ArchL...
Generated on Fri, 19 Jun 2026 11:47:54 +0000.
Contains a small code snipped.
RegisterSet & getAffectedRegisters()
void append(const CodePart &part, CodePart::TYPE type)
bool set(const std::string &key, T value)
template function to set the value of a configuration key.
T get(const std::string &key, T default_, bool *default_used=0)
template function to read the value of a configuration key.
interface to set interrupt bits
template implementation of an InterruptVector that uses integer variables to store interrupt bit valu...
void add(const RegisterPart &rp)
add a registerPart to the set or just its relevant bits if a register with the same name is already p...
a Field instance represents e.g.
static std::shared_ptr< VirtualStruct > allocate(void *structure, std::function< void(Field *)> delete_)
Reading through it will only return bits within the range.
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
unsigned byteCount() const
void addTo(ModedInstructionSet &set, bool &ok)
this class contains parameters that persist in between instruction lookpus/translation within a trans...
bool is_not_default_width_
if true the this instruction is not as long as the width of the variable instruction set
bool instr_width_fully_evaluated_
if true the length_updater_ function will be called again after instr_width_ bits are available
uint64_t current_address_
start address of current instruction
Instruction & getInvalid()
bool addCallback(std::function< bool(BitArray &, etiss::CodeSet &, InstructionContext &)> callback, uint32_t builtinGroups, const std::set< uint32_t > &groups=std::set< uint32_t >())
holds etiss::instr::VariableInstructionSet instances for different modes.
std::string print(std::string prefix=std::string())
VariableInstructionSet * get(uint32_t mode)
holds etiss::instr::InstructionSet instances with different bit widths.
InstructionSet * get(unsigned width)
std::function< void(VariableInstructionSet &, InstructionContext &, BitArray &)> length_updater_
void * ModuleHandle
Represents a module handle. Analogous to Windows this represents the module base address,...
etiss::ModuleHandle GetModuleByAddress(uintptr_t adr)
std::string GetModulePath(etiss::ModuleHandle hModule)
void log(Verbosity level, std::string msg)
write log message at the given level.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
basic cpu state structure needed for execution of any cpu architecture.
etiss_uint64 instructionPointer
pointer to next instruction.
Generated on Fri, 19 Jun 2026 11:47:54 +0000.