clk_pin is redundant in DFFs

This commit is contained in:
mrg 2020-11-13 16:23:27 -08:00
parent 620e271562
commit 01d191da40
5 changed files with 14 additions and 26 deletions

View File

@ -21,10 +21,7 @@ class _cell:
for pin in port_order: for pin in port_order:
port_map[pin] = pin port_map[pin] = pin
self._pins = _pins(port_map) self._pins = _pins(port_map)
else:
self._pins = _pins(port_map)
self._port_names = [getattr(self._pins, x) for x in self._port_order]
self._boundary_layer = boundary_layer self._boundary_layer = boundary_layer
@property @property
@ -35,9 +32,8 @@ class _cell:
def hard_cell(self): def hard_cell(self):
return self._hard_cell return self._hard_cell
@property
def port_names(self): def port_names(self):
return self._port_names return [getattr(self._pins, x) for x in self._port_order]
@property @property
def port_types(self): def port_types(self):
@ -99,12 +95,6 @@ class _bitcell(_cell):
return self._storage_nets return self._storage_nets
class _dff(_cell):
def __init__(self, clk_pin, port_order, port_types, port_map=None, hard_cell=True):
super().__init__(port_order, port_types, port_map, hard_cell)
self.clk_pin = clk_pin
class cell_properties(): class cell_properties():
""" """
This contains meta information about the custom designed cells. For This contains meta information about the custom designed cells. For
@ -139,12 +129,10 @@ class cell_properties():
self._nand2_dec = _cell(["A", "B", "C", "D", "Z", "vdd", "gnd"], self._nand2_dec = _cell(["A", "B", "C", "D", "Z", "vdd", "gnd"],
["INPUT", "INPUT", "INPUT", "INPUT", "OUTPUT", "POWER", "GROUND"]) ["INPUT", "INPUT", "INPUT", "INPUT", "OUTPUT", "POWER", "GROUND"])
self._dff = _dff("clk", self._dff = _cell(["D", "Q", "clk", "vdd", "gnd"],
["D", "Q", "clk", "vdd", "gnd"],
["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"]) ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"])
self._dff_buf = _dff("clk", self._dff_buf = _cell(["D", "Q", "Qb", "clk", "vdd", "gnd"],
["D", "Q", "Qb", "clk", "vdd", "gnd"],
["INPUT", "OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"], ["INPUT", "OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"],
hard_cell=False) hard_cell=False)
@ -155,7 +143,7 @@ class cell_properties():
["INPUT", "INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"]) ["INPUT", "INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"])
self._bitcell_1port = _bitcell(["bl", "br", "wl", "vdd", "gnd"], self._bitcell_1port = _bitcell(["bl", "br", "wl", "vdd", "gnd"],
["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"]) ["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND<"])
self._bitcell_2port = _bitcell(["bl0", "br0", "bl1", "br1", "wl0", "wl1", "vdd", "gnd"], self._bitcell_2port = _bitcell(["bl0", "br0", "bl1", "br1", "wl0", "wl1", "vdd", "gnd"],
["OUTPUT", "OUTPUT", "OUTPUT", "OUTPUT", "INPUT", "INPUT", "POWER", "GROUND"]) ["OUTPUT", "OUTPUT", "OUTPUT", "OUTPUT", "INPUT", "INPUT", "POWER", "GROUND"])

View File

@ -37,8 +37,8 @@ class design(hierarchy_design):
prop = getattr(props, name) prop = getattr(props, name)
if prop.hard_cell: if prop.hard_cell:
# The pins get added from the spice file # The pins get added from the spice file
debug.check(prop.port_names == self.pins, debug.check(prop.port_names() == self.pins,
"Custom cell pin names do not match spice file:\n{0} vs {1}".format(prop.port_names, self.pins)) "Custom cell pin names do not match spice file:\n{0} vs {1}".format(prop.port_names(), self.pins))
self.add_pin_types(prop.port_types) self.add_pin_types(prop.port_types)
(width, height) = utils.get_libcell_size(self.cell_name, (width, height) = utils.get_libcell_size(self.cell_name,

View File

@ -22,7 +22,7 @@ class bitcell_base(design.design):
design.design.__init__(self, name) design.design.__init__(self, name)
if prop: if prop:
self.pins = prop.port_names self.pins = prop.port_names()
self.add_pin_types(prop.port_types) self.add_pin_types(prop.port_types)
self.nets_match = self.do_nets_exist(prop.storage_nets) self.nets_match = self.do_nets_exist(prop.storage_nets)
self.mirror = prop.mirror self.mirror = prop.mirror

View File

@ -18,7 +18,7 @@ class dff(design.design):
def __init__(self, name="dff"): def __init__(self, name="dff"):
super().__init__(name) super().__init__(name)
self.clk_pin = props.dff.clk_pin self.clk_pin = props.dff.pin.clk
def analytical_power(self, corner, load): def analytical_power(self, corner, load):
"""Returns dynamic and leakage power. Results in nW""" """Returns dynamic and leakage power. Results in nW"""

View File

@ -72,7 +72,7 @@ class dff_buf(design.design):
self.add_mod(self.inv2) self.add_mod(self.inv2)
def add_pins(self): def add_pins(self):
self.add_pin_list(props.dff_buf.port_names, self.add_pin_list(props.dff_buf.port_names(),
props.dff_buf.port_types) props.dff_buf.port_types)
def create_instances(self): def create_instances(self):