The design and organization of complex robotic systems traditionally requires laborious trial-and-error processes to ensure both hardware and software components are correctly connected with the resources necessary for computation. This paper presents a novel generalization of the quadratic assignment and routing problem, introducing formalisms for selecting components and interconnections to synthesize a complete system capable of providing some user-defined functionality. By introducing mission context, functional requirements, and modularity directly into the assignment problem, we derive a solution where components are automatically selected and placed into an optimal organization of hardware and software, all while respecting restrictions on component viability and required functionality. The ability to generate complete functional systems directly from individual components reduces manual design effort by allowing for a guided exploration of the design space. Additionally, our formulation increases resiliency by quantifying resource margins and enabling adaptation of system structure in response to changing environments, hardware or software failure. The proposed formulation is cast as an integer linear program which is provably \({\mathcal {N}}{\mathcal {P}}\)-hard. Two case studies are analyzed to highlight the expressiveness and complexity of problems that are addressable by this approach: the first explores the iterative development of a ground-based search-and-rescue robot in varying mission contexts, while the second compares an automated humanoid design against a manual design that was finalist in the DARPA Robotics Challenge. Numerical simulations quantify real-world performance and demonstrate tractable time complexity for the scale of problems encountered in many modern robotic systems.