This course covers the most advanced aspects of the design of an embedded system, including the crucial issue of early defining the high-level system architecture, which entails the partitioning of the required functionalities among hardware and software modules. HW-SW co-design techniques will be introduced, addressing different kinds of design parameters, such as performance, throughput, resources and power consumption. The focus will the shift to different optimization techniques applicable at the system level and targeting specifically the various components of an embedded platform, i.e., the (network of) processing elements, the HW accelerators, the memory subsystem, the communication subsystem and the battery subsystem (in case of devices oriented to mobile applications). Finally, the most up-to-date approaches to run-time resource management will be briefly considered. The analysis of real-life examples and lab exercises will offer the attendees of this course the right mix of theory and practice.