Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: unrecognized opcode -- how to get started with crypto instructions? #373

Open
lianakoleva opened this issue Nov 2, 2023 · 3 comments

Comments

@lianakoleva
Copy link
Contributor

When I run make all CONFIG=rv64-baseline, I get Error: unrecognized opcode `roriw t1,t1,t13`, which is part of Zbkb extension. When I look in riscv-crypto/benchmarks/config/rv64-zscrypto.conf, the architecture doesn't seem to include the Zbkb extension:

This architecture is then passed to the compiler.

Broadly, I am confused on how to get things running initially. I installed everything as directed in riscv-crypto/tools/README.md. The resulting toolchain version is

$ riscv-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/home/liana/riscv-crypto/build/riscv64-unknown-elf/libexec/gcc/riscv64-unknown-elf/10.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/liana/riscv-crypto/extern/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv64-unknown-elf --prefix=/home/liana/riscv-crypro/build/riscv64-unknown-elf --dsiable-shared --disable-threads --enable-languages=c,c++ --with-system-zlib --enable-tls --with-newlib --with-sysroot=/home/liana/riscv-crypto/build/riscv64-unknown-elf/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/home/liana/riscv-crypto/extern/riscv-gnu-toolchain/riscv-gcc --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)

I haven't had any success getting cryptography instructions compiled. Any help appreciated!

@nibrunieAtSi5
Copy link
Contributor

rv64imafdc does not include any crypto/bitmanip instructions indeed. You may want to try rv64imafdc_zbkb.

@lianakoleva
Copy link
Contributor Author

I was able to resolve this by getting a fresh install of GCC 13.2, Spike master branch, and adding extensions in -march as is conventional. I think the set-up instructions in this repo are out-of-date.

@nibrunieAtSi5
Copy link
Contributor

HI @lianakoleva , thank you for the follow-up.

Could you leave the issue open until we fix the repo ?

@lianakoleva lianakoleva reopened this Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants