File: rvv-spike.cmake

package info (click to toggle)
simdutf 7.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,244 kB
  • sloc: cpp: 60,074; ansic: 14,226; python: 3,364; sh: 321; makefile: 12
file content (38 lines) | stat: -rw-r--r-- 1,306 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# This is a toolchain file designed to allow *developers*
# to locally run the RISC-V Vector extensions correctness tests.
#
# We assume the developer machine has two auxiliary programs:
# 1. Spike --- ISA-level simulator
# 2. Proxy kernel --- thin layer that allows to run simple
#    C programs on top of Spike.
#
# Usage:
# $ cmake -DCMAKE_TOOLCHAIN_FILE=toolchain-rvv-spike.cmake
set(CMAKE_SYSTEM_NAME Generic)

set(target       riscv64-linux-gnu)
set(version      13)
set(c_compiler   gcc)
set(cxx_compiler g++)

set(CMAKE_C_COMPILER   "${target}-${c_compiler}-${version}")
set(CMAKE_CXX_COMPILER "${target}-${cxx_compiler}-${version}")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

find_file(RISCV_SPIKE "spike" REQUIRED
          DOC "Spike, a RISC-V ISA Simulator (https://github.com/riscv-software-src/riscv-isa-sim)")
find_file(RISCV_PK "pk" REQUIRED
          DOC "RISC-V Proxy Kernel (https://github.com/riscv-software-src/riscv-pk)")

set(RISCV_ISA "rv64gcv")
set(CMAKE_CROSSCOMPILING_EMULATOR "${RISCV_SPIKE};--isa=${RISCV_ISA};${RISCV_PK}")

# Reason: pk expects static linkage
set(CMAKE_EXE_LINKER_FLAGS "-static")

add_compile_options(-march=rv64gcv)
add_compile_definitions(RUN_IN_SPIKE_SIMULATOR)