中山大学电信院 EIT349 梁凡老师的 DSP 器件原理与应用课程作业(2020 秋)。
Homework for Principles and Applications of DSP Devices, SYSU SEIT, Fall 2020.
512 x 1.5 resize
function cycle count in different implementations (debug mode, optimization not enabled):
C float approach | C int approach | Linear assembly |
---|---|---|
1654442635 | 1027521855 | 60202045 |
Enter Y, Cb, Cr (comma seprated): 123, 123, 123
Y:123, Cb:123, Cr:123
-- C (floating-point multiply) ---> R:136, G:148, B:134 | took 2595 cycles.
-- Linear ASM (16-bit multiply) --> R:136, G:148, B:134 | took 38 cycles.
-- Linear ASM (8-bit multiply) ---> R:135, G:147, B:133 | took 39 cycles.
欢迎在 Discussions 讨论,利用 Issues 跟踪代码问题, 以及提交 PR 分享你的代码。
Documents:
- TMS320C6000 Technical Brief
- TMS320C6000 Optimizing Compiler v7.4 User's Guide
- TMS320C6000 Assembly Language Tools v7.4 User's Guide
- TMS320C64x/C64x+ DSP CPU and Instruction Set Reference Guide
- TMS320C6000 Programmer's Guide
- TI-RTOS Kernel (SYS/BIOS) User's Guide
- Introduction to TMS320C6000 DSP Optimization
- TMS320C6000 Integer Division
- Performance Tuning with the “Restrict” Keyword
Websites:
- Code Composer Studio User's Guide
- CCS Resource Index
- CCS Technical Documents
- Code Gneration Tools v7.4
- Customizing the clock and time Functions
- TI Processors Wiki
- TI DSP Overview
Code Composer Studio
v8.3.1 on Windows 10 20H2TI Code Gneration Tools
v7.4.24
Note: Texas Instruments Simulators
connection is required to run the CPU cycle accurate simulation without the actual development board, which was only existed in CCS prior to v6. This is the reason why the course recommended CCS v5, but it's quite old. However, there is a hack to migrate the software simulation to newer versions of CCS up to v8.3.1, thus I decided to use it. Code Generation Tools v7.4 is the last version of CGT to support C64/C64+, which was released in 2018.
-
Device:
- Family: C6000
- Variant: DaVinci DM64x, TMS320DM648
Target configs are provided in the file
targetConfigs/TMS320DM648.ccxml
-
Tool-chain:
- Output format: eabi (ELF)
- Device endianness: little
- Linker command file:
DM648.cmd
Modified linker command file is provided as
DM648.cmd
. -
Build
- C6000 Compiler
- Include Options: Add
${PROJECT_ROOT}/include
- Performance Adviser:
--advise:performance=all
- Include Options: Add
- C6000 Linker
- Heap size for C/C++ dynamic memory allocation:
--heap_size=0x200000
- Heap size for C/C++ dynamic memory allocation:
The program uses
malloc
to dynamically allocate memory for the images. The.sysmem
section of memory should be adjust to accommodate every images since the default size of 1KB is clearly not enough. More info about the cmd file could be found here. - C6000 Compiler
- Build
- C6000 Compiler
- Optimization: off
- Debug Options: Full symbolic debug
-g
- Advanced Options
- Predefined Symbols:
--define=DEBUG
- Assembler Options:
--keep_asm
- Predefined Symbols:
- C6000 Compiler
- Build
- C6000 Compiler
- Optimization:
-O2
- Debug Options: Symbolic debug for program analysis
--symdebug:skeletal
- Advanced Options
- Predefined Symbols:
--define=RELEASE
- Runtime Model Options: Generate verbose software pipelining information
--mw
- Predefined Symbols:
- Optimization:
- C6000 Compiler
Other options are assumed to be default.
- Define
USE_SA_IMPL
to linkresize
function's linear assembly implementations, the C implementation would be used otherwise. - Define
USE_INT
to switchresize
function's C implementation to its fixed-point multiplication approach, floating-point multiplication would be used otherwise.
Code, build and hit debug!
- 实验 1:用 C 语言实现 8 位 DIB 双线性插值
- 实验 2:双线性插值函数使用线性汇编语言实现
- 实验 3:用 C 语言和线性汇编语言完成从 YCbCr 彩色空间到 RGB 彩色空间的转换
- 实验 4:用 C 语言完成线性变换程序并优化
- 实验 5:用 C 语言和线性汇编语言实现中值滤波器
- 实验 6:通过 DSP/BIOS, 利用 C 语言完成工作