A CNN-based chip for robot locomotion control