Applying HLS to FPGA Data Preprocessing in the Advanced Particle-astrophysics Telescope