riscv-tests error

789 views
Skip to first unread message

Pavani Tripathi

unread,
Aug 12, 2016, 1:05:57 AM8/12/16
to RISC-V ISA Dev
I was trying to download the riscv-tests repo and followed the instructions given on:


But I am getting the following error when I try to run "make" command:
/home/pavani/Desktop/RISC-V/riscv-tests/benchmarks/common/syscalls.c: Assembler messages:
/home/pavani/Desktop/RISC-V/riscv-tests/benchmarks/common/syscalls.c:49: Error: Instruction csrr requires absolute expression
/home/pavani/Desktop/RISC-V/riscv-tests/benchmarks/common/syscalls.c:50: Error: Instruction csrr requires absolute expression
make[1]: *** [syscalls.o] Error 1
make[1]: Leaving directory `/home/pavani/Desktop/RISC-V/riscv-tests/benchmarks'
make: *** [benchmarks] Error 2


Can anyone help me with this?

Michael Clark

unread,
Aug 12, 2016, 2:57:30 AM8/12/16
to Pavani Tripathi, RISC-V ISA Dev
Hi Pavani,

The error indicates that your tool chain may not matched to the riscv-tests repo due to changes in the privileged ISA (CSRs).

Did you clone the riscv-tests repo directly or as a submodule of riscv-tools?

To match the toolchain version with the tests you need to clone riscv-tools and follow the instructions to fetch the submodules. Hope this helps.

Michael

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/86b4d522-2b83-485a-bfae-bfc528225c36%40groups.riscv.org.

Pavani Tripathi

unread,
Aug 12, 2016, 3:25:02 AM8/12/16
to RISC-V ISA Dev, pavan...@iiitd.ac.in
Hi,

I followed the below steps:
$ git clone https://github.com/riscv/riscv-tests
$ cd riscv-tests
$ git submodule update --init --recursive
$ autoconf
$ ./configure --prefix=$RISCV/target
$ make
$ make install

But I get error after make.

Michael Clark

unread,
Aug 12, 2016, 3:39:05 AM8/12/16
to Pavani Tripathi, RISC-V ISA Dev
Hi Pavani,

I’d advise you use the gnu-toolchain, isa-simulator and tests in the riscv-tools repo. The submodules have commit ids that match a particular ISA spec version. I think you have a mismatch between your compiler and tests. Try this:

        $ git clone https://github.com/riscv/riscv-tools/

and follow the steps in the README:

        $ git submodule update --init --recursive
        $ export RISCV=/path/to/install/riscv/toolchain
        $ ./build.sh

This way you will get a toolchain and simulator that matches the tests repo.

You may also consider checking out the priv-1.9 branch before building, if you want the latest code.

There is a script named 'build-rv32im.sh’ in the top directory of the priv-1.9 branch that builds a standalone RV32 toolchain.

I noticed in your previous email you were using the riscv64 toolchain for RV32 and I am not sure if RV32 is fully supported yet with the multilib gcc. One of the core developers could clarify. IIRC the 64 bit toolchain can build 32 bit binaries but may not be able to link with the newlib libc (this happened to me). I built my RV32 toolchain using the script in the priv-1.9 branch.

Hope this helps.

Michael.

Pavani Tripathi

unread,
Aug 12, 2016, 7:00:50 AM8/12/16
to RISC-V ISA Dev
Hi,

Thanks. You are right. I want to generate RV32IMAF elf file. It would be really helpful if you could tell me the exact steps I need to follow to generate the elf?

Myungha Kim

unread,
Aug 29, 2016, 9:22:53 AM8/29/16
to RISC-V ISA Dev
Hi,

I also need the same information. Can anyone help this request?

Michael, is "priv-1.9 branch" still available? I could not find that.

I have the same errors with the latest Rocket-Chip main branch.

Regards,
Matthew

Paul-Antoine ARRAS

unread,
Aug 29, 2016, 9:29:29 AM8/29/16
to isa...@groups.riscv.org
Le 29/08/2016 à 15:22, Myungha Kim a écrit :
> is "priv-1.9 branch" still available?

Here it is: https://github.com/riscv/riscv-tools/tree/priv-1.9
--
Paul-Antoine Arras
CEA LIST

Myung Ha Kim

unread,
Aug 30, 2016, 10:32:41 PM8/30/16
to Paul-Antoine ARRAS, isa...@groups.riscv.org
Thanks Paul-Antoine,

I have tried the priv-1.9 branch but was not successful.
Have you tried that with the priv-1.9 branch?
It still has the same errors. Did I do something wrong?

matthewkim@ubuntu:/opt/riscv-tools/riscv-tests$ make
mkdir -p benchmarks
make -C benchmarks -f /opt/riscv-tools/riscv-tests/benchmarks/Makefile src_dir=/opt/riscv-tools/riscv-tests/benchmarks XLEN=32
make[1]: Entering directory `/opt/riscv-tools/riscv-tests/benchmarks'
riscv32-unknown-elf-gcc -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -DPREALLOCATE=1 -DHOST_DEBUG=0 \
            -c -I/opt/riscv-tools/riscv-tests/benchmarks/../env -I/opt/riscv-tools/riscv-tests/benchmarks/common -I/opt/riscv-tools/riscv-tests/benchmarks/median -I/opt/riscv-tools/riscv-tests/benchmarks/qsort -I/opt/riscv-tools/riscv-tests/benchmarks/rsort -I/opt/riscv-tools/riscv-tests/benchmarks/towers -I/opt/riscv-tools/riscv-tests/benchmarks/vvadd -I/opt/riscv-tools/riscv-tests/benchmarks/multiply -I/opt/riscv-tools/riscv-tests/benchmarks/mm -I/opt/riscv-tools/riscv-tests/benchmarks/dhrystone -I/opt/riscv-tools/riscv-tests/benchmarks/spmv -I/opt/riscv-tools/riscv-tests/benchmarks/mt-vvadd -I/opt/riscv-tools/riscv-tests/benchmarks/mt-matmul /opt/riscv-tools/riscv-tests/benchmarks/median/median_main.c -o median_main.o
riscv32-unknown-elf-gcc -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -DPREALLOCATE=1 -DHOST_DEBUG=0 \
            -c -I/opt/riscv-tools/riscv-tests/benchmarks/../env -I/opt/riscv-tools/riscv-tests/benchmarks/common -I/opt/riscv-tools/riscv-tests/benchmarks/median -I/opt/riscv-tools/riscv-tests/benchmarks/qsort -I/opt/riscv-tools/riscv-tests/benchmarks/rsort -I/opt/riscv-tools/riscv-tests/benchmarks/towers -I/opt/riscv-tools/riscv-tests/benchmarks/vvadd -I/opt/riscv-tools/riscv-tests/benchmarks/multiply -I/opt/riscv-tools/riscv-tests/benchmarks/mm -I/opt/riscv-tools/riscv-tests/benchmarks/dhrystone -I/opt/riscv-tools/riscv-tests/benchmarks/spmv -I/opt/riscv-tools/riscv-tests/benchmarks/mt-vvadd -I/opt/riscv-tools/riscv-tests/benchmarks/mt-matmul /opt/riscv-tools/riscv-tests/benchmarks/median/median.c -o median.o
riscv32-unknown-elf-gcc -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -DPREALLOCATE=1 -DHOST_DEBUG=0 \
            -c -I/opt/riscv-tools/riscv-tests/benchmarks/../env -I/opt/riscv-tools/riscv-tests/benchmarks/common -I/opt/riscv-tools/riscv-tests/benchmarks/median -I/opt/riscv-tools/riscv-tests/benchmarks/qsort -I/opt/riscv-tools/riscv-tests/benchmarks/rsort -I/opt/riscv-tools/riscv-tests/benchmarks/towers -I/opt/riscv-tools/riscv-tests/benchmarks/vvadd -I/opt/riscv-tools/riscv-tests/benchmarks/multiply -I/opt/riscv-tools/riscv-tests/benchmarks/mm -I/opt/riscv-tools/riscv-tests/benchmarks/dhrystone -I/opt/riscv-tools/riscv-tests/benchmarks/spmv -I/opt/riscv-tools/riscv-tests/benchmarks/mt-vvadd -I/opt/riscv-tools/riscv-tests/benchmarks/mt-matmul /opt/riscv-tools/riscv-tests/benchmarks/common/syscalls.c -o syscalls.o
/opt/riscv-tools/riscv-tests/benchmarks/common/syscalls.c: Assembler messages:
/opt/riscv-tools/riscv-tests/benchmarks/common/syscalls.c:49: Error: Instruction csrr requires absolute expression
/opt/riscv-tools/riscv-tests/benchmarks/common/syscalls.c:50: Error: Instruction csrr requires absolute expression
make[1]: *** [syscalls.o] Error 1
make[1]: Leaving directory `/opt/riscv-tools/riscv-tests/benchmarks'
make: *** [benchmarks] Error 2
matthewkim@ubuntu:/opt/riscv-tools/riscv-tests$

Regards,
Matthew

--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
Reply all
Reply to author
Forward
0 new messages