rizinorg / ideas

Features that would be nice to have but they are not in the roadmap
3 stars 0 forks source link

Infineon C166 architecture support #53

Open XVilka opened 1 year ago

XVilka commented 1 year ago

C166 was quite a popular embedded architecture for some time, there are many devices and corresponding firmwares out there.

The C166 family is a 16-bit microcontroller architecture from Infineon(formerly the semiconductor division of Siemens) in cooperation with STMicroelectronics. It was first released in 1990 and is a controller for measurement and control tasks. It uses the well-established RISC architecture, but features some microcontroller-specific extensions such as bit-addressable memory and an interrupt system optimized for low-latency. When this architecture was introduced the main focus was to replace 8051 controllers.

Opcode-compatible successors of the C166 family are the C167 family, XC167 family, the XE2000 family and the XE166 family.

As of 2017, microcontrollers using the C166 architecture are still being manufactured by NIIET in Voronezh, Russia, as part of the 1887 series of integrated circuits. This includes a radiation-hardened device under the designation 1887VE6T.

Instruction Set: c166sv2_ao_0103.pdf

frmdstryr commented 1 year ago

Thanks! I have branch here https://github.com/frmdstryr/rizin/tree/c166-dev but it is not ready to merge...

It still has some invalid asm, for some reason it does not seem to find all the functions (some calls jump to an addr that looks like a fn but none is defined there), and the extended modes do not work correctly in cutter or the terminal ui.

I don't really have any good way to verify the disassembly. If anyone has access to another tool with c166 support that can compare the output it would be helpful.

Should be another issue but it'd also be nice if cutter/rizin could map tables/variables from an A2L file.

XVilka commented 5 months ago

@frmdstryr hi, have you had any progress with this? Please note, that we recently merged RzAsm and RzAnalysis in preparation to packing both disassembly and analysis plugins into one RzArch for every architecture, see https://github.com/rizinorg/rizin/issues/4334

cc @wargio

frmdstryr commented 5 months ago

Unfortunately I lost interest and didn't work on it any more, everything is in the branch above.