Architecture Synthesis for Safety-critical Systems