OpenRAM/compiler/bitcells/bitcell_1port.py

75 lines
2.4 KiB
Python
Raw Normal View History

# 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.
#
2016-11-08 18:57:35 +01:00
import debug
from tech import cell_properties as props
import bitcell_base
2020-10-27 17:23:11 +01:00
2020-11-13 17:09:21 +01:00
class bitcell_1port(bitcell_base.bitcell_base):
2016-11-08 18:57:35 +01:00
"""
A single bit cell (6T, 8T, etc.) This module implements the
single memory cell used in the design. It is a hand-made cell, so
the layout and netlist should be available in the technology
library.
"""
pin_names = [props.bitcell.cell_6t.pin.bl,
props.bitcell.cell_6t.pin.br,
props.bitcell.cell_6t.pin.wl,
props.bitcell.cell_6t.pin.vdd,
props.bitcell.cell_6t.pin.gnd]
2020-10-13 02:27:20 +02:00
type_list = ["OUTPUT", "OUTPUT", "INPUT", "POWER", "GROUND"]
2020-07-31 14:27:19 +02:00
storage_nets = ['Q', 'Q_bar']
def __init__(self, name):
super().__init__(name)
debug.info(2, "Create bitcell")
2016-11-08 18:57:35 +01:00
self.nets_match = self.do_nets_exist(self.storage_nets)
2020-06-23 00:41:59 +02:00
def get_all_wl_names(self):
""" Creates a list of all wordline pin names """
2020-10-13 02:27:20 +02:00
row_pins = [props.bitcell.cell_6t.pin.wl]
return row_pins
def get_all_bitline_names(self):
""" Creates a list of all bitline pin names (both bl and br) """
pin = props.bitcell.cell_6t.pin
column_pins = [pin.bl, pin.br]
return column_pins
def get_all_bl_names(self):
""" Creates a list of all bl pins names """
return [props.bitcell.cell_6t.pin.bl]
def get_all_br_names(self):
""" Creates a list of all br pins names """
return [props.bitcell.cell_6t.pin.br]
2019-07-11 23:47:27 +02:00
def get_bl_name(self, port=0):
"""Get bl name"""
debug.check(port == 0, "One port for bitcell only.")
return props.bitcell.cell_6t.pin.bl
2019-07-11 23:47:27 +02:00
def get_br_name(self, port=0):
"""Get bl name"""
debug.check(port == 0, "One port for bitcell only.")
return props.bitcell.cell_6t.pin.br
2019-07-12 17:42:36 +02:00
def get_wl_name(self, port=0):
"""Get wl name"""
2020-10-13 02:27:20 +02:00
debug.check(port == 0, "One port for bitcell only.")
return props.bitcell.cell_6t.pin.wl
def build_graph(self, graph, inst_name, port_nets):
"""
Adds edges based on inputs/outputs.
Overrides base class function.
"""
self.add_graph_edges(graph, port_nets)