This paper proposes a method of model-driven HW/SW co-design in embedded system design and discusses the key technology of model mapping, automatic generating codes and performance optimization. Using the developed iCDMdt platform, a series of design tasks can be integrative fulfilled, such as modeling, mapping from DCDM to systecC model, generating executable systemC codes and co-verifying rent abstract levels. After performance optimizing, the virtual prototype that offers for lowlevel chops design is gained. This can shorten the design time of product. Finally, an instance of application is introduced.