From 04af5480d21bd2b634e9e728a84f5e88ca23182f Mon Sep 17 00:00:00 2001 From: Matthew Guthaus Date: Wed, 30 Oct 2019 21:34:03 +0000 Subject: [PATCH] Add skeleton files for pwrite_driver --- compiler/pgates/pwrite_driver.py | 304 ++++++++++++++++++++++++ compiler/tests/04_pwrite_driver_test.py | 36 +++ 2 files changed, 340 insertions(+) create mode 100644 compiler/pgates/pwrite_driver.py create mode 100644 compiler/tests/04_pwrite_driver_test.py diff --git a/compiler/pgates/pwrite_driver.py b/compiler/pgates/pwrite_driver.py new file mode 100644 index 00000000..a808737b --- /dev/null +++ b/compiler/pgates/pwrite_driver.py @@ -0,0 +1,304 @@ +# See LICENSE for licensing information. +# +#Copyright (c) 2019 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. +# +import design +from tech import drc, parameter, spice +import debug +import math +from tech import drc +from vector import vector +from globals import OPTS +from sram_factory import factory + +class pwrite_driver(design.design): + """ + The pwrite_driver is two tristate inverters that drive the bitlines. + The data input is first inverted before one tristate. + The inverted enable is also generated to control one tristate. + """ + def __init__(self, name, size=0): + debug.error("pwrite_driver not implemented yet.", -1) + debug.info(1, "creating pwrite_driver {}".format(name)) + design.design.__init__(self, name) + self.size = size + self.beta = parameter["beta"] + self.pmos_width = self.beta*self.size*parameter["min_tx_size"] + self.nmos_width = self.size*parameter["min_tx_size"] + + # The tech M2 pitch is based on old via orientations + self.m2_pitch = self.m2_space + self.m2_width + + # Width is matched to the bitcell, + # Height will be variable + self.bitcell = factory.create(module_type="bitcell") + self.width = self.bitcell.width + + # Creates the netlist and layout + # Since it has variable height, it is not a pgate. + self.create_netlist() + if not OPTS.netlist_only: + self.create_layout() + self.DRC_LVS() + + + + def create_netlist(self): + self.add_pins() + self.add_modules() + self.create_insts() + + def create_layout(self): + self.place_modules() + self.route_wires() + self.route_supplies() + + + + def add_pins(self): + self.add_pin("din", "INPUT") + self.add_pin("bl", "OUTPUT") + self.add_pin("br", "OUTPUT") + self.add_pin("en", "INPUT") + self.add_pin("vdd", "POWER") + self.add_pin("gnd", "GROUND") + + + def add_modules(self): + + # Tristate inverter + self.tri = factory.create(module_type="ptristate_inv", height="min") + self.add_mod(self.tri) + debug.check(self.tri.width