Hardware-Software Co-design of Resource-Efficient Deep Neural Networks