TOFFEE: a fully custom amplifier-comparator chip for silicon detectors with internal gain