gen_fsm file generator