Text this: A new framework for training a CNN with a hardware-software architecture