more post-processing of vst files
[soc-cocotb-sim.git] / ls180 / post_pnr / vst_correct.py
index d78d08d6ef73e19e1c86fb855487587c6cc601e7..0f454660241d8c40f376e191f7244af3b64c687c 100755 (executable)
@@ -37,6 +37,9 @@ for fname in os.listdir("vst_src"):
         txt = txt.replace("sys_rst : gpio",
                           "p_sys_rst: gpio")
 
+        # corona instance needs renaming too
+        txt = txt.replace("corona : corona", "instance_corona : corona")
+
         # temporary hack to rename niolib to avoid name-clashes
         for cell in ['gpio', 'vss', 'vdd', 'iovss', 'iovdd']:
             txt = txt.replace(": %s" % cell, ": cmpt_%s" % cell)
@@ -60,6 +63,12 @@ for fname in os.listdir("vst_src"):
             res.append(line)
         # re-join lines
         txt = '\n'.join(res)
+        # easier to just post-process-correct the iovdd std_logic
+        for port in ['vss', 'vdd', 'iovss', 'iovdd']:
+            txt = txt.replace("%-9s: inout std_logic" % port,
+                              "%-9s: in bit" % port)
+
+        
     # write the file
     with open(fname, "w") as f:
         f.write(txt)