If not, some parts of the system have to be implemented in hardware. Maturity of the design. If a technique is not mature, it better to implement the technique in software because it easier to change than hardware. It is harder to build something for reusability than not. It is also harder to build equivalent functionality in hardware than software, enough harder that going the extra mile to make the hardware reusable in other contexts is worth serious consideration, even if a software solution would not be made reusable.
Hardware consumes more power than software.
If minimal power is required, software should be considered. There may be other factors which may be required by a client. The developers should consider all these factors in deciding what should be done in hardware and what in software. The software engineering approach of Structured Systems Analysis may be useful in this. Debugging is a process which involves locating and removing the errors.