A framework for Hardware-Software Co-Design of Embedded Systems