ibex icon indicating copy to clipboard operation
ibex copied to clipboard

make[1]: *** [out/metadata/tb.compile.stamp] Error 2

Open cllll402 opened this issue 2 years ago • 7 comments

I am a beginner in ibex, and when I followed the github steps to test something wrong, can you tell me what I missed or did wrong? The error message is as follows:

autumn@localhost ~/ibex/dv/uvm/core_ibex$ make --keep-going IBEX_CONFIG=opentitan SIMULATOR=vcs ISS=spike ITERATIONS=1 SEED=1 TEST=riscv_arithmetic_basic_test WAVES=0 COV=0 Building RTL testbench 23:54:56 (snpslmd) OUT: "VCSCompiler_Net" [email protected] [snps_checkout_1691823296] 23:55:19 (snpslmd) IN: "VCSCompiler_Net" [email protected] [snps_checkout_1691823296] 23:55:19 (snpslmd) OUT: "VCSCompiler_Net" [email protected] [snps_checkout_1691823319] 23:55:21 (snpslmd) IN: "VCSCompiler_Net" [email protected] [snps_checkout_1691823319] make[1]: *** [out/metadata/tb.compile.stamp] Error 2 Generating core configuration file Building randomized test generator 23:55:24 (snpslmd) OUT: "VCSCompiler_Net" [email protected] [snps_checkout_1691823324] 23:55:41 (snpslmd) IN: "VCSCompiler_Net" [email protected] [snps_checkout_1691823324] 23:55:41 (snpslmd) OUT: "VCSCompiler_Net" [email protected] [snps_checkout_1691823341] 23:55:43 (snpslmd) IN: "VCSCompiler_Net" [email protected] [snps_checkout_1691823341] Running randomized test generator to create assembly file /home/autumn/ibex/dv/uvm/core_ibex/out/run/tests/riscv_arithmetic_basic_test.1/test.S 23:55:44 (snpslmd) OUT: "VCSRuntime_Net" [email protected] [snps_checkout_1691823344] 23:55:51 (snpslmd) IN: "VCSRuntime_Net" [email protected] [snps_checkout_1691823344] Compiling riscvdv test assembly to create binary at /home/autumn/ibex/dv/uvm/core_ibex/out/run/tests/riscv_arithmetic_basic_test.1/test.bin make[1]: Target `all' not remade because of errors. make: *** [run] Error 2

Here are the details of how I use the tools:

VMware:16Pro Linux:CentOS7.9 VCS:2020.03-SP2-7 Python:3.10.5 Pip:23.2.1 Gcc/G++:4.8.5 Spike:riscv-isa-sim-ibex-cosim-v0.3 Pre-built toolchain:lowrisc-toolchain-gcc-rv32imcb-20230519-1

Finally, some of my path information in bashrc: #riscv-gcc export RISCV=/home/autumn/lowrisc-gcc export RISCV_TOOLCHAIN=$RISCV export RISCV_GCC=$RISCV/bin/riscv32-unknown-elf-gcc export RISCV_OBJCOPY=$RISCV/bin/riscv32-unknown-elf-objcopy export SPIKE_PATH=$RISCV/bin export PKG_CONFIG_PATH=$RISCV/lib/pkgconfig export PATH=$PATH:/root/.local/bin #.txt

cllll402 avatar Aug 12 '23 07:08 cllll402

Hi there! I'm not sure exactly what has gone wrong, but any failure must have happened just before the line that says make[1]: *** [out/metadata/tb.compile.stamp] Error 2. (Note: the other text that appears afterwards would probably not be there if you hadn't passed --keep-going. It's often easier to debug what's going on without that flag)

Anyway, I'm not entirely sure what failed, and we should probably tweak things so that the error messages are clearer. Can you try running again with an extra VERBOSE=1. That should hopefully show more about what is going on:

make IBEX_CONFIG=opentitan SIMULATOR=vcs ISS=spike ITERATIONS=1 SEED=1 TEST=riscv_arithmetic_basic_test WAVES=0 COV=0 VERBOSE=1

rswarbrick avatar Aug 14 '23 08:08 rswarbrick

Well, the first failure happens when running VCS. See line 11, which ends with "Error 2". You're right that some things look a bit dubious below (maybe you're using an old GCC/G++?), but I'd not bother looking too hard at them yet.

I'd expect that you can reproduce the initial failure by copy-pasting and running the first vcs command. I think you'll find that it spits some error messages out to /home/autumn/ibex/dv/uvm/core_ibex/out/build/tb/compile_tb.log.

rswarbrick avatar Aug 14 '23 15:08 rswarbrick

Thank you, I have solved this problem. The specific method is to replace ibex-isa-sim-v0.3 with ibex-isa-sim-v0.5, and specify the locations of the five libraries libfdt.a, libriscv.a, libdisasm.a, libsoftfloat.a and libsoftfloat.so. You can solve the problem. Of course, all tools should be updated to newer versions. The reason for the change of spike is that I found that the 0.3 version of the tool lacks the improvement of mhpmcounter related functions.

cllll402 avatar Aug 26 '23 01:08 cllll402

Next, I tested all the files in test.yaml. Of the 55 projects to be tested, except riscv_bitmanip_full_test, the pass rate of the remaining projects is on schedule toward the official report. https://ibex.reports.lowrisc.org/opentitan/latest/report.html

When I execute the riscv_bitmanip_full_test command alone: autumn@localhost ~/ibex/dv/uvm/core_ibex$ make --keep-going IBEX_CONFIG=opentitan SIMULATOR=vcs ISS=spike ITERATIONS=1 SEED=1 TEST=riscv_bitmanip_full_test WAVES=0 COV=0 WARNING:ibex_cmd:Rejecting test riscv_bitmanip_full_test, 'rtl_params' specified not compatible with ibex_config Traceback (most recent call last): File "/home/autumn/ibex/dv/uvm/core_ibex/./scripts/metadata.py", line 511, in sys.exit(_main()) File "/home/autumn/ibex/dv/uvm/core_ibex/./scripts/metadata.py", line 379, in _main raise RuntimeError("md.tests_and_counts is empty, cannot get TEST.SEED strings.") RuntimeError: md.tests_and_counts is empty, cannot get TEST.SEED strings. make: *** [run] Error 1

I found about warnings, found similar problems in https://github.com/lowRISC/ibex/pull/999, but referred to in the file, the code seems to have been corrected, so I have no idea, could you tell me how to do this problem should be?

cllll402 avatar Aug 26 '23 02:08 cllll402

Thanks for the report. I've taken a look, and the riscv_bitmanip_full_test test requires a full bitmanip implementation. We don't have one with the OpenTitan configuration, which is what you've selected here.

I think that the behaviour of the make run that you show above is sensible (although it is a bit hard to decipher! I'm pushing a PR to make it clearer).

Why did you try to run this specific test? Does that appear in some longer list that needs to be filtered?

rswarbrick avatar Aug 30 '23 10:08 rswarbrick

Thanks for your reply, I just want to fully test all the files in test.yaml and have no other purpose. If it's not important, then I would consider not testing it.

cllll402 avatar Sep 02 '23 12:09 cllll402

Ok, cool. I guess the remaining question is whether there's a "run everything I need" command that caused riscv_bitmanip_full_test to run with IBEX_CONFIG=opentitan. If so, there's some filtering we need to fix! What command did you run that caused the test to run in the first place?

rswarbrick avatar Sep 04 '23 09:09 rswarbrick