toddmaustin / bringup-bench

Bringup-Bench is a collection of standalone minimal library and system dependence benchmarks useful for bringing up newly designed CPUs, accelerators, compilers and operating systems. You probably don't need Bringup-Bench, but if you do, you probably need it badly!
Other
149 stars 20 forks source link

Issue with make test for TARGET=spike #10

Open ashuthosh-mr opened 2 weeks ago

ashuthosh-mr commented 2 weeks ago

I was able to successfully build dhrystone benchmark using: make build TARGET=spike.

However when I used the command: make test TARGET=spike, I got an error regarding ../target/simple_mmio_plugin.so missing.

Then, in the target, I used the command: make, which generated simple_mmio_plugin.so.

But now when I make test in the dhrystone, I am getting the following error.

Unable to load extlib '../target/simple_mmio_plugin.so': ../target/simple_mmio_plugin.so: undefined symbol: register_mmio_plugin

What might be the cause of this? Please let me know. Thanks in advance.

toddmaustin commented 2 weeks ago

I forgot to mention you need to do a "make spike-build" from the top-level directory first, to make the Spike device DLL. Does that fix your problem. I updated the documentation. Thanks!

ashuthosh-mr commented 2 weeks ago

Thank you for the response. "make spike-build" from the top-level directory solves the creation of simple_mmio_plugin.so. However, when "make run-tests TARGET=spike" from the top-level is done, this error is obtained:

Unable to load extlib '../target/simple_mmio_plugin.so': ../target/simple_mmio_plugin.so: undefined symbol: register_mmio_plugin make[1]: [Makefile:11: test] Error 255 (ignored) diff FOO audio-codec.out 0a1,3

inputs: 1000 -1000 1234 3200 -1314 0 32767 -32768 encode: 250 122 230 156 97 213 170 42 decode: 1008 -1008 1248 3264 -1312 8 32256 -32256 make[1]: *** [Makefile:12: test] Error 1

I also tried using 32 bit toolchain where the errors were different.

Few doubts:

  1. The above error is for the executable obtained using the pre-built SiFive's riscv64-unknown-elf-gcc. When "sudo make run-tests TARGET=spike" is done, the above reported error is not reported, instead the error is riscv32-unknown-elf-ar is missing.
  2. Do I use riscv32-unknown-elf-gcc for this benchmark, or does the pre-built gcc work? On using riscv32-unknown-elf-gcc, I get different set of errors. such as: ../target/libtarg.c: Assembler messages: ../target/libtarg.c:61: Error: unrecognized opcode csrr a0,mepc', extensionzicsr' required ../target/libtarg.c:69: Error: unrecognized opcode csrr a0,mcause', extensionzicsr' required ../target/libtarg.c:77: Error: unrecognized opcode csrr a0,mtval', extensionzicsr' required ../target/libtarg.c:61: Error: unrecognized opcode csrr a1,mepc', extensionzicsr' required ../target/libtarg.c:69: Error: unrecognized opcode csrr a2,mcause', extensionzicsr' required ../target/libtarg.c:77: Error: unrecognized opcode csrr a3,mtval', extensionzicsr' required make[1]: *** [../Makefile:136: ../target/libtarg.o] Error 1
  3. I tried using rv32gc instead of rv32imc with riscv32-unknown-elf-gcc. In that case, similar error to using pre-built binary is obtained: Unable to load extlib '../target/simple_mmio_plugin.so': ../target/simple_mmio_plugin.so: undefined symbol: register_mmio_plugin make[1]: [Makefile:11: test] Error 255 (ignored) diff FOO audio-codec.out 0a1,3

    inputs: 1000 -1000 1234 3200 -1314 0 32767 -32768 encode: 250 122 230 156 97 213 170 42 decode: 1008 -1008 1248 3264 -1312 8 32256 -32256 make[1]: *** [Makefile:12: test] Error 1

Please let me know if I am doing something wrong. Thank you in advance.