Development standards for Xtensa HiFi4 DSP projects with FFT/IFFT implementations, including Python docstring conventions, Docker requirements, and automated experiment tracking.
Enforce development standards for Xtensa HiFi4 DSP projects, ensuring proper documentation, environment management, experiment tracking, and compilation workflows for FFT/IFFT implementations.
When working on HiFi4 DSP projects (particularly FFT/IFFT implementations), enforce these standards:
- Brief description
- Args section with type hints
- Returns section with type
- Raises section if applicable
- Example usage when helpful
Example format:
```python
def function_name(arg1: int, arg2: str) -> bool:
"""Brief description of function.
Args:
arg1: Description of arg1
arg2: Description of arg2
Returns:
Description of return value
Raises:
ValueError: When invalid input is provided
"""
```
- `requirements.txt` for Python dependencies
- `Dockerfile` for containerized dependencies
- Base image specification
- All system dependencies
- Python package installation
- Xtensa toolchain setup if needed
- Working directory configuration
- Experiment number
- Date (YYYYMMDD format recommended)
- Generating function name
Example: `exp003_20260203_fft_analysis.png` or `exp003_20260203_generate_frequency_plot.csv`
Apply to:
- Commands executed
- Problems encountered
- Code modifications made
- Results and observations
Example format:
```
實驗 003 - 2026-02-03
==================
執行指令:
xt-clang fftifft_32_32_test_other_signal1.c -o fftifft_test_program ...
遇到問題:
- 編譯錯誤: undefined reference to 'fft_real32x32'
解決步驟:
1. 檢查 library 連結順序
2. 添加 -lNatureDSP_Signal 到編譯指令
3. 重新編譯成功
結果:
- FFT 測試通過,輸出於 exp003_20260203_fft_result.txt
```
**On first terminal session, export these environment variables:**
```bash
export XTENSA_SYSTEM=/home/yu-chen/xtensa/XtDevTools/install/tools/RI-2021.6-linux/XtensaTools/config
export XTENSA_BASE=/home/yu-chen/xtensa/XtDevTools/install
export XTENSA_CORE=hifi4_ss_spfpu_7
```
Consider adding to `~/.bashrc` or creating a setup script for persistence.
**Compile command pattern:**
```bash
xt-clang [source_file].c \
-o [output_program] \
-I/home/yu-chen/下載/HiFi4_VFPU_Library_v4_1_0/hifi4_library/include \
-L. \
-lAll_fft_NatureDSP_Signal-hifi4_ss_spfpu_7_llvm-Xtensa-release \
-lm
```
**Run command:**
```bash
xt-run [output_program]
```
**Example:**
```bash
xt-clang fftifft_32_32_test_other_signal1.c \
-o fftifft_test_program_nature_q15 \
-I/home/yu-chen/下載/HiFi4_VFPU_Library_v4_1_0/hifi4_library/include \
-L. \
-lAll_fft_NatureDSP_Signal-hifi4_ss_spfpu_7_llvm-Xtensa-release \
-lm
xt-run fftifft_test_program_nature_q15
```
Before committing code, verify:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/hifi4-dsp-development-guidelines/raw