2019-04-26 21:21:50 +02:00
|
|
|
# See LICENSE for licensing information.
|
|
|
|
|
#
|
2019-06-14 17:43:41 +02:00
|
|
|
# Copyright (c) 2016-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.
|
2019-04-26 21:21:50 +02:00
|
|
|
#
|
2016-11-08 18:57:35 +01:00
|
|
|
import debug
|
|
|
|
|
import design
|
|
|
|
|
import utils
|
2020-11-03 01:00:16 +01:00
|
|
|
from tech import GDS, layer
|
2020-02-17 14:25:00 +01:00
|
|
|
from tech import cell_properties as props
|
2016-11-08 18:57:35 +01:00
|
|
|
|
2020-11-03 01:00:16 +01:00
|
|
|
|
2016-11-08 18:57:35 +01:00
|
|
|
class write_driver(design.design):
|
|
|
|
|
"""
|
2020-11-03 15:29:17 +01:00
|
|
|
Tristate write driver to be active during write operations only.
|
2016-11-08 18:57:35 +01:00
|
|
|
This module implements the write driver cell used in the design. It
|
|
|
|
|
is a hand-made cell, so the layout and netlist should be available in
|
|
|
|
|
the technology library.
|
|
|
|
|
"""
|
|
|
|
|
|
2020-02-17 14:25:00 +01:00
|
|
|
pin_names = [props.write_driver.pin.din,
|
|
|
|
|
props.write_driver.pin.bl,
|
|
|
|
|
props.write_driver.pin.br,
|
|
|
|
|
props.write_driver.pin.en,
|
|
|
|
|
props.write_driver.pin.vdd,
|
|
|
|
|
props.write_driver.pin.gnd]
|
|
|
|
|
|
2019-05-07 09:52:27 +02:00
|
|
|
type_list = ["INPUT", "OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"]
|
2020-11-03 01:00:16 +01:00
|
|
|
cell_size_layer = "boundary"
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
def __init__(self, name):
|
2020-11-03 20:58:25 +01:00
|
|
|
super().__init__(name)
|
2017-11-14 22:24:14 +01:00
|
|
|
debug.info(2, "Create write_driver")
|
2016-11-08 18:57:35 +01:00
|
|
|
|
2020-11-03 20:58:25 +01:00
|
|
|
(width, height) = utils.get_libcell_size(self.cell_name,
|
2020-11-03 01:00:16 +01:00
|
|
|
GDS["unit"],
|
|
|
|
|
layer[self.cell_size_layer])
|
2020-11-03 15:29:17 +01:00
|
|
|
|
2020-11-03 01:00:16 +01:00
|
|
|
pin_map = utils.get_libcell_pins(self.pin_names,
|
2020-11-03 20:58:25 +01:00
|
|
|
self.cell_name,
|
2020-11-03 01:00:16 +01:00
|
|
|
GDS["unit"])
|
|
|
|
|
|
|
|
|
|
self.width = width
|
|
|
|
|
self.height = height
|
|
|
|
|
self.pin_map = pin_map
|
2019-05-07 09:52:27 +02:00
|
|
|
self.add_pin_types(self.type_list)
|
2019-01-23 21:03:52 +01:00
|
|
|
|
2020-02-12 14:04:05 +01:00
|
|
|
def get_bl_names(self):
|
2020-02-17 14:25:00 +01:00
|
|
|
return props.write_driver.pin.bl
|
2020-02-12 14:04:05 +01:00
|
|
|
|
|
|
|
|
def get_br_names(self):
|
2020-02-17 14:25:00 +01:00
|
|
|
return props.write_driver.pin.br
|
2020-02-12 14:04:05 +01:00
|
|
|
|
2020-02-17 14:23:26 +01:00
|
|
|
@property
|
|
|
|
|
def din_name(self):
|
2020-02-17 14:25:00 +01:00
|
|
|
return props.write_driver.pin.din
|
2020-02-17 14:23:26 +01:00
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def en_name(self):
|
2020-02-17 14:25:00 +01:00
|
|
|
return props.write_driver.pin.en
|
2020-02-17 14:23:26 +01:00
|
|
|
|
2019-01-23 21:03:52 +01:00
|
|
|
def get_w_en_cin(self):
|
|
|
|
|
"""Get the relative capacitance of a single input"""
|
|
|
|
|
# This is approximated from SCMOS. It has roughly 5 3x transistor gates.
|
|
|
|
|
return 5*3
|
2019-04-24 23:23:22 +02:00
|
|
|
|
2020-11-03 15:29:17 +01:00
|
|
|
def build_graph(self, graph, inst_name, port_nets):
|
2019-05-07 09:52:27 +02:00
|
|
|
"""Adds edges based on inputs/outputs. Overrides base class function."""
|
2020-11-03 15:29:17 +01:00
|
|
|
self.add_graph_edges(graph, port_nets)
|