Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RVTEST_CODE_END use of RVTEST_SAVE_GPRS in env/arch_test.h doesn't work #450

Open
ssecatch-w opened this issue Apr 3, 2024 · 4 comments

Comments

@ssecatch-w
Copy link

Assembler messages:
Error: unrecognized opcode `rvtest_save_gprs x1 gpr_save'

The line with the error is
RVTEST_CODE_END

looking at the definition:
.macro RVTEST_CODE_END // test is ended, but in no particular mode
.option push
.option norvc
.global rvtest_code_end // define the label and make it available
.global cleanup_epilogs // ALERT: tests must populate x1 with a point to the end of regular sig area
/
MPRV must be clear here !!! ****/
rvtest_code_end: // RVMODEL_HALT should get here
#ifdef rvtest_gpr_save // gpr_save area is instantiated at end of signature
RVTEST_SAVE_GPRS x1 gpr_save
#endif
RVTEST_GOTO_MMODE // if only Mmode used by tests, this has no effect
cleanup_epilogs: // jump here to quit, will restore state for each mode

RVTEST_SAVE_GPRS used to be a macro:
.macro RVTEST_SAVE_GPRS BASEREG REG_SV_ADDR // optionally save GPRs

But now it's been replaced with a define which doesn't match the call
#define RVTEST_SAVE_GPRSM(_BR, _LBL, ...) ;\

@allenjbaum
Copy link
Collaborator

allenjbaum commented Apr 3, 2024 via email

@ssecatch-w
Copy link
Author

ssecatch-w commented Apr 3, 2024

Same error. I suspect the problem is that that macro definition expects at least two parameters (if not more).

Out of curiosity, I also fixed the "call" along with removing the "M":
RVTEST_SAVE_GPRS(x1, gpr_save)

And that does compile, though I haven't tested to see if it works yet functionally

@allenjbaum
Copy link
Collaborator

allenjbaum commented Apr 3, 2024 via email

@ssecatch-w
Copy link
Author

@ssecatch-w ssecatch-w changed the title RVTEST_CODE_END use of RVTEST_SAVE_GPRS in env/arch_test.c doesn't work RVTEST_CODE_END use of RVTEST_SAVE_GPRS in env/arch_test.h doesn't work Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants