Architecture Synthesis for Safety-Critical Systems