Algorithm-Hardware Co-Design of an Artificial Intelligence System for Diagnosis, Prediction, and Localization of Epileptic Seizures