Add direction to pins of all modules

This commit is contained in:
Matt Guthaus 2019-08-06 14:14:09 -07:00
parent c3f38a5cac
commit ad35f8745e
22 changed files with 109 additions and 104 deletions

View File

@ -77,12 +77,12 @@ class bitcell_array(design.design):
column_list = self.cell.get_all_bitline_names() column_list = self.cell.get_all_bitline_names()
for col in range(self.column_size): for col in range(self.column_size):
for cell_column in column_list: for cell_column in column_list:
self.add_pin(cell_column+"_{0}".format(col)) self.add_pin(cell_column+"_{0}".format(col), "INOUT")
for row in range(self.row_size): for row in range(self.row_size):
for cell_row in row_list: for cell_row in row_list:
self.add_pin(cell_row+"_{0}".format(row)) self.add_pin(cell_row+"_{0}".format(row), "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
""" Add the modules used in this design """ """ Add the modules used in this design """

View File

@ -57,10 +57,10 @@ class delay_chain(design.design):
def add_pins(self): def add_pins(self):
""" Add the pins of the delay chain""" """ Add the pins of the delay chain"""
self.add_pin("in") self.add_pin("in", "INPUT")
self.add_pin("out") self.add_pin("out", "OUTPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
self.inv = factory.create(module_type="pinv", route_output=False) self.inv = factory.create(module_type="pinv", route_output=False)

View File

@ -54,13 +54,13 @@ class dff_array(design.design):
def add_pins(self): def add_pins(self):
for row in range(self.rows): for row in range(self.rows):
for col in range(self.columns): for col in range(self.columns):
self.add_pin(self.get_din_name(row,col)) self.add_pin(self.get_din_name(row,col), "INPUT")
for row in range(self.rows): for row in range(self.rows):
for col in range(self.columns): for col in range(self.columns):
self.add_pin(self.get_dout_name(row,col)) self.add_pin(self.get_dout_name(row,col), "OUTPUT")
self.add_pin("clk") self.add_pin("clk", "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def create_dff_array(self): def create_dff_array(self):
self.dff_insts={} self.dff_insts={}

View File

@ -75,12 +75,12 @@ class dff_buf(design.design):
def add_pins(self): def add_pins(self):
self.add_pin("D") self.add_pin("D", "INPUT")
self.add_pin("Q") self.add_pin("Q", "OUTPUT")
self.add_pin("Qb") self.add_pin("Qb", "OUTPUT")
self.add_pin("clk") self.add_pin("clk", "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def create_instances(self): def create_instances(self):
self.dff_inst=self.add_inst(name="dff_buf_dff", self.dff_inst=self.add_inst(name="dff_buf_dff",

View File

@ -55,14 +55,14 @@ class dff_buf_array(design.design):
def add_pins(self): def add_pins(self):
for row in range(self.rows): for row in range(self.rows):
for col in range(self.columns): for col in range(self.columns):
self.add_pin(self.get_din_name(row,col)) self.add_pin(self.get_din_name(row,col), "INPUT")
for row in range(self.rows): for row in range(self.rows):
for col in range(self.columns): for col in range(self.columns):
self.add_pin(self.get_dout_name(row,col)) self.add_pin(self.get_dout_name(row,col), "OUTPUT")
self.add_pin(self.get_dout_bar_name(row,col)) self.add_pin(self.get_dout_bar_name(row,col), "OUTPUT")
self.add_pin("clk") self.add_pin("clk", "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
self.dff = factory.create(module_type="dff_buf", self.dff = factory.create(module_type="dff_buf",

View File

@ -59,14 +59,14 @@ class dff_inv_array(design.design):
def add_pins(self): def add_pins(self):
for row in range(self.rows): for row in range(self.rows):
for col in range(self.columns): for col in range(self.columns):
self.add_pin(self.get_din_name(row,col)) self.add_pin(self.get_din_name(row,col), "INPUT")
for row in range(self.rows): for row in range(self.rows):
for col in range(self.columns): for col in range(self.columns):
self.add_pin(self.get_dout_name(row,col)) self.add_pin(self.get_dout_name(row,col), "OUTPUT")
self.add_pin(self.get_dout_bar_name(row,col)) self.add_pin(self.get_dout_bar_name(row,col), "OUTPUT")
self.add_pin("clk") self.add_pin("clk", "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def create_dff_array(self): def create_dff_array(self):
self.dff_insts={} self.dff_insts={}

View File

@ -70,12 +70,12 @@ class dummy_array(design.design):
column_list = self.cell.get_all_bitline_names() column_list = self.cell.get_all_bitline_names()
for col in range(self.column_size): for col in range(self.column_size):
for cell_column in column_list: for cell_column in column_list:
self.add_pin(cell_column+"_{0}".format(col)) self.add_pin(cell_column+"_{0}".format(col), "INOUT")
for row in range(self.row_size): for row in range(self.row_size):
for cell_row in row_list: for cell_row in row_list:
self.add_pin(cell_row+"_{0}".format(row)) self.add_pin(cell_row+"_{0}".format(row), "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
""" Add the modules used in this design """ """ Add the modules used in this design """

View File

@ -231,12 +231,12 @@ class hierarchical_decoder(design.design):
""" Add the module pins """ """ Add the module pins """
for i in range(self.num_inputs): for i in range(self.num_inputs):
self.add_pin("addr_{0}".format(i)) self.add_pin("addr_{0}".format(i), "INPUT")
for j in range(self.rows): for j in range(self.rows):
self.add_pin("decode_{0}".format(j)) self.add_pin("decode_{0}".format(j), "OUTPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def create_pre_decoder(self): def create_pre_decoder(self):

View File

@ -26,11 +26,11 @@ class hierarchical_predecode(design.design):
def add_pins(self): def add_pins(self):
for k in range(self.number_of_inputs): for k in range(self.number_of_inputs):
self.add_pin("in_{0}".format(k)) self.add_pin("in_{0}".format(k), "INPUT")
for i in range(self.number_of_outputs): for i in range(self.number_of_outputs):
self.add_pin("out_{0}".format(i)) self.add_pin("out_{0}".format(i), "OUTPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
""" Add the INV and NAND gate modules """ """ Add the INV and NAND gate modules """

View File

@ -35,10 +35,11 @@ class precharge_array(design.design):
def add_pins(self): def add_pins(self):
"""Adds pins for spice file""" """Adds pins for spice file"""
for i in range(self.columns): for i in range(self.columns):
self.add_pin("bl_{0}".format(i)) # These are outputs from the precharge only
self.add_pin("br_{0}".format(i)) self.add_pin("bl_{0}".format(i), "OUTPUT")
self.add_pin("en_bar") self.add_pin("br_{0}".format(i), "OUTPUT")
self.add_pin("vdd") self.add_pin("en_bar", "INPUT")
self.add_pin("vdd", "POWER")
def create_netlist(self): def create_netlist(self):
self.add_modules() self.add_modules()

View File

@ -55,14 +55,15 @@ class replica_column(design.design):
def add_pins(self): def add_pins(self):
for bl_name in self.cell.get_all_bitline_names(): for bl_name in self.cell.get_all_bitline_names():
self.add_pin("{0}_{1}".format(bl_name,0)) # In the replica column, these are only outputs!
self.add_pin("{0}_{1}".format(bl_name,0), "OUTPUT")
for row in range(self.total_size): for row in range(self.total_size):
for wl_name in self.cell.get_all_wl_names(): for wl_name in self.cell.get_all_wl_names():
self.add_pin("{0}_{1}".format(wl_name,row)) self.add_pin("{0}_{1}".format(wl_name,row), "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
self.replica_cell = factory.create(module_type="replica_bitcell") self.replica_cell = factory.create(module_type="replica_bitcell")

View File

@ -55,12 +55,12 @@ class sense_amp_array(design.design):
def add_pins(self): def add_pins(self):
for i in range(0,self.word_size): for i in range(0,self.word_size):
self.add_pin("data_{0}".format(i)) self.add_pin("data_{0}".format(i), "OUTPUT")
self.add_pin("bl_{0}".format(i)) self.add_pin("bl_{0}".format(i), "INPUT")
self.add_pin("br_{0}".format(i)) self.add_pin("br_{0}".format(i), "INPUT")
self.add_pin("en") self.add_pin("en", "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
self.amp = factory.create(module_type="sense_amp") self.amp = factory.create(module_type="sense_amp")

View File

@ -50,13 +50,13 @@ class wordline_driver(design.design):
def add_pins(self): def add_pins(self):
# inputs to wordline_driver. # inputs to wordline_driver.
for i in range(self.rows): for i in range(self.rows):
self.add_pin("in_{0}".format(i)) self.add_pin("in_{0}".format(i), "INPUT")
# Outputs from wordline_driver. # Outputs from wordline_driver.
for i in range(self.rows): for i in range(self.rows):
self.add_pin("wl_{0}".format(i)) self.add_pin("wl_{0}".format(i), "OUTPUT")
self.add_pin("en") self.add_pin("en", "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):

View File

@ -59,17 +59,17 @@ class write_driver_array(design.design):
def add_pins(self): def add_pins(self):
for i in range(self.word_size): for i in range(self.word_size):
self.add_pin("data_{0}".format(i)) self.add_pin("data_{0}".format(i), "INPUT")
for i in range(self.word_size): for i in range(self.word_size):
self.add_pin("bl_{0}".format(i)) self.add_pin("bl_{0}".format(i), "OUTPUT")
self.add_pin("br_{0}".format(i)) self.add_pin("br_{0}".format(i), "OUTPUT")
if self.write_size != None: if self.write_size != None:
for i in range(self.num_wmasks): for i in range(self.num_wmasks):
self.add_pin("en_{}".format(i)) self.add_pin("en_{}".format(i), "INPUT")
else: else:
self.add_pin("en") self.add_pin("en", "INPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
self.driver = factory.create(module_type="write_driver") self.driver = factory.create(module_type="write_driver")

View File

@ -47,11 +47,11 @@ class pand2(pgate.pgate):
self.DRC_LVS() self.DRC_LVS()
def add_pins(self): def add_pins(self):
self.add_pin("A") self.add_pin("A", "INPUT")
self.add_pin("B") self.add_pin("B", "INPUT")
self.add_pin("Z") self.add_pin("Z", "OUTPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def create_insts(self): def create_insts(self):
self.nand_inst=self.add_inst(name="pand2_nand", self.nand_inst=self.add_inst(name="pand2_nand",

View File

@ -42,10 +42,10 @@ class pbuf(pgate.pgate):
self.add_layout_pins() self.add_layout_pins()
def add_pins(self): def add_pins(self):
self.add_pin("A") self.add_pin("A", "INPUT")
self.add_pin("Z") self.add_pin("Z", "OUTPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def create_modules(self): def create_modules(self):
# Shield the cap, but have at least a stage effort of 4 # Shield the cap, but have at least a stage effort of 4

View File

@ -53,15 +53,15 @@ class pdriver(pgate.pgate):
elif not self.neg_polarity and (self.num_stages%2): elif not self.neg_polarity and (self.num_stages%2):
self.num_stages += 1 self.num_stages += 1
self.size_list = [] self.size_list = []
# compute sizes backwards from the fanout # compute sizes backwards from the fanout
fanout_prev = self.fanout fanout_prev = self.fanout
for x in range(self.num_stages): for x in range(self.num_stages):
fanout_prev = max(round(fanout_prev/self.stage_effort),1) fanout_prev = max(round(fanout_prev/self.stage_effort),1)
self.size_list.append(fanout_prev) self.size_list.append(fanout_prev)
# reverse the sizes to be from input to output # reverse the sizes to be from input to output
self.size_list.reverse() self.size_list.reverse()
def create_netlist(self): def create_netlist(self):
@ -81,10 +81,10 @@ class pdriver(pgate.pgate):
def add_pins(self): def add_pins(self):
self.add_pin("A") self.add_pin("A", "INPUT")
self.add_pin("Z") self.add_pin("Z", "OUTPUT")
self.add_pin("vdd") self.add_pin("vdd", "POWER")
self.add_pin("gnd") self.add_pin("gnd", "GROUND")
def add_modules(self): def add_modules(self):
self.inv_list = [] self.inv_list = []
@ -178,7 +178,7 @@ class pdriver(pgate.pgate):
return self.inv_list[0].input_load() return self.inv_list[0].input_load()
def analytical_delay(self, corner, slew, load=0.0): def analytical_delay(self, corner, slew, load=0.0):
"""Calculate the analytical delay of INV1 -> ... -> INVn""" """ Calculate the analytical delay of INV1 -> ... -> INVn """
cout_list = [] cout_list = []
for prev_inv,inv in zip(self.inv_list, self.inv_list[1:]): for prev_inv,inv in zip(self.inv_list, self.inv_list[1:]):
@ -198,9 +198,12 @@ class pdriver(pgate.pgate):
return delay return delay
def get_sizes(self):
""" Return the relative sizes of the buffers """
return self.size_list
def get_stage_efforts(self, external_cout, inp_is_rise=False): def get_stage_efforts(self, external_cout, inp_is_rise=False):
"""Get the stage efforts of the A -> Z path""" """ Get the stage efforts of the A -> Z path """
cout_list = [] cout_list = []
for prev_inv,inv in zip(self.inv_list, self.inv_list[1:]): for prev_inv,inv in zip(self.inv_list, self.inv_list[1:]):
cout_list.append(inv.get_cin()) cout_list.append(inv.get_cin())
@ -217,5 +220,5 @@ class pdriver(pgate.pgate):
return stage_effort_list return stage_effort_list
def get_cin(self): def get_cin(self):
"""Returns the relative capacitance of the input""" """ Returns the relative capacitance of the input """
return self.inv_list[0].get_cin() return self.inv_list[0].get_cin()

View File

@ -60,7 +60,7 @@ class pinv(pgate.pgate):
def add_pins(self): def add_pins(self):
""" Adds pins for spice netlist """ """ Adds pins for spice netlist """
pin_list = ["A", "Z", "vdd", "gnd"] pin_list = ["A", "Z", "vdd", "gnd"]
dir_list = ['INPUT', 'OUTPUT', 'POWER', 'GROUND'] dir_list = ["INPUT", "OUTPUT", "POWER", "GROUND"]
self.add_pin_list(pin_list, dir_list) self.add_pin_list(pin_list, dir_list)

View File

@ -61,7 +61,7 @@ class pnand2(pgate.pgate):
def add_pins(self): def add_pins(self):
""" Adds pins for spice netlist """ """ Adds pins for spice netlist """
pin_list = ["A", "B", "Z", "vdd", "gnd"] pin_list = ["A", "B", "Z", "vdd", "gnd"]
dir_list = ['INPUT', 'INPUT', 'OUTPUT', 'POWER', 'GROUND'] dir_list = ["INPUT", "INPUT", "OUTPUT", "POWER", "GROUND"]
self.add_pin_list(pin_list, dir_list) self.add_pin_list(pin_list, dir_list)

View File

@ -44,7 +44,7 @@ class pnand3(pgate.pgate):
def add_pins(self): def add_pins(self):
""" Adds pins for spice netlist """ """ Adds pins for spice netlist """
pin_list = ["A", "B", "C", "Z", "vdd", "gnd"] pin_list = ["A", "B", "C", "Z", "vdd", "gnd"]
dir_list = ['INPUT', 'INPUT', 'INPUT', 'OUTPUT', 'POWER', 'GROUND'] dir_list = ["INPUT", "INPUT", "INPUT", "OUTPUT", "POWER", "GROUND"]
self.add_pin_list(pin_list, dir_list) self.add_pin_list(pin_list, dir_list)
def create_netlist(self): def create_netlist(self):

View File

@ -41,7 +41,7 @@ class pnor2(pgate.pgate):
def add_pins(self): def add_pins(self):
""" Adds pins for spice netlist """ """ Adds pins for spice netlist """
pin_list = ["A", "B", "Z", "vdd", "gnd"] pin_list = ["A", "B", "Z", "vdd", "gnd"]
dir_list = ['INPUT', 'INPUT', 'OUTPUT', 'INOUT', 'INOUT'] dir_list = ["INPUT", "INPUT", "OUTPUT", "INOUT", "INOUT"]
self.add_pin_list(pin_list, dir_list) self.add_pin_list(pin_list, dir_list)
def create_netlist(self): def create_netlist(self):

View File

@ -53,7 +53,7 @@ class precharge(design.design):
self.connect_to_bitlines() self.connect_to_bitlines()
def add_pins(self): def add_pins(self):
self.add_pin_list(["bl", "br", "en_bar", "vdd"]) self.add_pin_list(["bl", "br", "en_bar", "vdd"], ["OUTPUT", "OUTPUT", "INPUT", "POWER"])
def add_ptx(self): def add_ptx(self):
""" """