Skip to content

Commit

Permalink
Remove verilog file if exists before generate it
Browse files Browse the repository at this point in the history
  • Loading branch information
Martoni committed Mar 7, 2024
1 parent a4415ab commit 0661927
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/scala/gcd/GCD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ object GCD extends App {
new GCD(),
firtoolOpts = Array("-disable-all-randomization",
"-strip-debug-info"))
os.write(os.pwd / "GCD.v", verilog_src)
val fverilog = os.pwd / "GCD.v"
if(os.exists(fverilog))
os.remove(fverilog)
os.write(fverilog, verilog_src)
}

0 comments on commit 0661927

Please sign in to comment.