fix to nmutil workaround for detecting new Simulator API
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 8 Dec 2021 12:48:11 +0000 (12:48 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 8 Dec 2021 12:48:11 +0000 (12:48 +0000)
the engine argument if already provided, just use that

src/nmutil/sim_tmp_alternative.py

index 2b2e3a2af2139c78b07c32ade0e1ea502516498e..a90b6e78c5139153b7ab9e01ff1e56c25fcae2d4 100644 (file)
@@ -47,7 +47,7 @@ nmigen_sim_environ_variable = os.environ.get("NMIGEN_SIM_MODE") \
 
 def Simulator(*args, **kwargs):
     """Wrapper that allows run-time selection of simulator engine"""
-    if detected_new_api:
+    if detected_new_api and 'engine' not in kwargs:
         kwargs['engine'] = nmigen_sim_environ_variable
     return RealSimulator(*args, **kwargs)