qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Embedded system simulation


From: Bernhard Stegmaier
Subject: [Qemu-devel] Embedded system simulation
Date: Wed, 18 Mar 2009 20:35:49 +0100

Hi list,

for some private projects I tried out the feasability of simulating an ARM-based microcontroller including the on-chip peripherals using qemu. Works great, currently I have a basic simulation of the microcontrollers UART via qemu's console.

Before I dig deeper into the more complex stuff (e.g., interrupt controller), I want to check if it's possible to also simulate the real (non-pc) hardware peripherals of my board (doesn't make much sense without). The idea is that I create some external board-simulation-application talking to qemu, e.g., via a socket connection, and simulating behaviour of for example a spi device.

I think I have a somewhat clear picture on how to do this for synchronous communication (qemu peripheral simu writes a message to the socket, it's processed by the the board simu application, the response is sent back to the qemu simu, where some status registers, etc. of the peripheral can be set accordingly). However, I currently have no idea of how to handle asynchronous stuff initiated by the board simu application (think of simulating pressing a button connected to an IO pin - the microcontroller application might just do an empty loop waiting for an interrupt without reading any memory registers and thus there is no point to hook in something reading from the board simu). I can think of some ugly solutions like creating a polling timer to check if there is something from the board simu app, but I don't really like that. Ideally, I would like to implement some callback mechanism like it is done for getting input from the qemu-char stuff.

Can anybody give me some hints (or maybe even examples) on how to do this? I already searched the list and looked into the qemu sources of qemu- char, but I didn't find anything being useful for me at first glance (or, I just didn't understand). I found an older thread about a cosimulation setup similar to what I intend, but from the pieces posted there it's only using the synchronous stuff...


Thanks,
Bernhard





reply via email to

[Prev in Thread] Current Thread [Next in Thread]