From 6cf20a03538bb318e7325e65d37a15ae6b23c376 Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Thu, 30 Jan 2020 19:44:24 +0000 Subject: [PATCH 1/9] add technology based module customization --- compiler/modules/custom_module_properties.py | 27 ++++++++++++++++++++ compiler/modules/dff.py | 9 +++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 compiler/modules/custom_module_properties.py diff --git a/compiler/modules/custom_module_properties.py b/compiler/modules/custom_module_properties.py new file mode 100644 index 00000000..43c140b0 --- /dev/null +++ b/compiler/modules/custom_module_properties.py @@ -0,0 +1,27 @@ +# See LICENSE for licensing information. +# +# Copyright (c) 2016-2020 Regents of the University of California and The Board +# of Regents for the Oklahoma Agricultural and Mechanical College +# (acting for and on behalf of Oklahoma State University) +# All rights reserved. +# + +class _dff: + def __init__(self, use_custom_ports, custom_port_list, custom_type_list): + self.use_custom_ports = use_custom_ports + self.custom_port_list = custom_port_list + self.custom_type_list = custom_type_list + +class module_properties(): + """ + TODO + """ + def __init__(self): + self.names = {} + self._dff = _dff(use_custom_ports = False, + custom_port_list = [], + custom_type_list = []) + + @property + def dff(self): + return self._dff diff --git a/compiler/modules/dff.py b/compiler/modules/dff.py index 8871872d..1078088e 100644 --- a/compiler/modules/dff.py +++ b/compiler/modules/dff.py @@ -7,6 +7,7 @@ # import design from tech import GDS, layer, spice, parameter +from tech import module_properties import utils @@ -14,9 +15,13 @@ class dff(design.design): """ Memory address flip-flop """ + if not module_properties.dff.use_custom_ports: + pin_names = ["D", "Q", "clk", "vdd", "gnd"] + type_list = ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] + else: + pin_names = module_properties.dff.custom_port_list + type_list = module_properties.dff.custom_type_list - pin_names = ["D", "Q", "clk", "vdd", "gnd"] - type_list = ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] (width, height) = utils.get_libcell_size("dff", GDS["unit"], layer["boundary"]) From ed11145ca49a365cd46641d288fb1ef64b55b91b Mon Sep 17 00:00:00 2001 From: jcirimel Date: Tue, 4 Feb 2020 23:35:06 -0800 Subject: [PATCH 2/9] add custom module file, make dff clk pin dynamic --- compiler/modules/custom_module_properties.py | 8 +++++--- compiler/modules/dff.py | 2 ++ compiler/modules/dff_array.py | 15 ++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/compiler/modules/custom_module_properties.py b/compiler/modules/custom_module_properties.py index 43c140b0..e27741ea 100644 --- a/compiler/modules/custom_module_properties.py +++ b/compiler/modules/custom_module_properties.py @@ -7,10 +7,11 @@ # class _dff: - def __init__(self, use_custom_ports, custom_port_list, custom_type_list): + def __init__(self, use_custom_ports, custom_port_list, custom_type_list, clk_pin): self.use_custom_ports = use_custom_ports self.custom_port_list = custom_port_list self.custom_type_list = custom_type_list + self.clk_pin = clk_pin class module_properties(): """ @@ -19,8 +20,9 @@ class module_properties(): def __init__(self): self.names = {} self._dff = _dff(use_custom_ports = False, - custom_port_list = [], - custom_type_list = []) + custom_port_list = ["D", "Q", "clk", "vdd", "gnd"], + custom_type_list = ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"], + clk_pin= "clk") @property def dff(self): diff --git a/compiler/modules/dff.py b/compiler/modules/dff.py index 1078088e..45d20a62 100644 --- a/compiler/modules/dff.py +++ b/compiler/modules/dff.py @@ -18,9 +18,11 @@ class dff(design.design): if not module_properties.dff.use_custom_ports: pin_names = ["D", "Q", "clk", "vdd", "gnd"] type_list = ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] + clk_pin = "clk" else: pin_names = module_properties.dff.custom_port_list type_list = module_properties.dff.custom_type_list + clk_pin = module_properties.dff.clk_pin (width, height) = utils.get_libcell_size("dff", GDS["unit"], diff --git a/compiler/modules/dff_array.py b/compiler/modules/dff_array.py index 6ba020c7..62464834 100644 --- a/compiler/modules/dff_array.py +++ b/compiler/modules/dff_array.py @@ -69,11 +69,12 @@ class dff_array(design.design): name = "dff_r{0}_c{1}".format(row,col) self.dff_insts[row,col]=self.add_inst(name=name, mod=self.dff) - self.connect_inst([self.get_din_name(row,col), - self.get_dout_name(row,col), - "clk", - "vdd", - "gnd"]) + instance_ports = [self.get_din_name(row,col), + self.get_dout_name(row,col)] + for port in self.dff.pin_names: + if port != 'D' and port != 'Q': + instance_ports.append(port) + self.connect_inst(instance_ports) def place_dff_array(self): for row in range(self.rows): @@ -142,7 +143,7 @@ class dff_array(design.design): # Create vertical spines to a single horizontal rail - clk_pin = self.dff_insts[0,0].get_pin("clk") + clk_pin = self.dff_insts[0,0].get_pin(self.dff.clk_pin) clk_ypos = 2*self.m3_pitch+self.m3_width debug.check(clk_pin.layer=="m2","DFF clk pin not on metal2") self.add_layout_pin_segment_center(text="clk", @@ -150,7 +151,7 @@ class dff_array(design.design): start=vector(0,clk_ypos), end=vector(self.width,clk_ypos)) for col in range(self.columns): - clk_pin = self.dff_insts[0,col].get_pin("clk") + clk_pin = self.dff_insts[0,col].get_pin(self.dff.clk_pin) # Make a vertical strip for each column self.add_rect(layer="m2", offset=clk_pin.ll().scale(1,0), From 18573c0e42c4b48ff24716d230fb1c454b6304dc Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Wed, 5 Feb 2020 22:25:35 +0000 Subject: [PATCH 3/9] add module properties to other technologies --- technology/freepdk45/tech/tech.py | 3 ++- technology/scn4m_subm/tech/tech.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/technology/freepdk45/tech/tech.py b/technology/freepdk45/tech/tech.py index c60abeb5..f91be16c 100644 --- a/technology/freepdk45/tech/tech.py +++ b/technology/freepdk45/tech/tech.py @@ -9,7 +9,7 @@ import os from design_rules import * from module_type import * from custom_cell_properties import cell_properties - +from custom_module_properties import module_properties """ File containing the process technology parameters for FreePDK 45nm. """ @@ -25,6 +25,7 @@ File containing the process technology parameters for FreePDK 45nm. # For example: tech_modules['contact'] = 'contact_freepdk45' tech_modules = module_type() +module_properties = module_properties() ################################################### # Custom cell properties ################################################### diff --git a/technology/scn4m_subm/tech/tech.py b/technology/scn4m_subm/tech/tech.py index 7c360d38..bb379478 100644 --- a/technology/scn4m_subm/tech/tech.py +++ b/technology/scn4m_subm/tech/tech.py @@ -9,6 +9,7 @@ import os from design_rules import * from module_type import * from custom_cell_properties import cell_properties +from custom_module_properties import module_properties """ File containing the process technology parameters for SCMOS 4m, 0.35um @@ -24,6 +25,7 @@ File containing the process technology parameters for SCMOS 4m, 0.35um # implementation in '$OPENRAM_TECHDIR/modules/' # For example: tech_modules['contact'] = 'contact_scn4m' tech_modules = module_type() +module_properties = module_properties() ################################################### # Custom cell properties From 3a06141030c2f247d8184cef1db3955d16fbf01f Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Thu, 6 Feb 2020 12:10:49 +0000 Subject: [PATCH 4/9] add simple sram sizing for netlist only --- compiler/base/utils.py | 13 +++++++++---- compiler/modules/bank.py | 1 + compiler/sram/sram_config.py | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/compiler/base/utils.py b/compiler/base/utils.py index f02b2b85..16fbc51f 100644 --- a/compiler/base/utils.py +++ b/compiler/base/utils.py @@ -96,8 +96,10 @@ def get_libcell_size(name, units, lpp): Open a GDS file and return the library cell size from either the bounding box or a border layer. """ - cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" - return(get_gds_size(name, cell_gds, units, lpp)) + if not OPTS.netlist_only: + cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" + return(get_gds_size(name, cell_gds, units, lpp)) + return (0,0,) def get_gds_pins(pin_names, name, gds_filename, units): @@ -128,8 +130,11 @@ def get_libcell_pins(pin_list, name, units): Open a GDS file and find the pins in pin_list as text on a given layer. Return these as a rectangle layer pair for each pin. """ - cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" - return(get_gds_pins(pin_list, name, cell_gds, units)) + if not OPTS.netlist_only: + cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" + return(get_gds_pins(pin_list, name, cell_gds, units)) + else: + return diff --git a/compiler/modules/bank.py b/compiler/modules/bank.py index 7ed0c9a3..4a674c23 100644 --- a/compiler/modules/bank.py +++ b/compiler/modules/bank.py @@ -57,6 +57,7 @@ class bank(design.design): def create_netlist(self): + self.compute_sizes() self.add_modules() self.add_pins() # Must create the replica bitcell array first diff --git a/compiler/sram/sram_config.py b/compiler/sram/sram_config.py index 376bf42b..c086a57a 100644 --- a/compiler/sram/sram_config.py +++ b/compiler/sram/sram_config.py @@ -23,9 +23,12 @@ class sram_config: # This will get over-written when we determine the organization self.words_per_row = words_per_row + if not OPTS.netlist_only: + self.compute_sizes() + else: + self.compute_simple_sram_sizes() - self.compute_sizes() - + def set_local_config(self, module): """ Copy all of the member variables to the given module for convenience """ @@ -35,6 +38,14 @@ class sram_config: # Copy all the variables to the local module for member in members: setattr(module,member,getattr(self,member)) + def compute_simple_sram_sizes(self): + self.row_addr_size = int(log(OPTS.num_words, 2)) + self.col_addr_size = int(log(OPTS.word_size, 2)) + self.words_per_row = 1 + self.num_rows = OPTS.num_words + self.num_cols = OPTS.word_size + self.bank_addr_size = self.col_addr_size + self.row_addr_size + self.addr_size = self.bank_addr_size + int(log(self.num_banks, 2)) def compute_sizes(self): """ Computes the organization of the memory using bitcell size by trying to make it square.""" From b1079346726ae5f4028bba0f0d5272488d972f82 Mon Sep 17 00:00:00 2001 From: Jesse Cirimelli-Low Date: Thu, 6 Feb 2020 12:15:52 +0000 Subject: [PATCH 5/9] fix styling --- compiler/example_configs/example_config_scn4m_subm.py | 1 + compiler/sram/sram_config.py | 1 + 2 files changed, 2 insertions(+) diff --git a/compiler/example_configs/example_config_scn4m_subm.py b/compiler/example_configs/example_config_scn4m_subm.py index 71ef328b..a55122a2 100644 --- a/compiler/example_configs/example_config_scn4m_subm.py +++ b/compiler/example_configs/example_config_scn4m_subm.py @@ -9,6 +9,7 @@ temperatures = [25] route_supplies = True check_lvsdrc = True +netlist_only = True output_path = "temp" output_name = "sram_{0}_{1}_{2}".format(word_size, diff --git a/compiler/sram/sram_config.py b/compiler/sram/sram_config.py index c086a57a..20c8299e 100644 --- a/compiler/sram/sram_config.py +++ b/compiler/sram/sram_config.py @@ -38,6 +38,7 @@ class sram_config: # Copy all the variables to the local module for member in members: setattr(module,member,getattr(self,member)) + def compute_simple_sram_sizes(self): self.row_addr_size = int(log(OPTS.num_words, 2)) self.col_addr_size = int(log(OPTS.word_size, 2)) From b212b3e85a31b279fe2265c8889a8fb3cb330586 Mon Sep 17 00:00:00 2001 From: jcirimel Date: Sun, 9 Feb 2020 21:37:09 -0800 Subject: [PATCH 6/9] s8 gdsless netlist only working up to dff array --- compiler/base/utils.py | 16 +++++++--------- compiler/bitcells/bitcell.py | 7 +++++-- compiler/bitcells/replica_bitcell.py | 18 ++++++++++++++---- compiler/modules/replica_bitcell_array.py | 4 ++-- compiler/modules/sense_amp.py | 9 +++++++-- compiler/modules/write_driver.py | 9 +++++++-- compiler/sram/sram_config.py | 14 +------------- 7 files changed, 43 insertions(+), 34 deletions(-) diff --git a/compiler/base/utils.py b/compiler/base/utils.py index 16fbc51f..b6a62788 100644 --- a/compiler/base/utils.py +++ b/compiler/base/utils.py @@ -96,10 +96,10 @@ def get_libcell_size(name, units, lpp): Open a GDS file and return the library cell size from either the bounding box or a border layer. """ - if not OPTS.netlist_only: - cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" - return(get_gds_size(name, cell_gds, units, lpp)) - return (0,0,) + + cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" + return(get_gds_size(name, cell_gds, units, lpp)) + def get_gds_pins(pin_names, name, gds_filename, units): @@ -130,11 +130,9 @@ def get_libcell_pins(pin_list, name, units): Open a GDS file and find the pins in pin_list as text on a given layer. Return these as a rectangle layer pair for each pin. """ - if not OPTS.netlist_only: - cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" - return(get_gds_pins(pin_list, name, cell_gds, units)) - else: - return + + cell_gds = OPTS.openram_tech + "gds_lib/" + str(name) + ".gds" + return(get_gds_pins(pin_list, name, cell_gds, units)) diff --git a/compiler/bitcells/bitcell.py b/compiler/bitcells/bitcell.py index 5b552832..a2ae66bf 100644 --- a/compiler/bitcells/bitcell.py +++ b/compiler/bitcells/bitcell.py @@ -81,8 +81,11 @@ class bitcell(bitcell_base.bitcell_base): def get_wl_name(self, port=0): """Get wl name""" - debug.check(port == 0, "One port for bitcell only.") - return "wl" + if cell_properties.bitcell.split_wl: + return "wl{}".format(port) + else: + debug.check(port == 0, "One port for bitcell only.") + return "wl" def build_graph(self, graph, inst_name, port_nets): """ diff --git a/compiler/bitcells/replica_bitcell.py b/compiler/bitcells/replica_bitcell.py index 2f804bf0..e67ce118 100644 --- a/compiler/bitcells/replica_bitcell.py +++ b/compiler/bitcells/replica_bitcell.py @@ -8,7 +8,8 @@ import design import debug import utils -from tech import GDS,layer,drc,parameter +from tech import GDS,layer,drc,parameter,cell_properties +from globals import OPTS class replica_bitcell(design.design): """ @@ -17,10 +18,19 @@ class replica_bitcell(design.design): is a hand-made cell, so the layout and netlist should be available in the technology library. """ - pin_names = ["bl", "br", "wl", "vdd", "gnd"] + if cell_properties.bitcell.split_wl: + pin_names = ["bl", "br", "wl0", "wl1", "vdd", "gnd"] + else: + pin_names = ["bl", "br", "wl", "vdd", "gnd"] + type_list = ["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] - (width,height) = utils.get_libcell_size("replica_cell_6t", GDS["unit"], layer["boundary"]) - pin_map = utils.get_libcell_pins(pin_names, "replica_cell_6t", GDS["unit"]) + + if not OPTS.netlist_only: + (width,height) = utils.get_libcell_size("replica_cell_6t", GDS["unit"], layer["boundary"]) + pin_map = utils.get_libcell_pins(pin_names, "replica_cell_6t", GDS["unit"]) + else: + (width,height) = (0,0) + pin_map = [] def __init__(self, name=""): # Ignore the name argument diff --git a/compiler/modules/replica_bitcell_array.py b/compiler/modules/replica_bitcell_array.py index 178c2f91..a8b3ec30 100644 --- a/compiler/modules/replica_bitcell_array.py +++ b/compiler/modules/replica_bitcell_array.py @@ -158,7 +158,7 @@ class replica_bitcell_array(design.design): # Left port WLs (one dummy for each port when we allow >1 port) for port in range(self.left_rbl): # Make names for all RBLs - wl_names=["rbl_{0}_{1}".format(self.cell.get_wl_name(x),port) for x in range(len(self.all_ports))] + wl_names=["rbl_{0}_{1}".format(self.cell.get_wl_name(x),port) for x in range(len(self.cell.get_all_wl_names()))] # Keep track of the pin that is the RBL self.rbl_wl_names[port]=wl_names[self.bitcell_ports[port]] self.replica_col_wl_names.extend(wl_names) @@ -167,7 +167,7 @@ class replica_bitcell_array(design.design): # Right port WLs (one dummy for each port when we allow >1 port) for port in range(self.left_rbl,self.left_rbl+self.right_rbl): # Make names for all RBLs - wl_names=["rbl_{0}_{1}".format(self.cell.get_wl_name(x),port) for x in range(len(self.all_ports))] + wl_names=["rbl_{0}_{1}".format(self.cell.get_wl_name(x),port) for x in range(len(self.cell.get_all_wl_names()))] # Keep track of the pin that is the RBL self.rbl_wl_names[port]=wl_names[self.bitcell_ports[port]] self.replica_col_wl_names.extend(wl_names) diff --git a/compiler/modules/sense_amp.py b/compiler/modules/sense_amp.py index e77d577f..ac3a859c 100644 --- a/compiler/modules/sense_amp.py +++ b/compiler/modules/sense_amp.py @@ -9,6 +9,7 @@ import design import debug import utils from tech import GDS,layer, parameter,drc +from globals import OPTS import logical_effort class sense_amp(design.design): @@ -21,8 +22,12 @@ class sense_amp(design.design): pin_names = ["bl", "br", "dout", "en", "vdd", "gnd"] type_list = ["INPUT", "INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] - (width,height) = utils.get_libcell_size("sense_amp", GDS["unit"], layer["boundary"]) - pin_map = utils.get_libcell_pins(pin_names, "sense_amp", GDS["unit"]) + if not OPTS.netlist_only: + (width,height) = utils.get_libcell_size("sense_amp", GDS["unit"], layer["boundary"]) + pin_map = utils.get_libcell_pins(pin_names, "sense_amp", GDS["unit"]) + else: + (width, height) = (0,0) + pin_map = [] def __init__(self, name): design.design.__init__(self, name) diff --git a/compiler/modules/write_driver.py b/compiler/modules/write_driver.py index 85a58fd5..11b14f00 100644 --- a/compiler/modules/write_driver.py +++ b/compiler/modules/write_driver.py @@ -8,6 +8,7 @@ import debug import design import utils +from globals import OPTS from tech import GDS,layer class write_driver(design.design): @@ -20,8 +21,12 @@ class write_driver(design.design): pin_names = ["din", "bl", "br", "en", "vdd", "gnd"] type_list = ["INPUT", "OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] - (width,height) = utils.get_libcell_size("write_driver", GDS["unit"], layer["boundary"]) - pin_map = utils.get_libcell_pins(pin_names, "write_driver", GDS["unit"]) + if not OPTS.netlist_only: + (width,height) = utils.get_libcell_size("write_driver", GDS["unit"], layer["boundary"]) + pin_map = utils.get_libcell_pins(pin_names, "write_driver", GDS["unit"]) + else: + (width,height) = (0,0) + pin_map = [] def __init__(self, name): design.design.__init__(self, name) diff --git a/compiler/sram/sram_config.py b/compiler/sram/sram_config.py index 20c8299e..3a7e6d39 100644 --- a/compiler/sram/sram_config.py +++ b/compiler/sram/sram_config.py @@ -23,10 +23,7 @@ class sram_config: # This will get over-written when we determine the organization self.words_per_row = words_per_row - if not OPTS.netlist_only: - self.compute_sizes() - else: - self.compute_simple_sram_sizes() + self.compute_sizes() @@ -38,15 +35,6 @@ class sram_config: # Copy all the variables to the local module for member in members: setattr(module,member,getattr(self,member)) - - def compute_simple_sram_sizes(self): - self.row_addr_size = int(log(OPTS.num_words, 2)) - self.col_addr_size = int(log(OPTS.word_size, 2)) - self.words_per_row = 1 - self.num_rows = OPTS.num_words - self.num_cols = OPTS.word_size - self.bank_addr_size = self.col_addr_size + self.row_addr_size - self.addr_size = self.bank_addr_size + int(log(self.num_banks, 2)) def compute_sizes(self): """ Computes the organization of the memory using bitcell size by trying to make it square.""" From 7038fad9301e3229364feb084233bb074cafdd91 Mon Sep 17 00:00:00 2001 From: jcirimel Date: Sun, 9 Feb 2020 23:10:33 -0800 Subject: [PATCH 7/9] s8 gdsless netlist only working up to pdriver --- compiler/modules/custom_module_properties.py | 27 ++++++++++++++++++++ compiler/modules/dff_buf.py | 9 +++++-- compiler/modules/dff_buf_array.py | 14 +++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/compiler/modules/custom_module_properties.py b/compiler/modules/custom_module_properties.py index e27741ea..768a8c18 100644 --- a/compiler/modules/custom_module_properties.py +++ b/compiler/modules/custom_module_properties.py @@ -13,17 +13,44 @@ class _dff: self.custom_type_list = custom_type_list self.clk_pin = clk_pin +class _dff_buff: + def __init__(self, use_custom_ports, custom_buff_ports, add_body_contacts): + self.use_custom_ports = use_custom_ports + self.buf_ports = custom_buff_ports + self.add_body_contacts = add_body_contacts + +class _dff_buff_array: + def __init__(self, use_custom_ports, add_body_contacts): + self.use_custom_ports = use_custom_ports + self.add_body_contacts = add_body_contacts + class module_properties(): """ TODO """ def __init__(self): self.names = {} + self._dff = _dff(use_custom_ports = False, custom_port_list = ["D", "Q", "clk", "vdd", "gnd"], custom_type_list = ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"], clk_pin= "clk") + + self._dff_buff = _dff_buff(use_custom_ports = False, + custom_buff_ports = ["D", "qint", "clk", "vdd", "gnd"], + add_body_contacts = False) + + self._dff_buff_array = _dff_buff_array(use_custom_ports = False, + add_body_contacts = False) @property def dff(self): return self._dff + + @property + def dff_buff(self): + return self._dff_buff + + @property + def dff_buff_array(self): + return self._dff_buff_array \ No newline at end of file diff --git a/compiler/modules/dff_buf.py b/compiler/modules/dff_buf.py index 9e2ff0aa..d2698b34 100644 --- a/compiler/modules/dff_buf.py +++ b/compiler/modules/dff_buf.py @@ -7,7 +7,7 @@ # import debug import design -from tech import drc,parameter +from tech import drc,parameter,module_properties from math import log from vector import vector from globals import OPTS @@ -82,10 +82,15 @@ class dff_buf(design.design): self.add_pin("vdd", "POWER") self.add_pin("gnd", "GROUND") + if module_properties.dff_buff.add_body_contacts: + self.add_pin("vpb", "INPUT") + self.add_pin("vpn", "INPUT") + def create_instances(self): self.dff_inst=self.add_inst(name="dff_buf_dff", mod=self.dff) - self.connect_inst(["D", "qint", "clk", "vdd", "gnd"]) + self.connect_inst(module_properties.dff_buff.buf_ports) + #self.connect_inst(["D", "qint", "clk", "vdd", "gnd"]) self.inv1_inst=self.add_inst(name="dff_buf_inv1", mod=self.inv1) diff --git a/compiler/modules/dff_buf_array.py b/compiler/modules/dff_buf_array.py index 8b8e21dc..326fdda1 100644 --- a/compiler/modules/dff_buf_array.py +++ b/compiler/modules/dff_buf_array.py @@ -7,7 +7,7 @@ # import debug import design -from tech import drc +from tech import drc, module_properties from math import log from vector import vector from globals import OPTS @@ -64,6 +64,10 @@ class dff_buf_array(design.design): self.add_pin("vdd", "POWER") self.add_pin("gnd", "GROUND") + if module_properties.dff_buff_array.add_body_contacts: + self.add_pin("vpb", "INPUT") + self.add_pin("vnb", "INPUT") + def add_modules(self): self.dff = factory.create(module_type="dff_buf", inv1_size=self.inv1_size, @@ -77,12 +81,16 @@ class dff_buf_array(design.design): name = "dff_r{0}_c{1}".format(row,col) self.dff_insts[row,col]=self.add_inst(name=name, mod=self.dff) - self.connect_inst([self.get_din_name(row,col), + inst_ports = [self.get_din_name(row,col), self.get_dout_name(row,col), self.get_dout_bar_name(row,col), "clk", "vdd", - "gnd"]) + "gnd"] + if module_properties.dff_buff_array.add_body_contacts: + inst_ports.append("vpb") + inst_ports.append("vnb") + self.connect_inst(inst_ports) def place_dff_array(self): for row in range(self.rows): From 27eced1fbe0729c764117379c992cae405d14ada Mon Sep 17 00:00:00 2001 From: jcirimel Date: Sun, 9 Feb 2020 23:51:01 -0800 Subject: [PATCH 8/9] netlist_only done --- compiler/bitcells/bitcell.py | 5 +++-- compiler/bitcells/replica_bitcell.py | 4 ++-- compiler/modules/control_logic.py | 8 ++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/compiler/bitcells/bitcell.py b/compiler/bitcells/bitcell.py index a2ae66bf..49fdf19f 100644 --- a/compiler/bitcells/bitcell.py +++ b/compiler/bitcells/bitcell.py @@ -25,11 +25,12 @@ class bitcell(bitcell_base.bitcell_base): if cell_properties.bitcell.split_wl: pin_names = ["bl", "br", "wl0", "wl1", "vdd", "gnd"] + type_list = ["OUTPUT", "OUTPUT", "INPUT", "INPUT", "POWER", "GROUND"] else: pin_names = ["bl", "br", "wl", "vdd", "gnd"] - + type_list = ["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] storage_nets = ['Q', 'Qbar'] - type_list = ["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] + (width, height) = utils.get_libcell_size("cell_6t", GDS["unit"], layer["boundary"]) diff --git a/compiler/bitcells/replica_bitcell.py b/compiler/bitcells/replica_bitcell.py index e67ce118..a869e4b7 100644 --- a/compiler/bitcells/replica_bitcell.py +++ b/compiler/bitcells/replica_bitcell.py @@ -20,10 +20,10 @@ class replica_bitcell(design.design): if cell_properties.bitcell.split_wl: pin_names = ["bl", "br", "wl0", "wl1", "vdd", "gnd"] + type_list = ["OUTPUT", "OUTPUT", "INPUT", "INPUT" , "POWER", "GROUND"] else: pin_names = ["bl", "br", "wl", "vdd", "gnd"] - - type_list = ["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] + type_list = ["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"] if not OPTS.netlist_only: (width,height) = utils.get_libcell_size("replica_cell_6t", GDS["unit"], layer["boundary"]) diff --git a/compiler/modules/control_logic.py b/compiler/modules/control_logic.py index dbb7c3b7..fa11e30b 100644 --- a/compiler/modules/control_logic.py +++ b/compiler/modules/control_logic.py @@ -7,7 +7,7 @@ # from math import log import design -from tech import drc, parameter +from tech import drc, parameter, module_properties import debug import contact from sram_factory import factory @@ -742,7 +742,11 @@ class control_logic(design.design): def create_dffs(self): self.ctrl_dff_inst=self.add_inst(name="ctrl_dffs", mod=self.ctrl_dff_array) - self.connect_inst(self.input_list + self.dff_output_list + ["clk_buf"] + self.supply_list) + inst_pins = self.input_list + self.dff_output_list + ["clk_buf"] + self.supply_list + if module_properties.dff_buff_array.add_body_contacts: + inst_pins.append("vpb") + inst_pins.append("vnb") + self.connect_inst(inst_pins) def place_dffs(self): self.ctrl_dff_inst.place(vector(0,0)) From 101eb281126f6dd3fd1897ed0a4ebb3ac2f6372b Mon Sep 17 00:00:00 2001 From: jcirimel Date: Sun, 9 Feb 2020 23:52:11 -0800 Subject: [PATCH 9/9] revert example scn4m to non netlist only --- compiler/example_configs/example_config_scn4m_subm.py | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/example_configs/example_config_scn4m_subm.py b/compiler/example_configs/example_config_scn4m_subm.py index a55122a2..71ef328b 100644 --- a/compiler/example_configs/example_config_scn4m_subm.py +++ b/compiler/example_configs/example_config_scn4m_subm.py @@ -9,7 +9,6 @@ temperatures = [25] route_supplies = True check_lvsdrc = True -netlist_only = True output_path = "temp" output_name = "sram_{0}_{1}_{2}".format(word_size,