diff --git a/r2plugin/TESTING.md b/r2plugin/TESTING.md new file mode 100644 index 0000000..7de4fe4 --- /dev/null +++ b/r2plugin/TESTING.md @@ -0,0 +1,65 @@ +# Decoder Test Coverage + +Verified = disassembly checked against open21xx assembler output. +Structural = implemented from reference docs, no assembler test. + +| Type | Description | Status | Test file | +|------|--------------------------------|------------|------------------------| +| 1 | Compute + DM + PM | Verified | fir.bin, iir.bin | +| 3 | Direct memory read/write | Verified | fir.bin (DM writes) | +| 4 | Compute + DM/PM postmodify | Verified | fir.bin, iir.bin | +| 6 | Dreg = Imm16 | Verified | isa_test.bin | +| 7 | Reg1/Reg2 = Imm16 | Verified | isa_test.bin | +| 8 | Compute + Dreg move | Verified | type8_test.dsp | +| 9 | Conditional compute | Verified | type9_test.dsp | +| 9a | Unconditional register compute | Verified | type9_test.dsp | +| 10 | Conditional jump (13-bit rel) | Verified | isa_test.bin | +| 10a | Unconditional jump (16-bit) | Verified | isa_test.bin | +| 11 | DO UNTIL (12-bit rel) | Verified | isa_test.bin, fir.bin | +| 12 | Shift + DM/PM | Structural | — | +| 14 | Shift + Dreg move | Structural | — | +| 15 | Shift immediate | Verified | isa_test.bin | +| 16 | Conditional shift | Structural | — | +| 17 | Reg = Reg | Verified | isa_test.bin | +| 18 | Mode control (ENA/DIS) | Verified | type18_test.dsp | +| 19 | Indirect jump/call | Structural | — | +| 20 | RTS/RTI | Verified | isa_test.bin, fir.bin | +| 21 | MODIFY (Ireg += Mreg) | Structural | — | +| 21a | MODIFY (Ireg += Imm8) | Structural | — | +| 22 | DM = Data16 (2-word) | Structural | — | +| 22a | PM = Data24 (2-word) | Structural | — | +| 23 | DIVQ | Structural | — | +| 24 | DIVS | Structural | — | +| 25 | SAT MR/SR | Verified | isa_test.bin | +| 26 | Push/Pop/Flush Cache | Structural | — | +| 29 | DM read/write imm modify | Structural | — | +| 30 | NOP | Verified | isa_test.bin | +| 31 | IDLE | Structural | — | +| 32 | Any Reg <-> DM/PM (DAG) | Structural | — | +| 32a | DAG reg store + transfer | Structural | — | +| 33 | Reg3 = Data12 | Verified | isa_test.bin | +| 34 | IO register read/write | Structural | — | +| 35 | System register read/write | Structural | — | +| 36 | Long jump/call (2-word) | Structural | — | +| 37 | SETINT/CLRINT | Structural | — | + +## Priority gaps for assembler verification + +High (used in real firmware, likely to encounter): +- Type 12: Shift + memory (common in FIR output scaling) +- Type 29: DM immediate modify (common for stack-like access) +- Type 32: Any Reg <-> DM/PM (general register save/restore) +- Type 19: Indirect jump (function pointer dispatch) + +Medium (less common but structurally complex): +- Type 22/22a: 2-word immediate write (initialization code) +- Type 36: Long jump/call (large firmware images) +- Type 32a: DAG store + transfer (DSP loop setup) + +Low (rare or simple): +- Type 16: Conditional shift +- Type 21/21a: MODIFY +- Type 23/24: DIVQ/DIVS +- Type 26: Push/Pop +- Type 34/35: IO/System registers +- Type 37: SETINT/CLRINT diff --git a/r2plugin/asm_adsp219x.c b/r2plugin/asm_adsp219x.c index e076daf..b8056d5 100644 --- a/r2plugin/asm_adsp219x.c +++ b/r2plugin/asm_adsp219x.c @@ -1,7 +1,12 @@ -/* asm_adsp219x.c -- Full Radare2 arch plugin for Analog Devices ADSP-219x +/* asm_adsp219x.c -- Radare2 arch plugin for Analog Devices ADSP-219x Copyright (C) 2026 Dr. Christian Giessen - This file implements the complete ADSP-219x Instruction Set (Types 1-37). */ + Decodes most of the ADSP-219x instruction set (Types 1-37). + Verified against open21xx assembler output for Types 1, 3, 4, + 6, 7, 8, 9, 9a, 10, 10a, 11, 15, 17, 18, 20, 25, 33. + Structurally implemented but not yet assembler-verified: + Types 12, 14, 16, 19, 21, 21a, 22, 22a, 23, 24, 26, 29, + 30, 31, 32, 32a, 34, 35, 36, 37. */ #include