Help with llvm/clang compiler for Snitch Cluster simulation (-mcpu=snitch Issue)
#1
Hello, everyone!

I've been trying to simulate a Snitch cluster, and I'm currently facing an issue while compiling software to execute with snitch_cluster.vsim. Specifically, the clang compiler doesn't seem to recognize the -mcpu=snitch option.

This leads me to believe that my llvm for PULP platform build wasn't successful. Here's an overview of what I've done so far:
  1. I cloned the LLVM repository at https://github.com/pulp-platform/llvm-project 
  2. Built LLVM and clang with the following options:

    Code:
    cmake \
        -DCMAKE_BUILD_TYPE="Release" -DLLVM_ENABLE_ASSERTIONS=ON \
        -DCMAKE_INSTALL_PREFIX=${INSTALLPREFIX} \
        -DLLVM_ENABLE_PROJECTS="clang" \
        -DLLVM_TARGETS_TO_BUILD="RISCV" \
        -DLLVM_DEFAULT_TARGET_TRIPLE="riscv32-unknown-elf" \
        -DLLVM_APPEND_VC_REV=OFF \
        -G "Unix Makefiles" ../llvm

  3. Updated my PATH to include the /build/bin directory, the build itself and clang seems to be working properly.

However, when I try to use the -mcpu=snitch flag during my Snitch cluster make all, I get the following error message:

clang-12: warning: argument unused during compilation: '-mcpu=snitch' [-Wunused-command-line-argument]
as well as others indicating that Snitch related clang builtins are not working properly.

Could someone guide me on the correct steps for building LLVM and Clang to include support for the Snitch cluster?

Any help or advice would be greatly appreciated!
Thanks in advance!
Reply
#2
Just a short clarifying question, the compilation log should show which executables are being used during the compilation. Can you make sure that the commands from the compilation actually come from the build directory. It might be an issue with a typo in the PATH, something else being first in the PATH or some sort of mistake in the cmakefile that could not get the directory properly. In this case the LLVM with snitch support would be compiled properly but is (for some reason) not getting used.

Let's just amke sure that this is not the problem
Visit pulp-platform.org and follow us on twitter @pulp_platform
Reply
#3
Thanks for the reply!

Both the compilation log and using which clang and which llc commands point toward the executables in my /llvm-project/build/bin folders.
Also, when using llc --version to list the registered targets for the llc compiler, the snitch target doesn't show up. This seems to confirm that the Snitch target wasn't properly included during my build, since, in my understanding, the compilation eventually calls llc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)