chipyard icon indicating copy to clipboard operation
chipyard copied to clipboard

How to Compile C code for Hwacha Compiler

Open ashu-bitspilani opened this issue 3 years ago • 0 comments

Background Work

Feature Description

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.

Motivating Example

What should I do to compile my C code on Hawacha and then execute on RISC V.

I am trying to compile the accum.c file from https://github.com/ucb-bar/chipyard/blob/main/tests/accum.c to test of hwacha compiler.

ashu-bitspilani avatar May 10 '23 15:05 ashu-bitspilani