A Code Generation Framework for Distributed Real-Time Embedded Systems