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
According to the specs, ECALL/EBREAK can be used to break to the emulating environment or invoke services from it. I believe this can be leveraged to automate test execution as follows:
On software side, write the test code as a sequence of small flows ending with an ECALL. Software is expected to encode the expected result somehow
On the core side, trigger an event when an ECALL is encountered (open: where exactly? On fetch? After register write?)
On the testbench side, when ECALL is encountered, read the arguments from the thread's state and invoke a function accordingly. For automated testing we can check, for example, that some register equals the value we want, report/log the result and continue execution as if it was a NOP (can terminated on failure if we want).
Regarding passing the expected results, the spec gives us freedom with that. Some possibilities:
Use predefined registers (e.g. use x15 as expected result and x14 as actual)
Use predefined memory buffers
Use specially crafted NOPs to indicate actions, such as arithmetic operations with destination x0, e.g. add x0, x1, x2
Once we agree on how to do it, I can write a simple tests library so that it will be (hopefully) easy to write tests.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
According to the specs, ECALL/EBREAK can be used to break to the emulating environment or invoke services from it. I believe this can be leveraged to automate test execution as follows:
Regarding passing the expected results, the spec gives us freedom with that. Some possibilities:
x15
as expected result andx14
as actual)x0
, e.g.add x0, x1, x2
Once we agree on how to do it, I can write a simple tests library so that it will be (hopefully) easy to write tests.
Beta Was this translation helpful? Give feedback.
All reactions