1# SPDX-License-Identifier: Apache-2.0
2
3if(COMPILER STREQUAL gcc)
4  # GNU compiler options
5  zephyr_compile_options(-mcpu=${GCC_M_CPU})
6
7  if(CONFIG_ISA_ARCV2)
8    # ISA_ARCV2 & 32BIT
9    zephyr_compile_options(-mno-sdata)
10    zephyr_compile_options_ifdef(CONFIG_CPU_ARCHS -mmpy-option=plus_qmacw)
11    zephyr_compile_options_ifdef(CONFIG_FPU -mfpu=fpud_all)
12  endif()
13else()
14  # MWDT compiler options
15
16  zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS -arcv2hs -core2 -Xatomic
17			       -Xll64 -Xdiv_rem=radix4 -Xunaligned -Xcode_density
18			       -Xswap -Xbitscan -Xmpy_option=qmpyh -Xshift_assist
19			       -Xbarrel_shifter -Xfpud_div -Xfpu_mac -Xrtc
20			       -Xtimer0 -Xtimer1)
21
22  zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS -Hlib=hs38_full)
23
24  zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS_SMP -arcv2hs -core2 -Xatomic
25			       -Xll64 -Xdiv_rem=radix4 -Xunaligned -Xcode_density
26			       -Xswap -Xbitscan -Xmpy_option=qmpyh -Xshift_assist
27			       -Xbarrel_shifter -Xfpud_div -Xfpu_mac -Xrtc
28			       -Xtimer0 -Xtimer1)
29
30  zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS_SMP -Hlib=hs38_full)
31
32  zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS_MPUV6 -arcv2hs -core2 -Xatomic
33			       -Xll64 -Xdiv_rem=radix4 -Xunaligned -Xcode_density
34			       -Xswap -Xbitscan -Xmpy_option=qmpyh -Xshift_assist
35			       -Xbarrel_shifter -Xfpud_div -Xfpu_mac -Xrtc
36			       -Xtimer0 -Xtimer1)
37
38  zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS_MPUV6 -Hlib=hs38_full)
39
40  zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS5X -arcv3hs -core0 -Xdual_issue -uarch_rev=0:0
41			       -HL -Hlpc_width=0 -Xatomic=2 -Xll64 -Xunaligned -Xdiv_rem=radix4 -Xmpy_option=qmpyh
42			       -Xtimer0 -Xtimer1 -Xrtc -dcache=32768,64,2,a -Hld_cycles=1)
43
44  zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS5X -Hlib=hs58_full)
45
46  zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS5X_SMP -arcv3hs -core0 -Xdual_issue -uarch_rev=0:0
47             -HL -Hlpc_width=0 -Xatomic=2 -Xll64 -Xunaligned -Xdiv_rem=radix4 -Xmpy_option=qmpyh
48             -Xtimer0 -Xtimer1 -Xrtc -dcache=32768,64,2,a -Hld_cycles=1)
49
50  zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS5X_SMP -Hlib=hs58_full)
51
52  zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS6X -arc64 -core0 -uarch_rev=0:0 -HL -Xatomic=2
53             -Xunaligned -Xmpy_cycles=3 -Xtimer0 -Xtimer1 -Xrtc -dcache=32768,64,2,a -Hld_cycles=1)
54
55  zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS6X -Hlib=hs68_full_zephyr)
56
57  zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS6X_SMP -arc64 -core0 -uarch_rev=0:0 -HL -Xatomic=2
58             -Xunaligned -Xmpy_cycles=3 -Xtimer0 -Xtimer1 -Xrtc -dcache=32768,64,2,a -Hld_cycles=1)
59
60  zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS6X_SMP -Hlib=hs68_full_zephyr)
61endif()
62