Design automation of photonic resonator weights