2013年4月7日日曜日

How to hook the memory access in TLMu

In my fork of TLMu, SystemC world is mapped as a tlmu_ramd in QEMU. tlmu_ramd is similar to romd in QEMU, but accepts both read and write requets. romd is a kind of device in QEMU to model Flash memory devices. Flash memory devices require special sequece to erase and write, and romd provides memory access functions to model such operations. Without such functions, QEMU accesses memory regions with direct a memory pointer.

TLM2.0 provides direct memory interface (DMI) but special sequeice is necessary to get memory pointers.  So romd is good abstraction scheme for TLMu, but it allows only write hooks. So I add tlmu_ramd which provides both read and write hook functions.

Detailed modifications can be seen at the commit.
QEMU and TLM2.0 provides debug memory access method. To meet them I make memory access function pointer as array in tlm_mem.c:320.  Operations are switched at line 1884 and 1953 of exec.c.

0 件のコメント:

コメントを投稿