2016-11-08 18:57:35 +01:00
|
|
|
import debug
|
|
|
|
|
import design
|
|
|
|
|
import utils
|
|
|
|
|
from tech import GDS,layer
|
|
|
|
|
|
|
|
|
|
class write_driver(design.design):
|
|
|
|
|
"""
|
|
|
|
|
Tristate write driver to be active during write operations only.
|
|
|
|
|
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.
|
|
|
|
|
"""
|
|
|
|
|
|
2018-02-01 02:37:16 +01:00
|
|
|
pin_names = ["din", "bl", "br", "en", "gnd", "vdd"]
|
2017-08-24 00:02:15 +02:00
|
|
|
(width,height) = utils.get_libcell_size("write_driver", GDS["unit"], layer["boundary"])
|
2018-11-07 20:31:44 +01:00
|
|
|
pin_map = utils.get_libcell_pins(pin_names, "write_driver", GDS["unit"])
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
def __init__(self, name):
|
|
|
|
|
design.design.__init__(self, name)
|
2017-11-14 22:24:14 +01:00
|
|
|
debug.info(2, "Create write_driver")
|
2016-11-08 18:57:35 +01:00
|
|
|
|
2017-08-24 00:02:15 +02:00
|
|
|
self.width = write_driver.width
|
|
|
|
|
self.height = write_driver.height
|
|
|
|
|
self.pin_map = write_driver.pin_map
|
2016-11-08 18:57:35 +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
|
|
|
|
|
|
|
|
def build_graph(self, graph, inst_name, port_nets):
|
|
|
|
|
"""Adds edges to graph. Handmade cells must implement this manually."""
|
|
|
|
|
#The cell has 6 net ports hard-coded in self.pin_names. The edges
|
|
|
|
|
#are based on the hard-coded name positions.
|
|
|
|
|
# The edges added are: din->bl, din->br, en->bl, en->br
|
|
|
|
|
# A liberal amount of edges were added, may be reduced later for complexity.
|
|
|
|
|
# Internal nodes of the handmade cell not considered, only ports. vdd/gnd ignored for graph.
|
|
|
|
|
graph.add_edge(port_nets[0],port_nets[1])
|
|
|
|
|
graph.add_edge(port_nets[0],port_nets[2])
|
|
|
|
|
graph.add_edge(port_nets[3],port_nets[1])
|
|
|
|
|
graph.add_edge(port_nets[3],port_nets[2])
|