The sim_stop argument is an enum and should only be one of those values, not a signal constant. Fix the logic to pass the right sim_xxx & SIM_xxx values in the right arguments.