@ -4,5 +4,54 @@ set(CMAKE_SYSTEM_PROCESSOR riscv64)
set ( CMAKE_CXX_COMPILER riscv64-unknown-linux-gnu-g++ )
set ( CMAKE_CXX_COMPILER riscv64-unknown-linux-gnu-g++ )
set ( CMAKE_C_COMPILER riscv64-unknown-linux-gnu-gcc )
set ( CMAKE_C_COMPILER riscv64-unknown-linux-gnu-gcc )
set ( CMAKE_CXX_FLAGS_INIT "-march=rv64gcv -mabi=lp64d -D__riscv_vector_071" )
# M a n g o P i M Q P r o - C 9 0 6 F D , C 9 0 6 F D V
set ( CMAKE_C_FLAGS_INIT "-march=rv64gcv -mabi=lp64d -D__riscv_vector_071" )
# L i c h e e P i 4 A - C 9 1 0 , C910V ( ? )
# C a n M V K 2 3 0 - C 9 0 8 , C 9 0 8 V
# S e e h t t p s : / / g i t h u b . c o m / T - h e a d - S e m i / g c c / b l o b / x u a n t i e - g c c - 1 0 . 4 . 0 / g c c / c o n f i g / r i s c v / r i s c v - c o r e s . d e f
set ( _enable_vector OFF )
if ( CORE STREQUAL "C906FD" )
set ( CMAKE_C_FLAGS_INIT "-mcpu=c906fd -mabi=lp64d -mtune=c906fd" )
set ( CMAKE_CXX_FLAGS_INIT "-mcpu=c906fd -mabi=lp64d -mtune=c906fd" )
elseif ( CORE STREQUAL "C906FDV" )
set ( CMAKE_C_FLAGS_INIT "-mcpu=c906fd -mabi=lp64d -mtune=c906fd" )
set ( CMAKE_CXX_FLAGS_INIT "-mcpu=c906fd -mabi=lp64d -mtune=c906fd" )
# D i s a b l e d d u e t o l i m i t e d 6 4 - b i t S E W s u p p o r t
# set ( _enable_vector ON )
elseif ( CORE STREQUAL "C908" )
set ( CMAKE_C_FLAGS_INIT "-mcpu=c908 -mabi=lp64d -mtune=c908" )
set ( CMAKE_CXX_FLAGS_INIT "-mcpu=c908 -mabi=lp64d -mtune=c908" )
elseif ( CORE STREQUAL "C908V" )
set ( CMAKE_C_FLAGS_INIT "-mcpu=c908v -mabi=lp64d -mtune=c908" )
set ( CMAKE_CXX_FLAGS_INIT "-mcpu=c908v -mabi=lp64d -mtune=c908" )
set ( _enable_vector ON ) # R V V 1 . 0
elseif ( CORE STREQUAL "C910" )
set ( CMAKE_C_FLAGS_INIT "-mcpu=c910 -mabi=lp64d -mtune=c910" )
set ( CMAKE_CXX_FLAGS_INIT "-mcpu=c910 -mabi=lp64d -mtune=c910" )
elseif ( CORE STREQUAL "C910V" )
set ( CMAKE_C_FLAGS_INIT "-march=rv64imafdcv0p7xthead -mabi=lp64d" )
set ( CMAKE_CXX_FLAGS_INIT "-march=rv64imafdcv0p7xthead -mabi=lp64d" )
set ( _enable_vector ON ) # R V V 0 . 7 . 1
elseif ( CORE STREQUAL "C920" )
set ( CMAKE_C_FLAGS_INIT "-mcpu=c920 -mabi=lp64d -mtune=c920" )
set ( CMAKE_CXX_FLAGS_INIT "-mcpu=c920 -mabi=lp64d -mtune=c920" )
set ( _enable_vector ON ) # R V V 0 . 7 . 1
elseif ( CORE STREQUAL "C920V2" )
set ( CMAKE_C_FLAGS_INIT "-mcpu=c920v2 -mabi=lp64d -mtune=c920v2" )
set ( CMAKE_CXX_FLAGS_INIT "-mcpu=c920v2 -mabi=lp64d -mtune=c920v2" )
set ( _enable_vector ON ) # R V V 1 . 0
else ( )
set ( CMAKE_C_FLAGS_INIT "-march=rv64imafdc_zihintpause_zfh_zba_zbb_zbc_zbs_xtheadc -mabi=lp64d" )
set ( CMAKE_CXX_FLAGS_INIT "-march=rv64imafdc_zihintpause_zfh_zba_zbb_zbc_zbs_xtheadc -mabi=lp64d" )
endif ( )
if ( _enable_vector )
set ( CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -D__riscv_vector_071 -mrvv-vector-bits=128" )
set ( CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} -D__riscv_vector_071 -mrvv-vector-bits=128" )
endif ( )
if ( ENABLE_GCOV )
set ( CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} -fprofile-arcs -ftest-coverage" )
set ( CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -fprofile-arcs -ftest-coverage" )
endif ( )