From 4b8e0c1c06508dac95ec48eacc1a87e7ecf3c085 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 1 Apr 2021 14:40:06 +0100 Subject: [PATCH] add vst corrections program --- ls180/vst_correct.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ls180/vst_correct.py 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) -- 2.30.2