How to compile instructions for Hwacha?
Hello,
Since website for Hwacha has been deprecated, I thought maybe here is right place to ask questions about Hwacha.
It is written in website below https://chipyard.readthedocs.io/en/latest/Generators/Hwacha.html
To run "./scripts/build-toolchains.sh esp-tools" to install toolchains for Hwacha.
As far as I understand, we need to run "./scripts/build-toolchains.sh esp-tools" and install risc-v-gnu-toolchain for cross compilation.
What confuses me is that, how does command for compiling Hwacha custom instructions and standard instructions differ?
Thank you.
The esp-tools toolchain includes a patched version of binutils that adds support for the Hwacha custom extension: https://github.com/ucb-bar/esp-binutils-gdb/tree/riscv-binutils-2.35
To build Hwacha assembly code, you must pass -march=rv64gcxhwacha to gcc or GNU as, as demonstrated by the Makefile for compiling the example Hwacha benchmarks:
https://github.com/ucb-bar/esp-tests/blob/master/benchmarks/Makefile#L56
Thank you very much!
@haeunlee22 @a0u I tried to run C code on hawacha compiler. First I installed chipyard repo from: https://chipyard.readthedocs.io/en/stable/Chipyard-Basics/Initial-Repo-Setup.html and also ran ./build-setup.sh esp-tools from the script.
I compiled my C code by giving -march=rv64gcxhwacha to riscv64-unknown-linux-gcc. and my code got compiled . But when I am trying to execute the file it is showing me illegeal instruction.
The command I gave to compile my C code is riscv64-unknown-linux-gcc -march=rv64gcxhwacha example.c.
After this the a.out executable is generated. But couldnot execute this.
What should I do to compile my C code on Hawacha and then execute on RISC V.
@asb HI, do you solve the problem, please let me, I am facing the same issue. Thanks for any reply