capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.62k stars 1.56k forks source link

Support for TMS320x28x ? #1824

Open erosenst opened 2 years ago

erosenst commented 2 years ago

Hello is it possible to add support for TMS320C28x series chips? Like TMS320F28062 & TMS320F2809 ?

They are common in PIP solar off / on-grid inverters and factory firmware have issues.

You can find test firmware and talk: https://forums.aeva.asn.au/viewtopic.php?f=64&t=4332

I looked little and find TMS320 directory is missing from: suite/synctools/tablegen/ However there is in arch/TMS320C64x/TMS320C64xGenAsmWriter.inc / Automatically generated file, do not edit! / TMS320C64x Backend by Fotis Loukos me@fotisl.com 2016 */

Missing files may help to port for C28x and maybe Mr. Loukos can push them here?

Thank you (I drop same in radare2 issues)

fotisl commented 2 years ago

Hello Eerin, I would like to clarify that at least according to TI, both of the chips that you mention at 32 bit MCUs while the TMS320C64x chips are 64 bit DSPs. As far as I understand, the instruction set is different and needs a completely separate implementation. Think of it as x86 vs amd64, but way more different than this.

erosenst commented 2 years ago

Are there any information how tablegen *.td files should construct? It seems quite hard to learn from ARM/X86 sources how write files correctly to C28x 32-bit mcu.. Any help material?

C28x MCU OPcodes are there, chapter 6: https://www.ti.com.cn/cn/lit/ug/spru430f/spru430f.pdf?ts=1642556398404