Cross-Layer System Design For Autonomous Driving