Model-Based Codesign of Critical Embedded Systems