mirror of https://github.com/VLSIDA/OpenRAM.git
Separate netlist/layout for flop and precharge array.
This commit is contained in:
parent
138a70fc23
commit
87f539f3a8
|
|
@ -30,14 +30,18 @@ class ms_flop_array(design.design):
|
||||||
self.height = self.ms.height
|
self.height = self.ms.height
|
||||||
self.words_per_row = int(self.columns / self.word_size)
|
self.words_per_row = int(self.columns / self.word_size)
|
||||||
|
|
||||||
|
self.create_netlist()
|
||||||
self.create_layout()
|
self.create_layout()
|
||||||
|
|
||||||
def create_layout(self):
|
def create_netlist(self):
|
||||||
self.add_pins()
|
self.add_pins()
|
||||||
self.create_ms_flop_array()
|
self.create_ms_flop_array()
|
||||||
|
|
||||||
|
def create_layout(self):
|
||||||
|
self.place_ms_flop_array()
|
||||||
self.add_layout_pins()
|
self.add_layout_pins()
|
||||||
self.DRC_LVS()
|
self.DRC_LVS()
|
||||||
|
|
||||||
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("din[{0}]".format(i))
|
self.add_pin("din[{0}]".format(i))
|
||||||
|
|
@ -52,25 +56,28 @@ class ms_flop_array(design.design):
|
||||||
self.ms_inst={}
|
self.ms_inst={}
|
||||||
for i in range(0,self.columns,self.words_per_row):
|
for i in range(0,self.columns,self.words_per_row):
|
||||||
name = "Xdff{0}".format(i)
|
name = "Xdff{0}".format(i)
|
||||||
if (i % 2 == 0 or self.words_per_row>1):
|
|
||||||
base = vector(i*self.ms.width,0)
|
|
||||||
mirror = "R0"
|
|
||||||
else:
|
|
||||||
base = vector((i+1)*self.ms.width,0)
|
|
||||||
mirror = "MY"
|
|
||||||
|
|
||||||
index = int(i/self.words_per_row)
|
index = int(i/self.words_per_row)
|
||||||
|
|
||||||
self.ms_inst[index]=self.add_inst(name=name,
|
self.ms_inst[index]=self.add_inst(name=name,
|
||||||
mod=self.ms,
|
mod=self.ms)
|
||||||
offset=base,
|
|
||||||
mirror=mirror)
|
|
||||||
self.connect_inst(["din[{0}]".format(index),
|
self.connect_inst(["din[{0}]".format(index),
|
||||||
"dout[{0}]".format(index),
|
"dout[{0}]".format(index),
|
||||||
"dout_bar[{0}]".format(index),
|
"dout_bar[{0}]".format(index),
|
||||||
"clk",
|
"clk",
|
||||||
"vdd", "gnd"])
|
"vdd", "gnd"])
|
||||||
|
|
||||||
|
def place_ms_flop_array(self):
|
||||||
|
for i in range(0,self.columns,self.words_per_row):
|
||||||
|
name = "Xdff{0}".format(i)
|
||||||
|
if (i % 2 == 0 or self.words_per_row>1):
|
||||||
|
base = vector(i*self.ms.width,0)
|
||||||
|
mirror = "R0"
|
||||||
|
else:
|
||||||
|
base = vector((i+1)*self.ms.width,0)
|
||||||
|
mirror = "MY"
|
||||||
|
self.place_inst(name=name,
|
||||||
|
offset=base,
|
||||||
|
mirror=mirror)
|
||||||
|
|
||||||
def add_layout_pins(self):
|
def add_layout_pins(self):
|
||||||
|
|
||||||
for i in range(self.word_size):
|
for i in range(self.word_size):
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,8 @@ class precharge_array(design.design):
|
||||||
self.width = self.columns * self.pc_cell.width
|
self.width = self.columns * self.pc_cell.width
|
||||||
self.height = self.pc_cell.height
|
self.height = self.pc_cell.height
|
||||||
|
|
||||||
self.add_pins()
|
self.create_netlist()
|
||||||
self.create_layout()
|
self.create_layout()
|
||||||
self.DRC_LVS()
|
|
||||||
|
|
||||||
def add_pins(self):
|
def add_pins(self):
|
||||||
"""Adds pins for spice file"""
|
"""Adds pins for spice file"""
|
||||||
|
|
@ -39,9 +38,14 @@ class precharge_array(design.design):
|
||||||
self.add_pin("en")
|
self.add_pin("en")
|
||||||
self.add_pin("vdd")
|
self.add_pin("vdd")
|
||||||
|
|
||||||
|
def create_netlist(self):
|
||||||
|
self.add_pins()
|
||||||
|
self.create_insts()
|
||||||
|
|
||||||
def create_layout(self):
|
def create_layout(self):
|
||||||
self.add_insts()
|
self.place_insts()
|
||||||
self.add_layout_pins()
|
self.add_layout_pins()
|
||||||
|
self.DRC_LVS()
|
||||||
|
|
||||||
|
|
||||||
def add_layout_pins(self):
|
def add_layout_pins(self):
|
||||||
|
|
@ -55,20 +59,8 @@ class precharge_array(design.design):
|
||||||
for inst in self.local_insts:
|
for inst in self.local_insts:
|
||||||
self.copy_layout_pin(inst, "vdd")
|
self.copy_layout_pin(inst, "vdd")
|
||||||
|
|
||||||
|
for i in range(len(self.local_insts)):
|
||||||
|
inst = self.local_insts[i]
|
||||||
def add_insts(self):
|
|
||||||
"""Creates a precharge array by horizontally tiling the precharge cell"""
|
|
||||||
self.local_insts = []
|
|
||||||
for i in range(self.columns):
|
|
||||||
name = "pre_column_{0}".format(i)
|
|
||||||
offset = vector(self.pc_cell.width * i, 0)
|
|
||||||
inst = self.add_inst(name=name,
|
|
||||||
mod=self.pc_cell,
|
|
||||||
offset=offset)
|
|
||||||
self.local_insts.append(inst)
|
|
||||||
|
|
||||||
self.connect_inst(["bl[{0}]".format(i), "br[{0}]".format(i), "en", "vdd"])
|
|
||||||
bl_pin = inst.get_pin("bl")
|
bl_pin = inst.get_pin("bl")
|
||||||
self.add_layout_pin(text="bl[{0}]".format(i),
|
self.add_layout_pin(text="bl[{0}]".format(i),
|
||||||
layer="metal2",
|
layer="metal2",
|
||||||
|
|
@ -81,4 +73,25 @@ class precharge_array(design.design):
|
||||||
offset=br_pin.ll(),
|
offset=br_pin.ll(),
|
||||||
width=drc["minwidth_metal2"],
|
width=drc["minwidth_metal2"],
|
||||||
height=bl_pin.height())
|
height=bl_pin.height())
|
||||||
|
|
||||||
|
|
||||||
|
def create_insts(self):
|
||||||
|
"""Creates a precharge array by horizontally tiling the precharge cell"""
|
||||||
|
self.local_insts = []
|
||||||
|
for i in range(self.columns):
|
||||||
|
name = "pre_column_{0}".format(i)
|
||||||
|
offset = vector(self.pc_cell.width * i, 0)
|
||||||
|
inst = self.add_inst(name=name,
|
||||||
|
mod=self.pc_cell,
|
||||||
|
offset=offset)
|
||||||
|
self.local_insts.append(inst)
|
||||||
|
self.connect_inst(["bl[{0}]".format(i), "br[{0}]".format(i), "en", "vdd"])
|
||||||
|
|
||||||
|
|
||||||
|
def place_insts(self):
|
||||||
|
""" Places precharge array by horizontally tiling the precharge cell"""
|
||||||
|
for i in range(self.columns):
|
||||||
|
name = "pre_column_{0}".format(i)
|
||||||
|
offset = vector(self.pc_cell.width * i, 0)
|
||||||
|
inst = self.place_inst(name=name,
|
||||||
|
offset=offset)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue