develop/toolchains/cadence_xcc.html · develop/toolchains/cadence_xcc.rst 공식 원문 ↗

Zephyr 3.7.0 · Develop · Toolchains · Xtensa

Cadence Tensilica XCC

SoC별 Xtensa SDK와 core ID를 맞추고 XCC 또는 xt-clang build 환경을 구성합니다.

Official pathdevelop/toolchains/cadence_xcc.html
Source filedevelop/toolchains/cadence_xcc.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Xtensa Xplorer와 SoC add-on 설치, XCC·Clang compiler 선택, license와 네 가지 환경 변수, 오래된 LLVM assembler 오류 우회를 설명합니다.

SDK

Xplorer · SoC add-on

Compiler

xcc · xt-clang

Target

core · version

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 2D7A5B3B96457D4A82F93770E1FDED54FD645878C5D0761893BCA5C8E4CFD01B
.. _toolchain_cadence_xcc:

Cadence Tensilica Xtensa C/C++ Compiler (XCC)
#############################################

#. Obtain Tensilica Software Development Toolkit targeting the specific SoC
   on hand. This usually contains two parts:

   * The Xtensa Xplorer which contains the necessary executables and
     libraries.

   * A SoC-specific add-on to be installed on top of Xtensa Xplorer.

     * This add-on allows the compiler to generate code for the SoC on hand.

#. Install Xtensa Xplorer and then the SoC add-on.

   * Follow the instruction from Cadence on how to install the SDK.

   * Depending on the SDK, there are two set of compilers:

     * GCC-based compiler: ``xt-xcc`` and its friends.

     * Clang-based compiler: ``xt-clang`` and its friends.

#. Make sure you have obtained a license to use the SDK, or has access to
   a remote licensing server.

#. :ref:`Set these environment variables <env_vars>`:

   * Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``xcc`` or ``xt-clang``.
   * Set :envvar:`XTENSA_TOOLCHAIN_PATH` to the toolchain installation
     directory.
   * Set :envvar:`XTENSA_CORE` to the SoC ID where application is being
     targeting.
   * Set :envvar:`TOOLCHAIN_VER` to the Xtensa SDK version.

#. For example, assuming the SDK is installed in ``/opt/xtensa``, and
   using the SDK for application development on ``intel_adsp_cavs15``,
   setup the environment using:

   .. code-block:: console

      # Linux
      export ZEPHYR_TOOLCHAIN_VARIANT=xcc
      export XTENSA_TOOLCHAIN_PATH=/opt/xtensa/XtDevTools/install/tools/
      export XTENSA_CORE=X6H3SUE_RI_2018_0
      export TOOLCHAIN_VER=RI-2018.0-linux

#. To use Clang-based compiler:

   * Set :envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``xt-clang``.

   * Note that the Clang-based compiler may contain an old LLVM bug which
     results in the following error:

     .. code-block:: console

        /tmp/file.s: Assembler messages:
        /tmp/file.s:20: Error: file number 1 already allocated
        clang-3.9: error: Xtensa-as command failed with exit code 1

     If this happens, set :envvar:`XCC_NO_G_FLAG` to ``1``.

     * For example:

       .. code-block:: console

          # Linux
          export XCC_NO_G_FLAG=1

Part 3

한국어 전문 번역

Cadence Tensilica XCC 설정

  1. 대상 SoC용 Tensilica Software Development Toolkit을 준비합니다. 보통 필요한 executable과 library를 담은 Xtensa Xplorer, 그리고 그 위에 설치해 compiler가 해당 SoC code를 생성하게 하는 SoC 전용 add-on의 두 부분으로 구성됩니다.
  2. Cadence 안내에 따라 Xtensa Xplorer와 SoC add-on을 차례로 설치합니다. SDK에 따라 GCC 기반 xt-xcc 계열 또는 Clang 기반 xt-clang 계열 compiler가 제공됩니다.
  3. SDK 사용 license를 확보하거나 remote license server에 접근할 수 있어야 합니다.
  4. 환경 변수 설정 안내에 따라 ZEPHYR_TOOLCHAIN_VARIANT를 xcc 또는 xt-clang으로, XTENSA_TOOLCHAIN_PATH를 설치 directory로, XTENSA_CORE를 대상 SoC ID로, TOOLCHAIN_VER을 Xtensa SDK version으로 설정합니다.

/opt/xtensa에 SDK를 설치하고 intel_adsp_cavs15용 application을 개발하는 Linux 예:

# Linux
export ZEPHYR_TOOLCHAIN_VARIANT=xcc
export XTENSA_TOOLCHAIN_PATH=/opt/xtensa/XtDevTools/install/tools/
export XTENSA_CORE=X6H3SUE_RI_2018_0
export TOOLCHAIN_VER=RI-2018.0-linux

Clang 기반 compiler

xt-clang을 사용하려면 ZEPHYR_TOOLCHAIN_VARIANT=xt-clang으로 설정합니다. 다만 SDK의 Clang에 오래된 LLVM bug가 포함되어 다음 오류가 발생할 수 있습니다.

/tmp/file.s: Assembler messages:
/tmp/file.s:20: Error: file number 1 already allocated
clang-3.9: error: Xtensa-as command failed with exit code 1

이 오류가 발생하면 debug 정보용 -g option을 억제하도록 XCC_NO_G_FLAG=1을 설정합니다.

# Linux
export XCC_NO_G_FLAG=1

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.