Rename "handleSysCall" -> "trapHandler"
MODIFY
external/VSRTL
external/VSRTL
-Subproject commit 7f928ad3519a838c1b386e84e1135e0df099361c
+Subproject commit d1d845ff21028a693a057bf665b34a3dc0e4fef6

MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
@@ -230,7 +230,7 @@ void ProcessorHandler::_selectProcessor(const ProcessorID& id, const QStringList
m_currentProcessor->isExecutableAddress = [=](AInt address) { return _isExecutableAddress(address); };
// Syscall handling initialization
- m_currentProcessor->handleSysCall = [=] { syscallTrap(); };
+ m_currentProcessor->trapHandler = [=] { syscallTrap(); };
m_currentProcessor->postConstruct();
createAssemblerForCurrentISA();

MODIFY
src/processors/RISC-V/rv5s/rv5s.h
src/processors/RISC-V/rv5s/rv5s.h
@@ -152,7 +152,7 @@ public:
// Ecall checker
idex_reg->opcode_out >> ecallChecker->opcode;
- ecallChecker->setSyscallCallback(&handleSysCall);
+ ecallChecker->setSyscallCallback(&trapHandler);
hzunit->stallEcallHandling >> ecallChecker->stallEcallHandling;
// -----------------------------------------------------------------------

MODIFY
src/processors/RISC-V/rv5s_no_fw/rv5s_no_fw.h
src/processors/RISC-V/rv5s_no_fw/rv5s_no_fw.h
@@ -138,7 +138,7 @@ public:
// Ecall checker
idex_reg->opcode_out >> ecallChecker->opcode;
- ecallChecker->setSyscallCallback(&handleSysCall);
+ ecallChecker->setSyscallCallback(&trapHandler);
hzunit->stallEcallHandling >> ecallChecker->stallEcallHandling;
// -----------------------------------------------------------------------

MODIFY
src/processors/RISC-V/rv5s_no_fw_hz/rv5s_no_fw_hz.h
src/processors/RISC-V/rv5s_no_fw_hz/rv5s_no_fw_hz.h
@@ -129,7 +129,7 @@ public:
// -----------------------------------------------------------------------
// Ecall checker
decode->opcode >> ecallChecker->opcode;
- ecallChecker->setSyscallCallback(&handleSysCall);
+ ecallChecker->setSyscallCallback(&trapHandler);
0 >> ecallChecker->stallEcallHandling;
// -----------------------------------------------------------------------

MODIFY
src/processors/RISC-V/rv5s_no_hz/rv5s_no_hz.h
src/processors/RISC-V/rv5s_no_hz/rv5s_no_hz.h
@@ -142,7 +142,7 @@ public:
// -----------------------------------------------------------------------
// Ecall checker
decode->opcode >> ecallChecker->opcode;
- ecallChecker->setSyscallCallback(&handleSysCall);
+ ecallChecker->setSyscallCallback(&trapHandler);
0 >> ecallChecker->stallEcallHandling;
// -----------------------------------------------------------------------

MODIFY
src/processors/RISC-V/rv6s_dual/rv6s_dual.h
src/processors/RISC-V/rv6s_dual/rv6s_dual.h
@@ -288,7 +288,7 @@ public:
// Ecall checker
iiex_reg->opcode_out >> ecallChecker->opcode;
- ecallChecker->setSyscallCallback(&handleSysCall);
+ ecallChecker->setSyscallCallback(&trapHandler);
hzunit->stallEcallHandling >> ecallChecker->stallEcallHandling;
// -----------------------------------------------------------------------

MODIFY
src/processors/RISC-V/rvss/rvss.h
src/processors/RISC-V/rvss/rvss.h
@@ -116,7 +116,7 @@ public:
// -----------------------------------------------------------------------
// Ecall checker
decode->opcode >> ecallChecker->opcode;
- ecallChecker->setSyscallCallback(&handleSysCall);
+ ecallChecker->setSyscallCallback(&trapHandler);
0 >> ecallChecker->stallEcallHandling;
}

MODIFY
src/processors/interface/ripesprocessor.h
src/processors/interface/ripesprocessor.h
@@ -228,13 +228,12 @@ public:
std::function<bool(AInt)> isExecutableAddress;
/**
- * @brief handleSysCall
- * Signal that the processor can use to pass control to the outside environment whenever a system call must be
- * handled.
- * No arguments are passed - the Ripes environment will look at the syscall register for the ISA of the processor,
- * alongside the syscall argument registers, and perform a corresponding syscall.
+ * @brief trapHandler
+ * Callback for the processor to pass control to the Ripes environment whenever a trap must be handled.
+ * No arguments are passed - Ripes will look at the syscall register for the ISA of the processor,
+ * alongside the syscall argument registers, and act accordingly.
*/
- std::function<void(void)> handleSysCall;
+ std::function<void(void)> trapHandler;
/** ======================== FEATURE: Reversible ======================== */
// Enabled by setting m_features.isReversible = true

MODIFY
test/tst_cosimulate.cpp
test/tst_cosimulate.cpp
@@ -62,7 +62,7 @@ public:
private:
void cosimulate(const ProcessorID& id, const QStringList& extensions);
const Trace& generateReferenceTrace(const QStringList& extensions);
- void handleSysCall();
+ void trapHandler();
void executeSimulator(Trace& outTrace, const Trace* refTrace = nullptr);
Registers dumpRegs();
QString generateErrorReport(const RegisterChange& change, const TraceEntry& lhs, const TraceEntry& rhs) const;
@@ -85,7 +85,7 @@ private slots:
void testRV5SNoFW() { cosimulate(ProcessorID::RV32_5S_NO_FW, {"M"}); }
};
-void tst_Cosimulate::handleSysCall() {
+void tst_Cosimulate::trapHandler() {
unsigned status = ProcessorHandler::get()->getProcessor()->getRegister(
RegisterFileType::GPR, ProcessorHandler::get()->getProcessor()->implementsISA()->syscallReg());
@@ -178,7 +178,7 @@ void tst_Cosimulate::executeSimulator(Trace& trace, const Trace* refTrace) {
// Override the ProcessorHandler's ECALL handling. In doing so, we can hook into when the EXIT syscall was executed,
// to verify whether the correct test value was reached.
- ProcessorHandler::get()->getProcessorNonConst()->handleSysCall = [=] { handleSysCall(); };
+ ProcessorHandler::get()->getProcessorNonConst()->trapHandler = [=] { trapHandler(); };
m_stop = false;
m_err = QString();

MODIFY
test/tst_riscv.cpp
test/tst_riscv.cpp
@@ -51,7 +51,7 @@ private:
void runTests(const ProcessorID& id, const QString& testdir);
- void handleSysCall();
+ void trapHandler();
bool m_stop = false;
std::shared_ptr<Program> m_program;
@@ -104,7 +104,7 @@ void tst_RISCV::loadBinaryToSimulator(const QString& binFile) {
ProcessorHandler::get()->loadProgram(m_program);
}
-void tst_RISCV::handleSysCall() {
+void tst_RISCV::trapHandler() {
unsigned status = ProcessorHandler::getProcessor()->getRegister(RegisterFileType::GPR, s_ecallreg);
if (status != s_success) {
m_err = "Test: '" + m_currentTest + "' failed: Internal test error.\n\t test number: " +
@@ -172,7 +172,7 @@ void tst_RISCV::runTests(const ProcessorID& id, const QString& testdir) {
// Override the ProcessorHandler's ECALL handling. In doing so, we verify whether the correct test value was
// reached.
- ProcessorHandler::getProcessorNonConst()->handleSysCall = [=] { handleSysCall(); };
+ ProcessorHandler::getProcessorNonConst()->trapHandler = [=] { trapHandler(); };
ProcessorHandler::get()->loadProgram(spProgram);
RipesSettings::getObserver(RIPES_GLOBALSIGNAL_REQRESET)->trigger();

Rename "handleSysCall" -> "trapHandler"