mirror of https://github.com/VLSIDA/OpenRAM.git
proper tiling
This commit is contained in:
parent
4baec81f82
commit
8a4b34dee1
|
|
@ -9,6 +9,7 @@ import sys
|
|||
import os
|
||||
import re
|
||||
from math import sqrt
|
||||
from copy import deepcopy
|
||||
from openram import debug
|
||||
from openram.gdsMill import gdsMill
|
||||
from openram import tech
|
||||
|
|
@ -476,9 +477,12 @@ class layout():
|
|||
# debug.info(4, "instance list: " + ",".join(x.name for x in self.insts))
|
||||
return self.insts[-1]
|
||||
|
||||
def add_existing_inst(self, inst):
|
||||
def add_existing_inst(self, inst, name):
|
||||
inst = deepcopy(inst)
|
||||
self.mods.add(inst.mod)
|
||||
self.inst_names.add(self.name)
|
||||
if name:
|
||||
inst.name = name
|
||||
self.inst_names.add(inst.name)
|
||||
self.insts.append(inst)
|
||||
debug.info(3, "adding existing instance{}".format(self.insts[-1]))
|
||||
return self.insts[-1]
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ class bitcell_array(bitcell_base_array):
|
|||
|
||||
core_block = [[0 for x in range(2)] for y in range(2)]
|
||||
core_block[0][0] = geometry.instance("core_0_0", mod=self.cell)
|
||||
core_block[0][1] = geometry.instance("core_1_0", mod=self.cell, mirror="MX")
|
||||
core_block[1][0] = geometry.instance("core_0_1", mod=self.cell, mirror="MY")
|
||||
core_block[0][1] = geometry.instance("core_1_0", mod=self.cell, mirror="MY")
|
||||
core_block[1][0] = geometry.instance("core_0_1", mod=self.cell, mirror="MX")
|
||||
core_block[1][1] = geometry.instance("core_1_1", mod=self.cell, mirror="XY")
|
||||
num_core_x = self.row_size/len(core_block[0])
|
||||
num_core_y = self.column_size/len(core_block)
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class pattern():
|
|||
for dy in range(len(block)):
|
||||
for dx in range(len(block[0])):
|
||||
inst = block[dy][dx]
|
||||
self.parent_design.cell_inst[x + dx, y + dy] = self.parent_design.add_existing_inst(inst)
|
||||
self.parent_design.cell_inst[x + dx, y + dy] = self.parent_design.add_existing_inst(inst,"bit_r{}_c{}".format(y +dy, x+dx))
|
||||
self.parent_design.connect_inst(self.parent_design.get_bitcell_pins(x+dx, y+dy))
|
||||
|
||||
def place_block(self, block: block, x: int, y: int, place_x: float, place_y: float) -> None:
|
||||
|
|
@ -106,11 +106,21 @@ class pattern():
|
|||
for dy in range(len(block)):
|
||||
for dx in range(len(block[0])):
|
||||
inst = self.parent_design.cell_inst[x + dx, y +dy]
|
||||
inst.place((place_x + x_offset, place_y + y_offset), inst.mirror, inst.rotate)
|
||||
self.place_inst(inst, (place_x + x_offset, place_y + y_offset))
|
||||
#inst.place((place_x + x_offset, place_y + y_offset), inst.mirror, inst.rotate)
|
||||
x_offset += inst.width
|
||||
x_offset = 0
|
||||
y_offset += inst.height
|
||||
|
||||
def place_inst(self, inst, offset) -> None:
|
||||
x = offset[0]
|
||||
y = offset[1]
|
||||
if "X" in inst.mirror:
|
||||
y += inst.height
|
||||
if "Y" in inst.mirror:
|
||||
x += inst.width
|
||||
inst.place((x, y), inst.mirror, inst.rotate)
|
||||
|
||||
def connect_array(self) -> None:
|
||||
x = 0
|
||||
y = 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue