mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-08-29 09:30:38 +02:00
merge custom cell and module properties
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
#
|
||||
from math import log
|
||||
import design
|
||||
from tech import drc, parameter, module_properties
|
||||
from tech import drc, parameter
|
||||
from tech import cell_properties as props
|
||||
import debug
|
||||
import contact
|
||||
from sram_factory import factory
|
||||
@@ -743,7 +744,7 @@ class control_logic(design.design):
|
||||
self.ctrl_dff_inst=self.add_inst(name="ctrl_dffs",
|
||||
mod=self.ctrl_dff_array)
|
||||
inst_pins = self.input_list + self.dff_output_list + ["clk_buf"] + self.supply_list
|
||||
if module_properties.dff_buff_array.add_body_contacts:
|
||||
if props.dff_buff_array.add_body_contacts:
|
||||
inst_pins.append("vpb")
|
||||
inst_pins.append("vnb")
|
||||
self.connect_inst(inst_pins)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
# See LICENSE for licensing information.
|
||||
#
|
||||
# Copyright (c) 2016-2020 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.
|
||||
#
|
||||
|
||||
class _dff:
|
||||
def __init__(self, use_custom_ports, custom_port_list, custom_type_list, clk_pin):
|
||||
self.use_custom_ports = use_custom_ports
|
||||
self.custom_port_list = custom_port_list
|
||||
self.custom_type_list = custom_type_list
|
||||
self.clk_pin = clk_pin
|
||||
|
||||
class _dff_buff:
|
||||
def __init__(self, use_custom_ports, custom_buff_ports, add_body_contacts):
|
||||
self.use_custom_ports = use_custom_ports
|
||||
self.buf_ports = custom_buff_ports
|
||||
self.add_body_contacts = add_body_contacts
|
||||
|
||||
class _dff_buff_array:
|
||||
def __init__(self, use_custom_ports, add_body_contacts):
|
||||
self.use_custom_ports = use_custom_ports
|
||||
self.add_body_contacts = add_body_contacts
|
||||
|
||||
class module_properties():
|
||||
"""
|
||||
TODO
|
||||
"""
|
||||
def __init__(self):
|
||||
self.names = {}
|
||||
|
||||
self._dff = _dff(use_custom_ports = False,
|
||||
custom_port_list = ["D", "Q", "clk", "vdd", "gnd"],
|
||||
custom_type_list = ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"],
|
||||
clk_pin= "clk")
|
||||
|
||||
self._dff_buff = _dff_buff(use_custom_ports = False,
|
||||
custom_buff_ports = ["D", "qint", "clk", "vdd", "gnd"],
|
||||
add_body_contacts = False)
|
||||
|
||||
self._dff_buff_array = _dff_buff_array(use_custom_ports = False,
|
||||
add_body_contacts = False)
|
||||
|
||||
@property
|
||||
def dff(self):
|
||||
return self._dff
|
||||
|
||||
@property
|
||||
def dff_buff(self):
|
||||
return self._dff_buff
|
||||
|
||||
@property
|
||||
def dff_buff_array(self):
|
||||
return self._dff_buff_array
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
import design
|
||||
from tech import GDS, layer, spice, parameter
|
||||
from tech import module_properties
|
||||
from tech import cell_properties as props
|
||||
import utils
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ class dff(design.design):
|
||||
"""
|
||||
Memory address flip-flop
|
||||
"""
|
||||
if not module_properties.dff.use_custom_ports:
|
||||
if not props.dff.use_custom_ports:
|
||||
pin_names = ["D", "Q", "clk", "vdd", "gnd"]
|
||||
type_list = ["INPUT", "OUTPUT", "INPUT", "POWER", "GROUND"]
|
||||
clk_pin = "clk"
|
||||
else:
|
||||
pin_names = module_properties.dff.custom_port_list
|
||||
type_list = module_properties.dff.custom_type_list
|
||||
clk_pin = module_properties.dff.clk_pin
|
||||
pin_names = props.dff.custom_port_list
|
||||
type_list = props.dff.custom_type_list
|
||||
clk_pin = props.dff.clk_pin
|
||||
|
||||
(width, height) = utils.get_libcell_size("dff",
|
||||
GDS["unit"],
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#
|
||||
import debug
|
||||
import design
|
||||
from tech import drc,parameter,module_properties
|
||||
from tech import drc,parameter
|
||||
from tech import cell_properties as props
|
||||
from math import log
|
||||
from vector import vector
|
||||
from globals import OPTS
|
||||
@@ -82,14 +83,14 @@ class dff_buf(design.design):
|
||||
self.add_pin("vdd", "POWER")
|
||||
self.add_pin("gnd", "GROUND")
|
||||
|
||||
if module_properties.dff_buff.add_body_contacts:
|
||||
if props.dff_buff.add_body_contacts:
|
||||
self.add_pin("vpb", "INPUT")
|
||||
self.add_pin("vpn", "INPUT")
|
||||
|
||||
def create_instances(self):
|
||||
self.dff_inst=self.add_inst(name="dff_buf_dff",
|
||||
mod=self.dff)
|
||||
self.connect_inst(module_properties.dff_buff.buf_ports)
|
||||
self.connect_inst(props.dff_buff.buf_ports)
|
||||
#self.connect_inst(["D", "qint", "clk", "vdd", "gnd"])
|
||||
|
||||
self.inv1_inst=self.add_inst(name="dff_buf_inv1",
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#
|
||||
import debug
|
||||
import design
|
||||
from tech import drc, module_properties
|
||||
from tech import drc
|
||||
from tech import cell_properties as props
|
||||
from math import log
|
||||
from vector import vector
|
||||
from globals import OPTS
|
||||
@@ -64,7 +65,7 @@ class dff_buf_array(design.design):
|
||||
self.add_pin("vdd", "POWER")
|
||||
self.add_pin("gnd", "GROUND")
|
||||
|
||||
if module_properties.dff_buff_array.add_body_contacts:
|
||||
if props.dff_buff_array.add_body_contacts:
|
||||
self.add_pin("vpb", "INPUT")
|
||||
self.add_pin("vnb", "INPUT")
|
||||
|
||||
@@ -87,7 +88,7 @@ class dff_buf_array(design.design):
|
||||
"clk",
|
||||
"vdd",
|
||||
"gnd"]
|
||||
if module_properties.dff_buff_array.add_body_contacts:
|
||||
if props.dff_buff_array.add_body_contacts:
|
||||
inst_ports.append("vpb")
|
||||
inst_ports.append("vnb")
|
||||
self.connect_inst(inst_ports)
|
||||
|
||||
Reference in New Issue
Block a user