-
Notifications
You must be signed in to change notification settings - Fork 69
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
LMBench lat_mem_rd on qtrvsim #153
Comments
It would help if you specify which compiler and libraries you attempt to use. The QtRvSim list of supported system-calls is very limited (ftruncate, openat, close, read, write, readv, writev, exit, brk and limited mmap suitable for anonymous memory allocation). The system calls are compatible with Linux kernel codes and system-calls calling convention. But this is enough to compile simple binaries which can run on QtRvSim as well as on 32-bit or 64-bit native GNU/Linux system or under user-space QEMU emulation. But you cannot use full featured Glibc, it requires lot more functionality of operating system support. But when NewLib or some of its clones is used together with embedded GCC (i.e. riscv64-unknown-elf tools available on Debian as gcc-riscv64-unknown-elf package) then you can use it to compile binaries compatible with Linux kernle and QtRvSim. See the example which uses printf() and malloc() https://gitlab.fel.cvut.cz/b35apo/stud-support/-/tree/master/seminaries/qtrvsim/os-emu-example and The mapping between NewLib functions and Linux kernel system calls is provided in the file By default open() and close() are mapped same as file descriptors 0, 1 and 2 to the terminal. But when you specify directory representing filesystem root for QtRvSim Linux kernel "emulation" then files under this directory can be created, opened, read and written as well as truncated to allow rewrite. So simple POSIX based programs can be compiled and run on QtRvSim and they are real Linux ELF binaries as well. Alternative option is to rewrite The system-calls support can be extended, pull request with portable implementation are welcomed. But they should map to the respective Linux kernel definition. It can be functionality subset. But I do not want to create another new incompatible, proprietary interface as RARS and other simulators often define. Code which is limited to user priviledge instructions and does not access hardware directly should run or real RISC-V Linux systems as well. |
As for the time measuremet, clock_gettime() syscall worth to be implemented. The way how you can use to access some time related information in the current QtRvSim version is read of the So try to specify what is your goal and I can provide idea what can be done with actual QtRvSim offered features or where to start to implement required support in QtRvSim code-base. |
I used Sifive's toolchain . |
I have been wanting to compile LMBench for qtrvsim and do some experiments with lat_mem_rd. From what I noticed, printf isn't working with qtrvsim. I am also not sure how runtime will get measured in qtrvsim or if it is even possible. Can someone clarify if it is possible to get lat_mem_rd working without having to write my own standard library functions for qtrvsim?
The text was updated successfully, but these errors were encountered: