riscv / riscv-test-env

https://jira.riscv.org/browse/RVG-141
Other
42 stars 107 forks source link

RVTEST_FAIL definition #13

Closed mainkar-rohit closed 5 years ago

mainkar-rohit commented 5 years ago

Why does RVTEST_FAIL macro have a sll followed by a or to TESTNUM?

#define RVTEST_FAIL \ fence; \ 1: beqz TESTNUM, 1b; \ sll TESTNUM, TESTNUM, 1; \ or TESTNUM, TESTNUM, 1;

Eg. TESTNUM of 2 gets converted to 5. Also fesvr returns (tohost = 2) when we run this in Spike.

mainkar-rohit commented 5 years ago

https://github.com/riscv/riscv-test-env/blob/6f31769d091bbd2ef504308633fbe8a870641894/p/riscv_test.h#L193

Location of code being referenced.

aswaterman commented 5 years ago

The fesvr/htif error-reporting system uses the LSB to indicate "done" vs. "not done" and uses the MSBs to indicate the error code.

mainkar-rohit commented 5 years ago

Thanks for clarifying. Apologize if this is obvious. But what do you mean by "done" vs. "not done".

Is this handled inside of fesvr? If so, can you please point to the code that does this.

aswaterman commented 5 years ago

The LSB tells fesvr to end the simulation. https://github.com/riscv/riscv-fesvr/blob/master/fesvr/syscall.cc#L106

mainkar-rohit commented 5 years ago

Thanks for clarifying.