# set device to simulation mode devs = proj.find('testdev') if len(devs) > 0: devs[0].set_simulation_mode(True)
alternatively check the sim is enabled beforehand and turn it on if not yet enabled
devs = proj.find('testdev') if len(devs) > 0: # check if sim is enabled cur_sim_mode = devs[0].get_simulation_mode() print(cur_sim_mode) # enable sim conditionally if not cur_sim_mode: devs[0].set_simulation_mode(True)
Log in to post a comment.
alternatively check the sim is enabled beforehand and turn it on if not yet enabled