From 4d49851396af4a50efa4dbd43cfccbc6167666e0 Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 29 Jun 2021 17:06:43 -0700 Subject: [PATCH] Commit prefixGDS.py utility script --- compiler/prefixGDS.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 compiler/prefixGDS.py diff --git a/compiler/prefixGDS.py b/compiler/prefixGDS.py new file mode 100644 index 00000000..942bb7a0 --- /dev/null +++ b/compiler/prefixGDS.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import sys +from gdsMill import gdsMill + +if len(sys.argv) < 3: + print("Script to prefix every instance and structure with the root cell name to provide unique namespace.") + print("Usage: {0} in.gds out.gds".format(sys.argv[0])) + sys.exit(1) + +gds_file = sys.argv[1] +gds = gdsMill.VlsiLayout() +reader = gdsMill.Gds2reader(gds) +reader.loadFromFile(gds_file) + +gds.uniquify() + +writer = gdsMill.Gds2writer(gds) +writer.writeToFile(sys.argv[2])