From: Luke Kenneth Casson Leighton Date: Thu, 1 Apr 2021 13:40:06 +0000 (+0100) Subject: add vst corrections program X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4b8e0c1c06508dac95ec48eacc1a87e7ecf3c085;p=soc-cocotb-sim.git add vst corrections program --- diff --git a/ls180/vst_correct.py b/ls180/vst_correct.py new file mode 100644 index 0000000..68bd2a0 --- /dev/null +++ b/ls180/vst_correct.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +"""makes corrections to vst source from coriolis2 P&R +""" + +import os +import sys + +# run through all files +for fname in os.listdir("vst_src"): + if not fname.endswith(".vst"): + continue + print (fname) + # read the file + fname = "vst_src/"+fname + with open(fname) as f: + txt = f.read() + # replace vss / vdd : linkage bit with vss/vdd in bit + txt = txt.replace("linkage bit", "in bit") + # and double-underscores + txt = txt.replace("__", "_") + # write the file + with open(fname, "w") as f: + f.write(txt)