Curbing the roofline: A scalable and flexible architecture for CNNs on FPGA