2019-04-26 21:21:50 +02:00
|
|
|
# See LICENSE for licensing information.
|
|
|
|
|
#
|
2019-05-06 15:50:15 +02:00
|
|
|
#Copyright (c) 2016-2019 Regents of the University of California and The Board
|
2019-04-26 21:21:50 +02:00
|
|
|
#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
|
|
|
from tech import drc
|
|
|
|
|
import debug
|
|
|
|
|
import design
|
|
|
|
|
from vector import vector
|
|
|
|
|
from hierarchical_predecode import hierarchical_predecode
|
2018-08-28 01:42:48 +02:00
|
|
|
from globals import OPTS
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
class hierarchical_predecode2x4(hierarchical_predecode):
|
|
|
|
|
"""
|
|
|
|
|
Pre 2x4 decoder used in hierarchical_decoder.
|
|
|
|
|
"""
|
2019-01-17 01:15:38 +01:00
|
|
|
def __init__(self, name, height=None):
|
|
|
|
|
hierarchical_predecode.__init__(self, name, 2, height)
|
2016-11-08 18:57:35 +01:00
|
|
|
|
2018-08-27 19:42:40 +02:00
|
|
|
self.create_netlist()
|
2018-08-28 01:42:48 +02:00
|
|
|
if not OPTS.netlist_only:
|
|
|
|
|
self.create_layout()
|
2018-08-27 19:42:40 +02:00
|
|
|
|
|
|
|
|
def create_netlist(self):
|
2018-08-28 01:42:48 +02:00
|
|
|
self.add_pins()
|
2018-11-14 01:05:22 +01:00
|
|
|
self.add_modules()
|
2018-08-27 19:42:40 +02:00
|
|
|
self.create_input_inverters()
|
|
|
|
|
self.create_output_inverters()
|
2018-10-11 18:53:08 +02:00
|
|
|
connections =[["inbar_0", "inbar_1", "Z_0", "vdd", "gnd"],
|
|
|
|
|
["in_0", "inbar_1", "Z_1", "vdd", "gnd"],
|
|
|
|
|
["inbar_0", "in_1", "Z_2", "vdd", "gnd"],
|
|
|
|
|
["in_0", "in_1", "Z_3", "vdd", "gnd"]]
|
2018-08-27 19:42:40 +02:00
|
|
|
self.create_nand_array(connections)
|
2016-11-22 21:23:55 +01:00
|
|
|
|
2016-11-08 18:57:35 +01:00
|
|
|
def create_layout(self):
|
2017-08-24 00:02:15 +02:00
|
|
|
""" The general organization is from left to right:
|
|
|
|
|
1) a set of M2 rails for input signals
|
|
|
|
|
2) a set of inverters to invert input signals
|
|
|
|
|
3) a set of M2 rails for the vdd, gnd, inverted inputs, inputs
|
|
|
|
|
4) a set of NAND gates for inversion
|
|
|
|
|
"""
|
2018-08-28 01:42:48 +02:00
|
|
|
self.setup_layout_constraints()
|
2018-08-27 19:42:40 +02:00
|
|
|
self.route_rails()
|
|
|
|
|
self.place_input_inverters()
|
|
|
|
|
self.place_output_inverters()
|
|
|
|
|
self.place_nand_array()
|
2017-08-24 00:02:15 +02:00
|
|
|
self.route()
|
2018-08-27 19:42:40 +02:00
|
|
|
self.DRC_LVS()
|
2016-11-22 21:23:55 +01:00
|
|
|
|
|
|
|
|
def get_nand_input_line_combination(self):
|
2017-08-24 00:02:15 +02:00
|
|
|
""" These are the decoder connections of the NAND gates to the A,B pins """
|
2018-10-11 18:53:08 +02:00
|
|
|
combination = [["Abar_0", "Abar_1"],
|
|
|
|
|
["A_0", "Abar_1"],
|
|
|
|
|
["Abar_0", "A_1"],
|
|
|
|
|
["A_0", "A_1"]]
|
2016-11-22 21:23:55 +01:00
|
|
|
return combination
|
|
|
|
|
|
2017-05-30 21:50:07 +02:00
|
|
|
|
2019-03-04 09:42:18 +01:00
|
|
|
def analytical_delay(self, corner, slew, load = 0.0 ):
|
2017-08-24 00:02:15 +02:00
|
|
|
# in -> inbar
|
2019-03-04 09:42:18 +01:00
|
|
|
a_t_b_delay = self.inv.analytical_delay(corner, slew=slew, load=self.nand.input_load())
|
2017-05-30 21:50:07 +02:00
|
|
|
|
2017-08-24 00:02:15 +02:00
|
|
|
# inbar -> z
|
2019-03-04 09:42:18 +01:00
|
|
|
b_t_z_delay = self.nand.analytical_delay(corner, slew=a_t_b_delay.slew, load=self.inv.input_load())
|
2017-05-30 21:50:07 +02:00
|
|
|
|
|
|
|
|
# Z -> out
|
2019-03-04 09:42:18 +01:00
|
|
|
a_t_out_delay = self.inv.analytical_delay(corner, slew=b_t_z_delay.slew, load=load)
|
2017-11-09 20:13:44 +01:00
|
|
|
|
|
|
|
|
return a_t_b_delay + b_t_z_delay + a_t_out_delay
|
2017-05-30 21:50:07 +02:00
|
|
|
|
2018-02-02 21:05:11 +01:00
|
|
|
|
2017-05-30 21:50:07 +02:00
|
|
|
def input_load(self):
|
2017-08-24 00:02:15 +02:00
|
|
|
return self.nand.input_load()
|