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() +=
"RV32IMACFD_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() +=
"RV32IMACFD_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)
293 if (((opRd & 0x3) != 0x3) || (opRd == 0))
300 updateRV32IMACFDInstrLength(ic, opRd);
304 if ((((opRd & 0x1f) >= 0x3) || ((opRd & 0x1f) < 0x1f)) || (opRd == 0))
309 else if(opRd == 0x7f)
311 updateRV32IMACFDInstrLength(ic, opRd);
316 updateRV32IMACFDInstrLength(ic, opRd);
320 if (((opRd & 0x3f) == 0x1f) || (opRd == 0))
327 updateRV32IMACFDInstrLength(ic, opRd);
331 if ((opRd == 0x3f) || (opRd == 0))
338 updateRV32IMACFDInstrLength(ic, opRd);
383 for (
uint32_t i = 0; i < 32; i += 1)
387 for (
uint32_t i = 0; i < 32; i += 1)
395 for (
uint32_t i = 768; i < 775; i += 1)
399 for (
uint32_t i = 832; i < 837; i += 1)
407 for (
uint32_t i = 3072; i < 3075; i += 1)
411 for (
uint32_t i = 3200; i < 3203; i += 1)
415 for (
uint32_t i = 3857; i < 3861; i += 1)
436 std::vector<etiss::uint32 *> vec;
437 std::vector<etiss::uint32 *> mask;
static etiss::ModuleHandle GetCurrentModule()
See etiss/src/Misc.cpp.
static std::string GetCurrentModulePath()
See etiss/src/Misc.cpp.
etiss::instr::InstructionCollection RV32IMACFDISA
void RV32IMACFD_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 deleteInterruptVector(etiss::InterruptVector *vec, ETISS_CPU *cpu)
delete an allocated interrupt vector object
virtual void deleteInterruptEnable(etiss::InterruptEnable *en, ETISS_CPU *cpu)
virtual void initInstrSet(etiss::instr::ModedInstructionSet &) const
This function is called during CPUArch initialization.
virtual etiss::InterruptEnable * createInterruptEnable(ETISS_CPU *cpu)
virtual etiss::InterruptVector * createInterruptVector(ETISS_CPU *cpu)
If interrupt handling is expected, vector table could be provided to support interrupt triggering.
virtual std::shared_ptr< etiss::VirtualStruct > getVirtualStruct(ETISS_CPU *cpu)
get the VirtualStruct of the core to mitigate register access
virtual std::string jitFiles() const
This function will return the include prefix relative to the base installation directory of the ArchL...
virtual std::string installDir() const
This function will return the base installation directory of the ArchLib.
virtual void compensateEndianess(ETISS_CPU *cpu, etiss::instr::BitArray &ba) const
Target architecture may have inconsistent endianess.
virtual etiss::int32 handleException(etiss::int32 code, ETISS_CPU *cpu)
This function will be called automatically in order to handling architecure dependent exceptions such...
Generated on Fri, 19 Jun 2026 11:48:00 +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:48:00 +0000.