Skip to content

Commit 7d8d4fd

Browse files
YuguoWHnashif
authored andcommitted
boards: arc: add a nsim_hs_mpuv6 board simulator
We add support of mpu v6 therefore it is needed to have a board to validate that feature. This commit add a new HS nsim simulator which supports mpu v6. Signed-off-by: Yuguo Zou <[email protected]>
1 parent eb14e21 commit 7d8d4fd

File tree

9 files changed

+199
-0
lines changed

9 files changed

+199
-0
lines changed

boards/arc/nsim/nsim_hs_mpuv6.dts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2021, Synopsys, Inc. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include "nsim.dtsi"
10+
11+
/ {
12+
model = "snps,nsim_hs";
13+
compatible = "snps,nsim_hs";
14+
15+
cpus {
16+
#address-cells = <1>;
17+
#size-cells = <0>;
18+
19+
cpu@0 {
20+
device_type = "cpu";
21+
compatible = "snps,archs";
22+
reg = <0>;
23+
};
24+
};
25+
};

boards/arc/nsim/nsim_hs_mpuv6.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
identifier: nsim_hs_mpuv6
2+
name: HS (with MPU v6) nSIM simulator
3+
type: mcu
4+
simulation: nsim
5+
arch: arc
6+
toolchain:
7+
- zephyr
8+
- arcmwdt
9+
testing:
10+
default: true
11+
ignore_tags:
12+
- net
13+
- bluetooth
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_SOC_NSIM=y
4+
CONFIG_SOC_NSIM_HS_MPUV6=y
5+
CONFIG_BOARD_NSIM=y
6+
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100
7+
CONFIG_XIP=n
8+
CONFIG_BUILD_OUTPUT_BIN=n
9+
CONFIG_PRINTK=y
10+
CONFIG_ARCV2_INTERRUPT_UNIT=y
11+
CONFIG_ARCV2_TIMER=y
12+
CONFIG_ARC_MPU_ENABLE=y
13+
CONFIG_CONSOLE=y
14+
CONFIG_UART_CONSOLE=y
15+
CONFIG_SERIAL=y
16+
CONFIG_ARC_EXCEPTION_DEBUG=y
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
-arcv2hs
2+
-core2
3+
-arcnum=3
4+
-rgf_num_banks=2
5+
-rgf_banked_regs=32
6+
-rgf_num_wr_ports=2
7+
-Xatomic
8+
-Xll64
9+
-Xunaligned
10+
-Xcode_density
11+
-Xdiv_rem=radix4
12+
-Xswap
13+
-Xbitscan
14+
-Xmpy_option=qmpyh
15+
-mpuv6
16+
-mpu_regions=32
17+
-Xshift_assist
18+
-Xbarrel_shifter
19+
-Xfpud_div
20+
-Xfpu_mac
21+
-Xtimer0
22+
-Xtimer0_level=1
23+
-Xtimer1
24+
-Xtimer1_level=0
25+
-Xrtc
26+
-action_points=8
27+
-Xstack_check
28+
-interrupts=72
29+
-interrupt_priorities=2
30+
-ext_interrupts=70
31+
-firq
32+
-interrupt_base=0x0
33+
-dcache=65536,64,2,a
34+
-dcache_feature=2
35+
-dcache_uncached_region
36+
-dcache_mem_cycles=2
37+
-icache=65536,64,4,a
38+
-icache_feature=2
39+
-dccm_size=0x40000
40+
-dccm_base=0x80000000
41+
-dccm_mem_cycles=2
42+
-iccm0_size=0x40000
43+
-iccm0_base=0x70000000
44+
-prop=nsim_mem-dev=uart0,kind=dwuart,base=0xf0000000,irq=24
45+
-noprofile
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
nsim_isa_family=av2hs
2+
nsim_isa_core=2
3+
arcver=0x52
4+
nsim_isa_rgf_num_banks=2
5+
nsim_isa_rgf_banked_regs=32
6+
nsim_isa_rgf_num_regs=32
7+
nsim_isa_rgf_num_wr_ports=2
8+
nsim_isa_big_endian=0
9+
nsim_isa_lpc_size=32
10+
nsim_isa_pc_size=32
11+
nsim_isa_addr_size=32
12+
nsim_isa_atomic_option=1
13+
nsim_isa_ll64_option=1
14+
nsim_isa_unaligned_option=1
15+
nsim_isa_code_density_option=2
16+
nsim_isa_div_rem_option=2
17+
nsim_isa_swap_option=1
18+
nsim_isa_bitscan_option=1
19+
nsim_isa_mpy_option=9
20+
nsim_isa_shift_option=3
21+
mpu_regions=32
22+
mpu_version=6
23+
nsim_isa_fpud_div_option=1
24+
nsim_isa_fpu_mac_option=1
25+
nsim_isa_enable_timer_0=1
26+
nsim_isa_timer_0_int_level=1
27+
nsim_isa_enable_timer_1=1
28+
nsim_isa_timer_1_int_level=0
29+
nsim_isa_rtc_option=1
30+
nsim_isa_num_actionpoints=8
31+
nsim_isa_stack_checking=1
32+
nsim_isa_number_of_interrupts=72
33+
nsim_isa_number_of_levels=2
34+
nsim_isa_number_of_external_interrupts=70
35+
nsim_isa_fast_irq=1
36+
nsim_isa_intvbase_preset=0x0
37+
dcache=65536,64,2,a
38+
nsim_isa_dc_feature_level=2
39+
nsim_isa_dc_uncached_region=1
40+
nsim_isa_dc_mem_cycles=2
41+
icache=65536,64,4,a
42+
nsim_isa_ic_feature_level=2
43+
dccm_size=0x40000
44+
dccm_base=0x80000000
45+
nsim_isa_dccm_mem_cycles=2
46+
iccm0_size=0x40000
47+
iccm0_base=0x70000000
48+
nsim_mem-dev=uart0,kind=dwuart,base=0xf0000000,irq=24

soc/arc/snps_nsim/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ else()
4444
-Xtimer0 -Xtimer1)
4545

4646
zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS_SMP -Hlib=hs38_full)
47+
48+
zephyr_compile_options_ifdef(CONFIG_SOC_NSIM_HS_MPUV6 -arcv2hs -core2 -Xatomic
49+
-Xunaligned -Xcode_density -Xswap -Xbitscan
50+
-Xmpy_option=qmpyh -Xshift_assist -Xbarrel_shifter
51+
-Xtimer0 -Xtimer1)
52+
53+
zephyr_ld_option_ifdef(CONFIG_SOC_NSIM_HS_MPUV6 -Hlib=hs38_full)
4754
endif()
4855

4956
zephyr_sources(

soc/arc/snps_nsim/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ config SOC_NSIM_HS_SMP
2929
bool "Multi-core Synopsys ARC HS in nSIM"
3030
select CPU_HAS_FPU
3131

32+
config SOC_NSIM_HS_MPUV6
33+
bool "Synopsys ARC HS with MPU v6 in nSIM"
34+
select CPU_HAS_MPU
35+
select CPU_HAS_FPU
36+
3237
config SOC_NSIM_HS6X
3338
bool "Synopsys ARC HS6x in nSIM"
3439

soc/arc/snps_nsim/Kconfig.defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ source "soc/arc/snps_nsim/Kconfig.defconfig.hs"
1616
source "soc/arc/snps_nsim/Kconfig.defconfig.hs_smp"
1717
source "soc/arc/snps_nsim/Kconfig.defconfig.hs6x"
1818
source "soc/arc/snps_nsim/Kconfig.defconfig.hs6x_smp"
19+
source "soc/arc/snps_nsim/Kconfig.defconfig.hs_mpuv6"
1920

2021
endif # SOC_NSIM
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2021 Synopsys, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_NSIM_HS_MPUV6
5+
6+
config CPU_HS3X
7+
default y
8+
9+
config NUM_IRQ_PRIO_LEVELS
10+
# This processor supports 16 priority levels:
11+
# 0 for Fast Interrupts (FIRQs) and 1-15 for Regular Interrupts (IRQs).
12+
default 2
13+
14+
config NUM_IRQS
15+
# must be > the highest interrupt number used
16+
default 30
17+
18+
config ARC_MPU_VER
19+
default 6
20+
21+
config MAX_DOMAIN_PARTITIONS
22+
default 32 if USERSPACE
23+
24+
config RGF_NUM_BANKS
25+
default 2
26+
27+
config SYS_CLOCK_HW_CYCLES_PER_SEC
28+
default 5000000
29+
30+
config HARVARD
31+
default y
32+
33+
config ARC_FIRQ
34+
default y
35+
36+
config CACHE_MANAGEMENT
37+
default y
38+
39+
endif # SOC_NSIM_HS_MPUV6

0 commit comments

Comments
 (0)