hardware/arch/xtensa.html · hardware/arch/xtensa.rst 공식 원문 ↗

Zephyr 3.7.0 · Hardware · Architecture · Xtensa

Xtensa 개발자 가이드

Thread 수에 따라 HiFi register context를 보존하는 세 mode를 구분합니다.

Official pathhardware/arch/xtensa.html
Source filehardware/arch/xtensa.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

No-HiFi, unshared, shared mode와 context-switch stack 비용을 설명합니다.

HiFi modes

none · unshared · shared

Scope

threads only · no ISR

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 2C62141AF3EC1F6E36513A81609994DC2DEA06FA4B60380F6878FD9794C37138
.. _xtensa_developer_guide:

Xtensa Developer Guide
######################

Overview
********

This page contains information on certain aspects when developing for
Xtensa-based platforms.

HiFi Audio Engine DSP
*********************

The kernel allows threads to use the HiFi Audio Engine DSP registers on boards
that support these registers. The kernel only supports the use of the HiFi
registers by threads and not ISRs.

.. note::
    Presently, only the Intel ADSP ACE hardware platforms are configured for
    HiFi support by default.

Concepts
========

The kernel can be configured for an application to leverage the services
provided by the Xtensa HiFi Audio Engine DSP. Three modes of operation are
supported, which are described below.

No HiFi registers mode
----------------------

This mode is used when the application has no threads that use the HiFi
registers. It is the kernel's default HiFi services mode.

Unshared HiFi registers mode
----------------------------

This mode is used when the application has only a single thread that uses the
HiFi registers. The HiFi registers are left unchanged whenever a context
switch occurs.

.. note::
    The behavior is undefined, if two or more threads attempt to use
    the HiFi registers, as the kernel does not attempt to detect
    (nor prevent) multiple threads from using these registers.

Shared HiFi registers mode
--------------------------

This mode is used when the application has two or more threads that use HiFi
registers. When enabled, the kernel automatically allows all threads to use the
HiFi registers. During each thread context switch, the kernel saves the outgoing
thread's HiFi registers and loads the incoming thread's HiFi registers,
regardless of whether the thread utilizes them or not.

Additional stack space may be required for each thread to account for the extra
registers that must be saved.

Configuration Options
=====================

The unshared HiFi registers mode is selected when configuration option
:kconfig:option:`CONFIG_XTENSA_HIFI_SHARING` is disabled but configuration
options :kconfig:option:`CONFIG_XTENSA_HIFI3` and/or
:kconfig:option:`CONFIG_XTENSA_HIFI4` are enabled.

The shared HiFi registers mode is selected when the configuration option
:kconfig:option:`CONFIG_XTENSA_HIFI_SHARING` is enabled in addition to
configuration options :kconfig:option:`CONFIG_XTENSA_HIFI3` and/or
:kconfig:option:`CONFIG_XTENSA_HIFI4`. Threads must have sufficient
stack space for saving the HiFi register values during context switches
as described above.

Part 3

한국어 전문 번역

개요

이 페이지는 Xtensa 기반 platform용 Zephyr를 개발할 때 필요한 일부 사항을 설명합니다.

HiFi Audio Engine DSP

Kernel은 해당 register를 지원하는 board에서 thread가 HiFi Audio Engine DSP register를 사용하도록 허용합니다. HiFi register는 thread에서만 지원하고 ISR에서는 지원하지 않습니다.

현재 기본적으로 HiFi 지원이 설정된 hardware platform은 Intel ADSP ACE뿐입니다.

개념

애플리케이션이 Xtensa HiFi Audio Engine DSP service를 활용하도록 kernel을 세 가지 mode로 설정할 수 있습니다.

HiFi register를 사용하지 않는 mode

HiFi register를 쓰는 thread가 하나도 없을 때 사용하며 kernel의 기본 HiFi service mode입니다.

Unshared HiFi register mode

HiFi register를 쓰는 thread가 하나뿐일 때 사용합니다. Context switch가 발생해도 HiFi register 값은 바꾸지 않습니다.

둘 이상의 thread가 HiFi register를 쓰려고 하면 동작이 정의되지 않습니다. Kernel은 여러 thread의 사용을 감지하거나 막지 않습니다.

Shared HiFi register mode

HiFi register를 쓰는 thread가 둘 이상일 때 사용합니다. 활성화하면 모든 thread가 HiFi register를 사용할 수 있고, context switch마다 실제 사용 여부와 관계없이 나가는 thread의 HiFi register를 저장하고 들어오는 thread의 값을 load합니다.

추가 register를 저장해야 하므로 thread마다 stack 공간이 더 필요할 수 있습니다.

설정 option

CONFIG_XTENSA_HIFI_SHARING을 끄고 CONFIG_XTENSA_HIFI3 또는 CONFIG_XTENSA_HIFI4를 켜면 unshared mode를 선택합니다.

CONFIG_XTENSA_HIFI3 또는 CONFIG_XTENSA_HIFI4와 함께 CONFIG_XTENSA_HIFI_SHARING도 켜면 shared mode를 선택합니다. Thread는 context switch 때 HiFi register 값을 저장할 충분한 stack을 가져야 합니다.

Source

출처

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