-
Notifications
You must be signed in to change notification settings - Fork 169
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
Function main in main.sail Not Reflected in C_emulator #515
Comments
Yeah I'm not sure anything really uses that The simulator can't use Sail's |
https://github.com/rems-project/isla requires a main function to be written in Sail when executing litmus tests. The |
My idea is : currently, the exception handling in riscv_sim.c is still marked as TODO. However, the implementation in main.sail, based on my understanding (or perhaps I misunderstood?), has fairly decent implementation of some exception handling as defined in our sail specifications within the generated C code. if (!(have_exception)) goto post_exception_handlers_11095;
have_exception = false;
{
if ((*current_exception).kind != Kind_zError_not_implemented) goto try_11096;
sail_string zs;
CREATE(sail_string)(&zs);
COPY(sail_string)(&zs, (*current_exception).zError_not_implemented);
zgsz312274 = print_string("Error: Not implemented: ", zs);
KILL(sail_string)(&zs);
goto post_exception_handlers_11095;
}
try_11096: ;
{
if ((*current_exception).kind != Kind_zError_internal_error) goto try_11097;
zgsz312274 = print_endline("Error: internal error");
goto post_exception_handlers_11095;
}
try_11097: ;
have_exception = true; Perhaps we can take this as the first step towards implementation? Also, it may be awkward to split the step of handling exceptions in the try...catch block |
debug: Add UnavailableHaltedTest
In main.sail, the main function contains annotations for the PC (Program Counter) and uses a try...catch module for the correct operation of the simulator.
However, in the riscv_sim.c , we can see that these functionalities implemented in the main function are not correspondingly reflected.
Does this lead to redundancy in the code within the main function? Or can we separate these functionalities and reflect them in riscv_sim.c?
The text was updated successfully, but these errors were encountered: