Comments (9)
If you are following the instructions in that stack overflow answer, they are woefully out-of-date for the latest v1.9 privileged architecture. There is no tohost CSR register, so you can no longer end bare-metal tests using a csrw tohost, 1
. This is the current technique to end tethered tests, using memory mapped IO: https://github.com/riscv/riscv-test-env/blob/master/p/riscv_test.h#L119.
I have since updated the SO answer with a disclaimer.
from riscv-pk.
This is usually just a version mismatch (what the error message actually means is that a CSR with the given name doesn't exist). You should try using the matched tagged versions is riscv-tools, probably using whatever is on the "priv-1.9" branch if you're looking for new stuff.
from riscv-pk.
Ah, I see. Solved, thanks.
from riscv-pk.
I am still having the same problem....I get this when trying to make pk.
First I do: ../configure --prefix=/opt/riscv32i/riscv32-unknown-elf --host=riscv32-unknown-elf which seems ok and then when running make I get this:
riscv32-unknown-elf-ranlib libsoftfloat.a
riscv32-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -DBBL_PAYLOAD="dummy_payload" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/mtrap.c
riscv32-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -DBBL_PAYLOAD="dummy_payload" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/minit.c
../machine/minit.c: Assembler messages:
../machine/minit.c:29: Error: Instruction csrw requires absolute expression
../machine/minit.c:30: Error: Instruction csrw requires absolute expression
../machine/mtrap.h:24: Error: Instruction csrr requires absolute expression
../machine/minit.c:47: Error: Instruction csrw requires absolute expression
../machine/minit.c:48: Error: Instruction csrw requires absolute expression
../machine/minit.c:49: Error: Instruction csrr requires absolute expression
../machine/minit.c:50: Error: Instruction csrr requires absolute expression
../machine/minit.c:159: Error: unrecognized opcode `mret'
Makefile:300: recipe for target 'minit.o' failed
make: *** [minit.o] Error 1
from riscv-pk.
Similar problem here as Barbara
First I tried to set up a 32-bit toolchain, following the read.me on https://github.com/riscv/riscv-tools
with a slightly modified build.sh :
...
build_project riscv-gnu-toolchain --prefix=$RISCV --with-xlen=32 --with-arch=IC
CC= CXX= build_project riscv-pk --enable-32bit --prefix=$RISCV/riscv32-unknown-elf --host=riscv32-unknown-elf
The riscv-gnu-toolchain built well but building riscv-pk failed with:
...
Configuring project riscv-pk
configure: WARNING: unrecognized options: --enable-32bit
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: unrecognized options: --enable-32bit
Building project riscv-pk
../pk/mentry.S: Assembler messages:
../pk/mentry.S:192: Error: unrecognized opcode `amoor.w x0,a1,(a2)'
make: *** [mentry.o] Error 1
...
So I did a compare with the newest revision of riscv-pk and found that --enable-32bit isn't
a valid argument in the older version that you get with https://github.com/riscv/riscv-tool
I then replaced the old version of riscv-pk with the newest one and got:
Configuring project riscv-pk
Building project riscv-pk
../machine/minit.c: Assembler messages:
../machine/minit.c:29: Error: Instruction csrw requires absolute expression
../machine/minit.c:30: Error: Instruction csrw requires absolute expression
../machine/mtrap.h:24: Error: Instruction csrr requires absolute expression
../machine/minit.c:47: Error: Instruction csrw requires absolute expression
../machine/minit.c:48: Error: Instruction csrw requires absolute expression
../machine/minit.c:49: Error: Instruction csrr requires absolute expression
../machine/minit.c:50: Error: Instruction csrr requires absolute expression
../machine/minit.c:159: Error: unrecognized opcode `mret'
make: *** [minit.o] Error 1
I did a google search that led me to this page but I am not able to determine
the 'matched tagged versions of riscv-tools' that palmer-dabbelt recommended
from riscv-pk.
Me too, riscv-gnu-toolchain builds well but pk won't. I also tried an old version of pk and got the same result as Edgar! Can anyone please help?
I nearly tried everything...I modified configure, I used different options but nothing helped.
from riscv-pk.
Me four, I've tried following the steps of this Stack Overflow answer: http://stackoverflow.com/a/31393890/6779984. Tried with the "priv-1.9" branch on riscv-tools repository.
I've tried running this:
$ riscv64-unknown-elf-gcc -nostdlib -nostartfiles -T link.ld -o hello hello.s
The following error shows up:
hello.s: Assembler messages:
hello.s:6: Error: Instruction csrw requires absolute expression
hello.s:6: Error: Instruction csrw requires absolute expression
from riscv-pk.
I am trying to compile the FreeRTOS and got the Same error
Error:
CC ../../Source/portable/GCC/RISCV/port.c
../../Source/portable/GCC/RISCV/port.c: Assembler messages:
../../Source/portable/GCC/RISCV/port.c:121: Error: Instruction csrr requires absolute expression
../../Source/portable/GCC/RISCV/port.c:123: Error: Instruction csrw requires absolute expression
../../Source/portable/GCC/RISCV/port.c:130: Error: Instruction csrr requires absolute expression
../../Source/portable/GCC/RISCV/port.c:132: Error: Instruction csrw requires absolute expression
Makefile:123: recipe for target '../../Source/portable/GCC/RISCV/port.o' failed
make: *** [../../Source/portable/GCC/RISCV/port.o] Error 1
from riscv-pk.
I've been directed here as I've been suffering with the same issue.
I should say sth here about what I've learned from solving this issue.
The issue might be caused by a wrong implementation of stringify used in inlined code.
For example:
This should work:
#define __stringify_1(x...) #x
#define __stringify(x...) __stringify_1(x)
While this shouldn't work in some inlined code:
#define __stringify(x) #x
from riscv-pk.
Related Issues (20)
- error when build RV32 HOT 1
- RV32 bbl loader ../machine/minit.c:78: assertion failed: !(read_csr(misa) & fd_mask) HOT 1
- [question]A request on c-based bbl payload example
- Pk doesn't recognize vector instructions HOT 1
- Compiling error in Mac M1 HOT 1
- Error While configuring Berkeley boot loader HOT 2
- how to suppres "bbl loader" output by spike pk? HOT 1
- Redundant Load and Branch Instructions from HTIF while executing binaries HOT 3
- bbl error
- Loading large file into memory HOT 2
- could not open pk HOT 1
- "Cannot open output file dummy_payload" when building with docker HOT 1
- Linux kernel not showing output after earlycon0 disabled
- macOS 14,compile fail ,"./configure --prefix=/opt/riscv --with-arch=rv32gc --with-abi=ilp32d make linux"
- Issue with linux HOT 1
- pk: mmap based on `p_filesz` fails when it is 0 (zero) HOT 2
- Support RVC program without requiring RVC pk HOT 1
- Issue while installing the riscv-pk -- ../pk/pk.c:188: Error: unknown CSR `senvcfg' HOT 2
- GCC 15 + RVV cause illegal instruction sequence in PK HOT 1
- Issue when installing PK for RV32E
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riscv-pk.