From a68144cd7b92112cd05869a23fb6f860b4c02d5e Mon Sep 17 00:00:00 2001 From: mole99 Date: Wed, 10 Jul 2024 14:43:38 +0200 Subject: [PATCH] Remove pandas dependency --- sky130_tech/tech/sky130/lvs/sky130.lylvs | 30 ++-- .../sky130/pymacros/sky130_pcells/PcGRing.py | 3 +- .../pymacros/sky130_pcells/PcNmos5d10.py | 3 +- .../pymacros/sky130_pcells/PcViaStack.py | 3 +- .../sky130/pymacros/sky130_pcells/__init__.py | 6 +- .../pymacros/sky130_pcells/diff_octagon.py | 1 - .../sky130_pcells/diff_square_inductor.py | 1 - .../layers_definiations.py | 100 ++++++++----- .../sky130/pymacros/sky130_pcells/inductor.py | 1 - .../sky130_pcells/layers_definiations.py | 140 ++++++++---------- .../sky130_pcells/new_single_octagon_ind.py | 1 - .../sky130/pymacros/sky130_pcells/polyres.py | 4 +- .../sky130_pcells/rectangular_shielding.py | 1 - .../sky130_pcells/single_octagon_ind.py | 1 - .../sky130_pcells/triangular_shielding.py | 1 - sky130_tech/tech/sky130/sky130.lyt | 6 +- 16 files changed, 142 insertions(+), 160 deletions(-) diff --git a/sky130_tech/tech/sky130/lvs/sky130.lylvs b/sky130_tech/tech/sky130/lvs/sky130.lylvs index 6e8a6d4b..71fb7a31 100644 --- a/sky130_tech/tech/sky130/lvs/sky130.lylvs +++ b/sky130_tech/tech/sky130/lvs/sky130.lylvs @@ -15,21 +15,19 @@ dsl lvs-dsl-xml -# Copyright 2022 Mabrains -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -# %include sky130.lvs + # Copyright 2022 Efabless Corporation + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # %include sky130.lvs diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcGRing.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcGRing.py index a486c534..f2815f34 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcGRing.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcGRing.py @@ -4,7 +4,6 @@ from sky130_pcells.imported_generators.layers_definiations import * import pya import math -import pandas as pd class pcGRingGenerator(pya.PCellDeclarationHelper): @@ -370,4 +369,4 @@ def rectRowCenterToCenter(self, l_rect, pathLen, min_rect_spc, rect_size, grid, def produce_impl(self): # call GRing sub fucntion (_GRing) - self._GRing(self.layout,self.cell,self.well,self.hvnwell,self.nwell_hole,self.w,self.l,self.h,self.LmCON,self.RmCON,self.BmCON,self.TmCON,self.covmCON) \ No newline at end of file + self._GRing(self.layout,self.cell,self.well,self.hvnwell,self.nwell_hole,self.w,self.l,self.h,self.LmCON,self.RmCON,self.BmCON,self.TmCON,self.covmCON) diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcNmos5d10.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcNmos5d10.py index bc267ac0..4baf84f3 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcNmos5d10.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcNmos5d10.py @@ -8,7 +8,6 @@ import pya import math -import pandas as pd class pcNmos5d10Generator(pya.PCellDeclarationHelper): @@ -402,4 +401,4 @@ def _Nmos5d10(self, w, l, sab, gate_contact, gate_contact_num, finger_num, grCov def produce_impl(self): # call sub fucntion (__pcNmos5d10) - nmos5d10 = self._Nmos5d10(self.w, self.l, self.sab, self.gate_contact,self.gate_contact_num, self.finger_num,self.grCovmCON,self.sdCovmCON) \ No newline at end of file + nmos5d10 = self._Nmos5d10(self.w, self.l, self.sab, self.gate_contact,self.gate_contact_num, self.finger_num,self.grCovmCON,self.sdCovmCON) diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcViaStack.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcViaStack.py index 1fcd10cc..b695e0f6 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcViaStack.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/PcViaStack.py @@ -20,7 +20,6 @@ from sky130_pcells.imported_generators.layers_definiations import * import pya import math -import pandas as pd """ @@ -363,4 +362,4 @@ def _PcViaStack(self,layout, cell, width,length,starting_metal,ending_metal,shap def produce_impl(self): # generate the layout of pcViaStack subpcell (_PcViaStack) - self._PcViaStack(self.layout, self.cell,self.width,self.length,self.starting_metal,self.ending_metal,shapetrans = pya.DPoint()) \ No newline at end of file + self._PcViaStack(self.layout, self.cell,self.width,self.length,self.starting_metal,self.ending_metal,shapetrans = pya.DPoint()) diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/__init__.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/__init__.py index 4df9c8a0..1c748665 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/__init__.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/__init__.py @@ -40,8 +40,8 @@ from sky130_pcells.PcnvtNmos33 import pcnvtNmos33Generator from sky130_pcells.PcnvtNmos5 import pcnvtNmos5Generator from sky130_pcells.PcNmos5d10 import pcNmos5d10Generator -from sky130_pcells.nmos18 import NMOS18 -from sky130_pcells.pmos18 import PMOS18 +#from sky130_pcells.nmos18 import NMOS18 +#from sky130_pcells.pmos18 import PMOS18 from sky130_pcells.polyres import PolyRes_gen from sky130_pcells.inductor import IndGenerator from sky130_pcells.rectangular_shielding import rectangular_shielding_Generator @@ -50,7 +50,7 @@ from sky130_pcells.single_octagon_ind import single_octagon_ind_Generator from sky130_pcells.new_single_octagon_ind import new_single_octagon_Generator from sky130_pcells.diff_octagon import diff_octagon_ind_Generator -from sky130_pcells.nmos5d10 import nmos5d10_gen +#from sky130_pcells.nmos5d10 import nmos5d10_gen from sky130_pcells.pmos5d10 import pmos5d10_gen from sky130_pcells.mimcap_1 import mimcap_1_gen from sky130_pcells.mimcap_2 import mimcap_2_gen diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_octagon.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_octagon.py index 2c9ee70b..598ebaeb 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_octagon.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_octagon.py @@ -20,7 +20,6 @@ from .layers_definiations import * import pya import math -import pandas as pd """ diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_square_inductor.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_square_inductor.py index ae822016..2c50e06f 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_square_inductor.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/diff_square_inductor.py @@ -20,7 +20,6 @@ from .layers_definiations import * import pya import math -import pandas as pd """ diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/imported_generators/layers_definiations.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/imported_generators/layers_definiations.py index 2c3862c0..2e033dd0 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/imported_generators/layers_definiations.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/imported_generators/layers_definiations.py @@ -20,54 +20,72 @@ ## ######################################################################################################################## -import pandas as pd import pya +import csv import os # print(os.system('pwd')) lay_csv_map = os.path.join(os.path.dirname(os.path.realpath(__file__)),"gds_layers.csv") -lay_df = pd.read_csv(lay_csv_map) +#lay_df = pd.read_csv(lay_csv_map) + + +layers = [] +with open(lay_csv_map, newline='') as csvfile: + reader = csv.reader(csvfile, delimiter=',', quotechar='"') + header = next(reader) + + for row in reader: + new_row = {} + for index, entry in enumerate(row): + new_row[header[index]] = row[index] + layers.append(new_row) + +def get_layer_id(layer_name, purpose_contains): + for layer in layers: + if layer["Layer name"] == layer_name and purpose_contains in layer["Purpose"]: + return layer["GDS layer:datatype"] + return None # print(lay_df) -nsdm_lay_str = lay_df.loc[(lay_df["Layer name"] == "nsdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -psdm_lay_str = lay_df.loc[(lay_df["Layer name"] == "psdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -diff_lay_str = lay_df.loc[(lay_df["Layer name"] == "diff") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -poly_lay_str = lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -licon_lay_str = lay_df.loc[(lay_df["Layer name"] == "licon1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -npc_lay_str = lay_df.loc[(lay_df["Layer name"] == "npc") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -li_lay_str = lay_df.loc[(lay_df["Layer name"] == "li1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -mcon_lay_str = lay_df.loc[(lay_df["Layer name"] == "mcon") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -met1_lay_str = lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -tap_lay_str = lay_df.loc[(lay_df["Layer name"] == "tap") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -nwell_lay_str = lay_df.loc[(lay_df["Layer name"] == "nwell") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -dnwell_lay_str = lay_df.loc[(lay_df["Layer name"] == "dnwell") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -via_lay_str = lay_df.loc[(lay_df["Layer name"] == "via") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -met2_lay_str = lay_df.loc[(lay_df["Layer name"] == "met2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -met3_lay_str = lay_df.loc[(lay_df["Layer name"] == "met3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -met4_lay_str = lay_df.loc[(lay_df["Layer name"] == "met4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -met5_lay_str = lay_df.loc[(lay_df["Layer name"] == "met5") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -via2_lay_str = lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -via3_lay_str = lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -via2_lay_str = lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -via3_lay_str = lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -via4_lay_str = lay_df.loc[(lay_df["Layer name"] == "via4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -urpm_lay_str = lay_df.loc[(lay_df["Layer name"] == "urpm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -poly_res_lay_str = lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("resistor")), "GDS layer:datatype"].values[0] -prbndry_lay_str = lay_df.loc[(lay_df["Layer name"] == "prBndry") & (lay_df["Purpose"].str.contains("boundary")), "GDS layer:datatype"].values[0] -poly_label_lay_str = lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] -met1_label_lay_str = lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] -me1_pin_lay_str = lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("pin")), "GDS layer:datatype"].values[0] -met2_label_lay_str = lay_df.loc[(lay_df["Layer name"] == "met2") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] -met4_label_lay_str = lay_df.loc[(lay_df["Layer name"] == "met4") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] -met5_label_lay_str = lay_df.loc[(lay_df["Layer name"] == "met5") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] -l_capm_lay_str = lay_df.loc[(lay_df["Layer name"] == "capm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -l_cap2m_lay_str = lay_df.loc[(lay_df["Layer name"] == "cap2m") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -l_hvntm_lay_str = lay_df.loc[(lay_df["Layer name"] == "hvntm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -l_hvi_lay_str = lay_df.loc[(lay_df["Layer name"] == "hvi") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -l_lvtn_lay_str = lay_df.loc[(lay_df["Layer name"] == "lvtn") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -l_hvtp_lay_str = lay_df.loc[(lay_df["Layer name"] == "hvtp") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -l_areaid_lvt_lay_str = lay_df.loc[(lay_df["Layer name"] == "areaid.lvt") & (lay_df["Purpose"].str.contains("dentifier")), "GDS layer:datatype"].values[0] -l_areaid_le_lay_str = lay_df.loc[(lay_df["Layer name"] == "areaid.le") & (lay_df["Purpose"].str.contains("dentifier")), "GDS layer:datatype"].values[0] +nsdm_lay_str = get_layer_id("nsdm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "nsdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +psdm_lay_str = get_layer_id("psdm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "psdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +diff_lay_str = get_layer_id("diff", "drawing") #lay_df.loc[(lay_df["Layer name"] == "diff") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +poly_lay_str = get_layer_id("poly", "drawing") #lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +licon_lay_str = get_layer_id("licon1", "drawing") #lay_df.loc[(lay_df["Layer name"] == "licon1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +npc_lay_str = get_layer_id("npc", "drawing") #lay_df.loc[(lay_df["Layer name"] == "npc") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +li_lay_str = get_layer_id("li1", "drawing") #lay_df.loc[(lay_df["Layer name"] == "li1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +mcon_lay_str = get_layer_id("mcon", "drawing") #lay_df.loc[(lay_df["Layer name"] == "mcon") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met1_lay_str = get_layer_id("met1", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +tap_lay_str = get_layer_id("tap", "drawing") #lay_df.loc[(lay_df["Layer name"] == "tap") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +nwell_lay_str = get_layer_id("nwell", "drawing") #lay_df.loc[(lay_df["Layer name"] == "nwell") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +dnwell_lay_str = get_layer_id("dnwell", "drawing") #lay_df.loc[(lay_df["Layer name"] == "dnwell") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via_lay_str = get_layer_id("via", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met2_lay_str = get_layer_id("met2", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met3_lay_str = get_layer_id("met3", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met4_lay_str = get_layer_id("met4", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met5_lay_str = get_layer_id("met5", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met5") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via2_lay_str = get_layer_id("via2", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via3_lay_str = get_layer_id("via3", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via2_lay_str = get_layer_id("via2", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via3_lay_str = get_layer_id("via3", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via4_lay_str = get_layer_id("via4", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +urpm_lay_str = get_layer_id("urpm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "urpm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +poly_res_lay_str = get_layer_id("poly", "resistor") #lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("resistor")), "GDS layer:datatype"].values[0] +prbndry_lay_str = get_layer_id("prBndry", "boundary") #lay_df.loc[(lay_df["Layer name"] == "prBndry") & (lay_df["Purpose"].str.contains("boundary")), "GDS layer:datatype"].values[0] +poly_label_lay_str = get_layer_id("poly", "label") #lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +met1_label_lay_str = get_layer_id("met1", "label") #lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +me1_pin_lay_str = get_layer_id("met1", "pin") #lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("pin")), "GDS layer:datatype"].values[0] +met2_label_lay_str = get_layer_id("met2", "label") #lay_df.loc[(lay_df["Layer name"] == "met2") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +met4_label_lay_str = get_layer_id("met4", "label") #lay_df.loc[(lay_df["Layer name"] == "met4") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +met5_label_lay_str = get_layer_id("met5", "label") #lay_df.loc[(lay_df["Layer name"] == "met5") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +l_capm_lay_str = get_layer_id("capm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "capm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_cap2m_lay_str = get_layer_id("cap2m", "drawing") #lay_df.loc[(lay_df["Layer name"] == "cap2m") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_hvntm_lay_str = get_layer_id("hvntm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "hvntm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_hvi_lay_str = get_layer_id("hvi", "drawing") #lay_df.loc[(lay_df["Layer name"] == "hvi") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_lvtn_lay_str = get_layer_id("lvtn", "drawing") #lay_df.loc[(lay_df["Layer name"] == "lvtn") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_hvtp_lay_str = get_layer_id("hvtp", "drawing") #lay_df.loc[(lay_df["Layer name"] == "hvtp") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_areaid_lvt_lay_str = get_layer_id("areaid.lvt", "dentifier") #lay_df.loc[(lay_df["Layer name"] == "areaid.lvt") & (lay_df["Purpose"].str.contains("dentifier")), "GDS layer:datatype"].values[0] +l_areaid_le_lay_str = get_layer_id("areaid.le", "dentifier") #lay_df.loc[(lay_df["Layer name"] == "areaid.le") & (lay_df["Purpose"].str.contains("dentifier")), "GDS layer:datatype"].values[0] ## Extract Layer GDS Num & Purpose diff_lay_num = int(diff_lay_str.split(":")[0]) diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/inductor.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/inductor.py index d8dc570c..2e3a0b81 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/inductor.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/inductor.py @@ -20,7 +20,6 @@ from .layers_definiations import * import pya import math -import pandas as pd """ diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/layers_definiations.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/layers_definiations.py index a2fde6c5..998b4fb0 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/layers_definiations.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/layers_definiations.py @@ -15,95 +15,71 @@ ## ######################################################################################################################## -import pandas as pd import pya +import csv import os #print(os.system('pwd')) lay_csv_map = os.path.join(os.path.dirname(os.path.realpath(__file__)), "gds_layers.csv") -lay_df = pd.read_csv(lay_csv_map) +#lay_df = pd.read_csv(lay_csv_map) + +layers = [] +with open(lay_csv_map, newline='') as csvfile: + reader = csv.reader(csvfile, delimiter=',', quotechar='"') + header = next(reader) + + for row in reader: + new_row = {} + for index, entry in enumerate(row): + new_row[header[index]] = row[index] + layers.append(new_row) + +def get_layer_id(layer_name, purpose_contains): + for layer in layers: + if layer["Layer name"] == layer_name and purpose_contains in layer["Purpose"]: + return layer["GDS layer:datatype"] + return None # print(lay_df) -nsdm_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "nsdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -psdm_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "psdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -diff_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "diff") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -poly_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -licon_lay_str = lay_df.loc[ - (lay_df["Layer name"] == "licon1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] -npc_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "npc") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -li_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "li1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -mcon_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "mcon") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -met1_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -tap_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "tap") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -nwell_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "nwell") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -via_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "via") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -met2_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "met2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -met3_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "met3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -met4_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "met4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -met5_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "met5") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -via2_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -via3_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -via2_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -via3_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] - -via4_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "via4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -urpm_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "urpm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[ - 0] -poly_res_lay_str = \ -lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("resistor")), "GDS layer:datatype"].values[ - 0] +nsdm_lay_str = get_layer_id("nsdm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "nsdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +psdm_lay_str = get_layer_id("psdm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "psdm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +diff_lay_str = get_layer_id("diff", "drawing") #lay_df.loc[(lay_df["Layer name"] == "diff") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +poly_lay_str = get_layer_id("poly", "drawing") #lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +licon_lay_str = get_layer_id("licon1", "drawing") #lay_df.loc[(lay_df["Layer name"] == "licon1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +npc_lay_str = get_layer_id("npc", "drawing") #lay_df.loc[(lay_df["Layer name"] == "npc") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +li_lay_str = get_layer_id("li1", "drawing") #lay_df.loc[(lay_df["Layer name"] == "li1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +mcon_lay_str = get_layer_id("mcon", "drawing") #lay_df.loc[(lay_df["Layer name"] == "mcon") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met1_lay_str = get_layer_id("met1", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +tap_lay_str = get_layer_id("tap", "drawing") #lay_df.loc[(lay_df["Layer name"] == "tap") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +nwell_lay_str = get_layer_id("nwell", "drawing") #lay_df.loc[(lay_df["Layer name"] == "nwell") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +dnwell_lay_str = get_layer_id("dnwell", "drawing") #lay_df.loc[(lay_df["Layer name"] == "dnwell") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via_lay_str = get_layer_id("via", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met2_lay_str = get_layer_id("met2", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met3_lay_str = get_layer_id("met3", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met4_lay_str = get_layer_id("met4", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +met5_lay_str = get_layer_id("met5", "drawing") #lay_df.loc[(lay_df["Layer name"] == "met5") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via2_lay_str = get_layer_id("via2", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via3_lay_str = get_layer_id("via3", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via2_lay_str = get_layer_id("via2", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via2") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via3_lay_str = get_layer_id("via3", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via3") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +via4_lay_str = get_layer_id("via4", "drawing") #lay_df.loc[(lay_df["Layer name"] == "via4") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +urpm_lay_str = get_layer_id("urpm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "urpm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +poly_res_lay_str = get_layer_id("poly", "resistor") #lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("resistor")), "GDS layer:datatype"].values[0] +prbndry_lay_str = get_layer_id("prBndry", "boundary") #lay_df.loc[(lay_df["Layer name"] == "prBndry") & (lay_df["Purpose"].str.contains("boundary")), "GDS layer:datatype"].values[0] +poly_label_lay_str = get_layer_id("poly", "label") #lay_df.loc[(lay_df["Layer name"] == "poly") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +met1_label_lay_str = get_layer_id("met1", "label") #lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +me1_pin_lay_str = get_layer_id("met1", "pin") #lay_df.loc[(lay_df["Layer name"] == "met1") & (lay_df["Purpose"].str.contains("pin")), "GDS layer:datatype"].values[0] +met2_label_lay_str = get_layer_id("met2", "label") #lay_df.loc[(lay_df["Layer name"] == "met2") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +met4_label_lay_str = get_layer_id("met4", "label") #lay_df.loc[(lay_df["Layer name"] == "met4") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +met5_label_lay_str = get_layer_id("met5", "label") #lay_df.loc[(lay_df["Layer name"] == "met5") & (lay_df["Purpose"].str.contains("label")), "GDS layer:datatype"].values[0] +l_capm_lay_str = get_layer_id("capm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "capm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_cap2m_lay_str = get_layer_id("cap2m", "drawing") #lay_df.loc[(lay_df["Layer name"] == "cap2m") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_hvntm_lay_str = get_layer_id("hvntm", "drawing") #lay_df.loc[(lay_df["Layer name"] == "hvntm") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_hvi_lay_str = get_layer_id("hvi", "drawing") #lay_df.loc[(lay_df["Layer name"] == "hvi") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_lvtn_lay_str = get_layer_id("lvtn", "drawing") #lay_df.loc[(lay_df["Layer name"] == "lvtn") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_hvtp_lay_str = get_layer_id("hvtp", "drawing") #lay_df.loc[(lay_df["Layer name"] == "hvtp") & (lay_df["Purpose"].str.contains("drawing")), "GDS layer:datatype"].values[0] +l_areaid_lvt_lay_str = get_layer_id("areaid.lvt", "dentifier") #lay_df.loc[(lay_df["Layer name"] == "areaid.lvt") & (lay_df["Purpose"].str.contains("dentifier")), "GDS layer:datatype"].values[0] +l_areaid_le_lay_str = get_layer_id("areaid.le", "dentifier") #lay_df.loc[(lay_df["Layer name"] == "areaid.le") & (lay_df["Purpose"].str.contains("dentifier")), "GDS layer:datatype"].values[0] # print(diff_lay_str) diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/new_single_octagon_ind.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/new_single_octagon_ind.py index d482bc4d..8d6223bd 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/new_single_octagon_ind.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/new_single_octagon_ind.py @@ -20,7 +20,6 @@ from .layers_definiations import * import pya import math -import pandas as pd """ diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/polyres.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/polyres.py index 776f26b0..7e0393aa 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/polyres.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/polyres.py @@ -18,7 +18,7 @@ ## Mabrains poly resistor 1.8V Generator for Skywaters 130nm ######################################################################################################################## from typing import DefaultDict -from pandas.core import series +#from pandas.core import series import pya import math from .layers_definiations import * @@ -162,4 +162,4 @@ def produce_impl(self): self.cell.flatten(1) self.layout.cleanup() - \ No newline at end of file + diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/rectangular_shielding.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/rectangular_shielding.py index c0565759..28ca2cdb 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/rectangular_shielding.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/rectangular_shielding.py @@ -20,7 +20,6 @@ from .layers_definiations import * import pya import math -import pandas as pd """ diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/single_octagon_ind.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/single_octagon_ind.py index 751ff0c8..6036b581 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/single_octagon_ind.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/single_octagon_ind.py @@ -20,7 +20,6 @@ from .layers_definiations import * import pya import math -import pandas as pd """ diff --git a/sky130_tech/tech/sky130/pymacros/sky130_pcells/triangular_shielding.py b/sky130_tech/tech/sky130/pymacros/sky130_pcells/triangular_shielding.py index 517bdc88..114b6d9e 100644 --- a/sky130_tech/tech/sky130/pymacros/sky130_pcells/triangular_shielding.py +++ b/sky130_tech/tech/sky130/pymacros/sky130_pcells/triangular_shielding.py @@ -20,7 +20,6 @@ from .layers_definiations import * import pya import math -import pandas as pd """ Mabrains Via Generator for Skywaters 130nm diff --git a/sky130_tech/tech/sky130/sky130.lyt b/sky130_tech/tech/sky130/sky130.lyt index 134f4d0f..ec23378a 100644 --- a/sky130_tech/tech/sky130/sky130.lyt +++ b/sky130_tech/tech/sky130/sky130.lyt @@ -4,9 +4,9 @@ SkyWater 130nm technology 0.001 - C:\Users\pc\OneDrive\Documents\GitHub\sky130_klayout_pdk\sky130_tech\tech\sky130 - C:\Users\pc\OneDrive\Documents\GitHub\sky130_klayout_pdk\sky130_tech\tech\sky130 - C:\Users\pc\OneDrive\Documents\GitHub\sky130_klayout_pdk\sky130_tech\tech\sky130\sky130.lyp + + $PDK_ROOT/$PDK/libs.tech/klayout + sky130.lyp true