Hi tock-dev,
I've been working on adding register-based emulation of MMIO devices
to enable unit testing of drivers, and
would like to solicit feedback on the general design before dropping a
PR that might end up disrupting the
tock-registers crate and its users :)
The proposed implementation would avoid changing the tock-registers
interface for existing code, but would
allow a cargo feature to control the optional emulation feature. This
ensures no disruption for existing code in
drivers since the interface is identical, although Makefiles would
presumably need to be aware of toggling
the cargo feature during testing.
The more detailed design doc (with some alternative designs and
examples!) is available at
https://github.com/smibarber/tock/blob/mmio-emulation/doc/MMIO_Emulation.md
and proof-of-concept implementation at
https://github.com/smibarber/tock/blob/mmio-emulation/libraries/tock-register-interface/src/mmio_emu.rs
Thanks,
Steve