Control and real-time scheduling co-design