AFSM-based deterministic hardware TPG