@@ -185,11 +185,9 @@ def write_iverilog_includes_file(self):
185185 self .iverilog_dirs += f" -I { include_dir } "
186186
187187 def iverilog_compile (self ):
188+ if os .path .isfile (f"{ self .test .compilation_dir } /sim.vvp" ):
189+ os .remove (f"{ self .test .compilation_dir } /sim.vvp" )
188190 macros = " -D" + " -D" .join (self .test .macros )
189- # Remove all content in the directory
190- shutil .rmtree (self .test .compilation_dir )
191- # Recreate the directory
192- os .makedirs (self .test .compilation_dir )
193191 compile_command = (
194192 f"cd { self .test .compilation_dir } &&"
195193 f"iverilog -g2012 -Ttyp { macros } { self .iverilog_dirs } -o { self .test .compilation_dir } /sim.vvp"
@@ -287,10 +285,8 @@ def write_vcs_includes_file(self):
287285 self .test .set_user_project ()
288286
289287 def vcs_compile (self ):
290- # Remove all content in the directory
291- shutil .rmtree (self .test .compilation_dir )
292- # Recreate the directory
293- os .makedirs (self .test .compilation_dir )
288+ if os .path .isfile (f"{ self .test .compilation_dir } /simv" ):
289+ os .remove (f"{ self .test .compilation_dir } /simv" )
294290 macros = " +define+" + " +define+" .join (self .test .macros )
295291 vlogan_cmd = f"cd { self .test .compilation_dir } ; vlogan -full64 -sverilog +error+30 { self .paths .CARAVEL_VERILOG_PATH } /rtl/toplevel_cocotb.v { self .vcs_dirs } { macros } -l { self .test .compilation_dir } /analysis.log -o { self .test .compilation_dir } "
296292 self .run_command_write_to_file (
0 commit comments