A Quantitative Model for Hardware/Software Partitioning