Formal codesign methodology with multistep partitioning