DesignWare(R) ARC(R) Emulation (nsim)

Overview

This board configuration will use Designware ARC nSIM to emulate a virtual ARC EM or ARC HS based board including the following features:

  • ARC EM or ARC HS processor
  • ARC internal timer
  • a virtual output only console (uart-nsim)

There are four supported board sub-configurations:

  • nsim_em which includes normal ARC EM features and ARC MPUv2
  • nsim_sem which includes secure ARC EM features and ARC MPUv3
  • nsim_hs which includes base ARC HS features, i.e. w/o PMU and MMU
  • nsim_hs_smp which includes base ARC HS features in multi-core cluster, still w/o PMU and MMU

For detailed arc features, please refer to boards/arc/nsim/support/nsim_em.props, boards/arc/nsim/support/nsim_sem.props, boards/arc/nsim/support/nsim_hs.props and boards/arc/nsim/support/mdb_hs_smp.args

Hardware

Supported Features

The following hardware features are supported:

Interface Controller EM SEM HS Driver/Component
INT on-chip Y Y Y interrupt_controller
UART nsim uart Y Y Y serial port-polling
TIMER on-chip Y Y Y system clock

Programming and Debugging

Required Hardware and Software

To use Zephyr RTOS applications on this board, Designware ARC nSIM or Designware ARC nSIM Lite is required.

Building Sample Applications

Use this configuration to run basic Zephyr applications and kernel tests in nSIM, for example, with the Synchronization Sample:

# From the root of the zephyr repository
west build -b nsim_em samples/synchronization
west flash

This will build an image with the synchronization sample app, boot it using nsim, and display the following console output:

***** BOOTING ZEPHYR OS v1.12 - BUILD: July 6 2018 15:17:26 *****
threadA: Hello World from arc!
threadB: Hello World from arc!
threadA: Hello World from arc!
threadB: Hello World from arc!

Note

To exit the simulator, use Ctrl+], then Ctrl+c

Debugging

Note

The normal make debug command won’t work for debugging applications using nsim because both the nsim simulator and the gdb debugger use the console for output. You need to use separate terminal windows for each tool to avoid intermixing their output.

After building your application, cd to the build folder and open two terminal windows. In terminal one, use nsim to start a GDB server and wait for a remote connection:

# for ninja build system:
ninja debugserver
# for make build system:
make debugserver

In terminal two, connect to the GDB server using arc-elf32-gdb. This command loads the symbol table from the elf binary file, for example the ./zephyr/zephyr.elf file:

..../path/to/arc-elf32-gdb zephyr/zephyr.elf
(gdb) target remote : 3333
(gdb) load

Now the debug environment has been set up, you can debug the application with gdb commands.

References