You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The old (RISCV) Architecture seemed to handle etiss::CPUTERMINATED incorrectly-correctly, as it seems the USI just was not implemented correctly? The new one does consume the Code as it should - as a RISC-V interrupt - which makes the etiss::CPUTERMINATED unusable from Plugins.
Fix?
Split the two (Simulation-Loop ReturnCode) and (Architecture Exception Code).
Maybe add a new "Simulation Event Type" that holds both, an Event(=Simloop-Returncode) and optionally an attached Value type. Something like that:
My proposed fix would be to implement handling of ETISS-specific error codes that will never be thrown by the CPU simulation model itself in etiss_CPUCore_handleException and change the new fallback mechanism to terminate the simulator signaling a spurious error code instead of raising an illegal instruction exception.
My proposed fix would be to implement handling of ETISS-specific error codes that will never be thrown by the CPU simulation model itself in etiss_CPUCore_handleException and change the new fallback mechanism to terminate the simulator signaling a spurious error code instead of raising an illegal instruction exception.
Agree. But this still begs the question of how we avoid the aliasing Returncode.h exception codes with possible ISA-defined Exception codes that we might want to pass through the simulation loop, e.g., InterruptPlugin.
Normally this should never happen though. If CoroutinePlugins want to raise exceptions, they have to do so with the ETISS-specific codes. The current exception/interrupt implementation assumes that architecture-specific codes are only present within the architecture code itself, and therefore interprets all external error codes as being ETISS-specific.
Observation
From Testing the new Architecture (PR #127) , minor concerns in Exception Handling:
Coroutine-Plugin exceptions, be it Interruptplugin or any others, are handled in the main simulation loop within
etiss::CPUCore::execute
:etiss/src/CPUCore.cpp
Lines 712 to 718 in 0d215c8
First, they are consumed by the ETISS exception handler to filter out ETISS-internal exceptions as defined per etiss::Returncodes.
Then, per default, all non-listed Return-Codes are forwarded to the architectural exception handler.
I see the problem here more with some Return-Codes being interpretable as legal Architecture Exception Causes, e.g., ...
etiss/include_c/etiss/jit/ReturnCode.h
Lines 189 to 191 in 0d215c8
... translating to a RISC-V 1 0 User software interrupt (USI p. 34)
The old (RISCV) Architecture seemed to handle
etiss::CPUTERMINATED
incorrectly-correctly, as it seems the USI just was not implemented correctly? The new one does consume the Code as it should - as a RISC-V interrupt - which makes theetiss::CPUTERMINATED
unusable from Plugins.Fix?
Split the two (Simulation-Loop ReturnCode) and (Architecture Exception Code).
Maybe add a new "Simulation Event Type" that holds both, an Event(=Simloop-Returncode) and optionally an attached Value type. Something like that:
Then force all Plugins to use this struct to pass information. Could possibly pack the two into a 64-bit type?
The text was updated successfully, but these errors were encountered: