update README
[soc-cocotb-sim.git] / ls180 / vst_correct.py
1 #!/usr/bin/env python3
2
3 """makes corrections to vst source from coriolis2 P&R
4 """
5
6 import os
7 import sys
8
9 # run through all files
10 for fname in os.listdir("vst_src"):
11 if not fname.endswith(".vst"):
12 continue
13 print (fname)
14 # read the file
15 fname = "vst_src/"+fname
16 with open(fname) as f:
17 txt = f.read()
18 # replace vss / vdd : linkage bit with vss/vdd in bit
19 txt = txt.replace("linkage bit", "in bit")
20 # and double-underscores
21 txt = txt.replace("__", "_")
22 # write the file
23 with open(fname, "w") as f:
24 f.write(txt)