Skip to content

Commit

Permalink
Fixed race condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsAsplund committed Sep 15, 2024
1 parent a234aa7 commit 3a976cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vunit/sim_if/modelsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ def _optimize(self, config, script_path):
# non-alphanumeric characters is a simple solution to that
simulation_target = "opt_" + "".join(ch for ch in design_to_optimize if ch.isalnum())

with self._vopt_lock:
self._optimized_designs[design_to_optimize]["simulation_target"] = simulation_target

optimize_file_name = script_path / "optimize.do"
write_file(
str(optimize_file_name), self._create_optimize_script(design_to_optimize, simulation_target, config)
Expand Down Expand Up @@ -417,6 +414,9 @@ def _optimize(self, config, script_path):
LOGGER.debug("Failed to optimize %s.", design_to_optimize)
return False

with self._vopt_lock:
self._optimized_designs[design_to_optimize]["simulation_target"] = simulation_target

LOGGER.debug("%s optimization completed.", design_to_optimize)
self._optimized_designs[design_to_optimize]["vopt_event"].set()

Expand Down

0 comments on commit 3a976cd

Please sign in to comment.