中山大学电信院 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.
欢迎讨论
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
- TMS320 DSP/BIOS v5.42 User's Guide
- TMS320C6000 DSP/BIOS 5.x API Reference Guide
- DSP/BIOS Timers and Benchmarking Tips
- 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
- DSP/BIOS 5.42.02.10 Release
- Customizing the clock and time Functions
- TI Processors Wiki
- TI DSP Overview
- 实验 1:用 C 语言实现 8 位 DIB 双线性插值 -
task1-2
分支 - 实验 2:双线性插值函数使用线性汇编语言实现 -
task1-2
分支 - 实验 3:用 C 语言和线性汇编语言完成从 YCbCr 彩色空间到 RGB 彩色空间的转换 -
task3
分支 - 实验 4:用 C 语言完成线性变换程序并优化 -
task4
分支 - 实验 5:用 C 语言和线性汇编语言实现中值滤波器 -
task5
分支 - 实验 6:通过 DSP/BIOS, 利用 C 语言完成工作 -
task6
分支
Code Composer Studio
v8.3.1 on Windows 10 20H2TI Code Gneration Tools
v7.4.24 fortasks 1-5
TI Code Gneration Tools
v7.4.23 fortask 6
DSP/BIOS
v5.42.02.10 fortask 6
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.
The last version of DSP/BIOS
is v5.42.02.10. Annoyingly, it's not working with CGT
v7.4.24 as reported here. Roll back to CGT
v7.4.23 or earlier to work with task6
.
-
Device:
- Family: C6000
- Variant: DaVinci DM64x, TMS320DM648
Target configs are provided in the filetargetConfigs/TMS320DM648.ccxml
.
-
Tool-chain:
- Output format: eabi (ELF)
- Device endianness: little
- Linker command file:
DM648.cmd
Modified linker command file is provided asDM648.cmd
. L2RAM has been increased to 4MB.
-
Build
-
C6000 Compiler
- Include Options: Add
${PROJECT_ROOT}/include
- Performance Adviser:
--advise:performance=all
- Advanced Options
- Assembler Options:
--keep_asm
Keep the intermediate assembly files to check software pipeline information.
- Assembler Options:
- 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. -
- Device:
- Family: C6000
- Variant: DaVinci DM64x, DM642
Target configs are provided in the filetargetConfigs/EVMDM642.ccxml
.
- Tool-chain:
- Output format: Legacy COFF
C6000 EABI is not supported in DSP/BIOS. - Device endianness: little
- Linker command file:
<none>
Memory allocation is controlled by the TCF file.
- Output format: Legacy COFF
- Build
- C6000 Compiler
- Include Options: Add
${PROJECT_ROOT}/include
- Include Options: Add
- C6000 Compiler
- Build
- C6000 Compiler
- Optimization: off
- Debug Options: Full symbolic debug
-g
- Advanced Options
- Predefined Symbols:
--define=DEBUG
- 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.
- Use
CGT
v7.4.23 withDSP/BIOS
v5.42.02.10 DSP-HW.tcf
is provided to configure DSP/BIOS statically.
Code, build and hit debug!