# See LICENSE for licensing information. # # Copyright (c) 2016-2023 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. # from openram import debug from openram.base import design from openram.base import vector from openram.sram_factory import factory from openram.tech import parameter from openram import OPTS class pwrite_driver(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)) super().__init__(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=OPTS.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() self.add_boundary() 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") debug.check(self.tri.width