Synthesizing device emulators