zicsr required

358 views
Skip to first unread message

Sanchit Kashyap

unread,
Feb 4, 2024, 8:13:00 PM2/4/24
to OpenPiton Discussion
i am getting this error and attaching the log file for it

startup.S: Assembler messages: startup.S:11: Error: unrecognized opcode `csrr s2,mhartid', extension `zicsr' required startup.S:14: Error: unrecognized opcode `csrr s1,mhartid', extension `zicsr' required startup.S:15: Error: unrecognized opcode `csrr a0,mhartid',
extension `zicsr' required

sims.log

Jonathan Balkind

unread,
Feb 4, 2024, 10:55:11 PM2/4/24
to OpenPiton Discussion
You are probably using a newer gcc that needs this (it's a new requirement as of a few versions ago). You can modify the Linux bootrom's Makefile to set the correct -march= flag to gcc, and you'll probably want to do the same inside sims,2.0.

Thanks,
Jon

On Sun, Feb 4, 2024, 17:13 Sanchit Kashyap <sanxhit...@gmail.com> wrote:
i am getting this error and attaching the log file for it

startup.S: Assembler messages: startup.S:11: Error: unrecognized opcode `csrr s2,mhartid', extension `zicsr' required startup.S:14: Error: unrecognized opcode `csrr s1,mhartid', extension `zicsr' required startup.S:15: Error: unrecognized opcode `csrr a0,mhartid',
extension `zicsr' required

--
You received this message because you are subscribed to the Google Groups "OpenPiton Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiton+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiton/c4b46823-6c88-4141-b46b-0fab07474e90n%40googlegroups.com.

Pablo Balbi

unread,
Jul 8, 2024, 3:44:07 AM7/8/24
to OpenPiton Discussion
Hi!

Just if it helps somehow, was getting the missing zicsr extension error at first when using the apt-installed riscv toolchain

```
pablo:~$ riscv64-unknown-elf-gcc --version
riscv64-unknown-elf-gcc (13.2.0-11ubuntu1+12) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

But then switched to using one pre-built by lowRISC here, configuring $RISCV appropriately, and got everything working good without any -march changes.

```
pablo:~$ $RISCV/bin/riscv64-unknown-elf-gcc --version
riscv64-unknown-elf-gcc (crosstool-NG 1.26.0_rc1) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

Seeing this it seems that decoupling + extension was introduced around 2023.

Bests,
Pablo
Reply all
Reply to author
Forward
0 new messages