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();
123 std::string cfgPar =
"";
124 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_headers",
";");
125 etiss::cfg().
set<std::string>(
"jit.external_headers", cfgPar +
"etiss/jit/libsoftfloat.h");
127 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_libs",
";");
128 etiss::cfg().
set<std::string>(
"jit.external_libs", cfgPar +
"softfloat");
130 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_header_paths",
";");
131 etiss::cfg().
set<std::string>(
"jit.external_header_paths", cfgPar +
"etiss/jit" + requiredJitFilesPath);
133 cfgPar =
etiss::cfg().
get<std::string>(
"jit.external_lib_paths",
";");
134 etiss::cfg().
set<std::string>(
"jit.external_lib_paths", cfgPar +
"etiss/jit");
147 std::cout << iset.
print() << std::endl;
157 using namespace etiss;
171 error_code += R_error_code_0.
read(ba) << 0;
179 cp.
code() = std::string(
"//trap_entry 32\n");
183 cp.
code() +=
"{ // procedure\n";
184 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, " +
185 std::to_string(error_code) +
"ULL);\n";
187 cp.
code() +=
"} // procedure\n";
190 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
197 cp.
code() = std::string(
"//trap_entry 32\n");
200 cp.
code() +=
"return cpu->exception;\n";
219 error_code += R_error_code_0.
read(ba) << 0;
227 cp.
code() = std::string(
"//trap_entry 16\n");
231 cp.
code() +=
"{ // procedure\n";
232 cp.
code() +=
"RV64IMACFD_translate_exc_code(cpu, system, plugin_pointers, " +
233 std::to_string(error_code) +
"ULL);\n";
235 cp.
code() +=
"} // procedure\n";
238 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
245 cp.
code() = std::string(
"//trap_entry 16\n");
248 cp.
code() +=
"return cpu->exception;\n";
265 else if ((opRd & 0x3f) == 0x1f)
267 else if (((opRd & 0x1f) >= 0x3) && ((opRd & 0x1f) < 0x1f))
269 else if (opRd == 0x7f)
271 else if ((opRd & 0x3) != 0x3)
293 if (((opRd & 0x3) != 0x3) || (opRd == 0))
300 updateRV64IMACFDInstrLength(ic, opRd);
304 if ((((opRd & 0x1f) >= 0x3) || ((opRd & 0x1f) < 0x1f)) || (opRd == 0))
309 else if (opRd == 0x7f)
311 updateRV64IMACFDInstrLength(ic, opRd);
316 updateRV64IMACFDInstrLength(ic, opRd);
320 if (((opRd & 0x3f) == 0x1f) || (opRd == 0))
327 updateRV64IMACFDInstrLength(ic, opRd);
331 if ((opRd == 0x3f) || (opRd == 0))
338 updateRV64IMACFDInstrLength(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::uint64 *> vec;
437 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 Wed, 28 Oct 2026 07:20:58 +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 Wed, 28 Oct 2026 07:20:58 +0000.