mirror of https://github.com/VLSIDA/OpenRAM.git
remove whitespace
This commit is contained in:
parent
61cfa55d75
commit
5e01bad2ee
|
|
@ -66,7 +66,7 @@ class bitcell_array(bitcell_base_array):
|
||||||
|
|
||||||
self.pattern = pattern(self, "bitcell_array", core_block, num_rows=self.row_size, num_cols=self.column_size)
|
self.pattern = pattern(self, "bitcell_array", core_block, num_rows=self.row_size, num_cols=self.column_size)
|
||||||
self.pattern.connect_array()
|
self.pattern.connect_array()
|
||||||
|
|
||||||
for key in self.cell_inst.keys():
|
for key in self.cell_inst.keys():
|
||||||
if key != (0,0):
|
if key != (0,0):
|
||||||
self.trim_insts.add(self.cell_inst[key].name)
|
self.trim_insts.add(self.cell_inst[key].name)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
from openram.sram_factory import factory
|
from openram.sram_factory import factory
|
||||||
from openram import OPTS
|
from openram import OPTS
|
||||||
from .bitcell_base_array import bitcell_base_array
|
from .bitcell_base_array import bitcell_base_array
|
||||||
from openram.base import geometry
|
from openram.base import geometry
|
||||||
from .pattern import pattern
|
from .pattern import pattern
|
||||||
|
|
||||||
class dummy_array(bitcell_base_array):
|
class dummy_array(bitcell_base_array):
|
||||||
|
|
@ -53,8 +53,8 @@ class dummy_array(bitcell_base_array):
|
||||||
""" Create the module instances used in this design """
|
""" Create the module instances used in this design """
|
||||||
self.cell_inst={}
|
self.cell_inst={}
|
||||||
core_block = [[0 for x in range(1)] for y in range(2)]
|
core_block = [[0 for x in range(1)] for y in range(2)]
|
||||||
core_block[(0+self.mirror) %2][0] = geometry.instance("core_0_0", mod=self.dummy_cell, is_bitcell=True)
|
core_block[0][(0+self.mirror) %2] = geometry.instance("core_0_0", mod=self.dummy_cell, is_bitcell=True)
|
||||||
core_block[(1+self.mirror) %2][0] = geometry.instance("core_1_0", mod=self.dummy_cell, is_bitcell=True, mirror='MX')
|
core_block[0][(1+self.mirror) %2] = geometry.instance("core_1_0", mod=self.dummy_cell, is_bitcell=True, mirror='MX')
|
||||||
|
|
||||||
|
|
||||||
self.pattern = pattern(self, "dummy_array", core_block, num_rows=self.row_size, num_cols=self.column_size)
|
self.pattern = pattern(self, "dummy_array", core_block, num_rows=self.row_size, num_cols=self.column_size)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
# See LICENSE for licensing information.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2016-2023 Regents of the University of California, Santa Cruz
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
from openram import debug
|
from openram import debug
|
||||||
from openram.base.geometry import instance,geometry
|
from openram.base.geometry import instance,geometry
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
@ -7,7 +12,7 @@ from openram.globals import OPTS
|
||||||
from math import ceil
|
from math import ceil
|
||||||
class pattern():
|
class pattern():
|
||||||
"""
|
"""
|
||||||
This class is used to desribe the internals of a bitcell array. It describes
|
This class is used to desribe the internals of a bitcell array. It describes
|
||||||
instance modules, rotation, and ordering
|
instance modules, rotation, and ordering
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
@ -22,18 +27,18 @@ class pattern():
|
||||||
num_cores_y: Optional[int] = 0,
|
num_cores_y: Optional[int] = 0,
|
||||||
cores_per_x_block: int = 1,
|
cores_per_x_block: int = 1,
|
||||||
cores_per_y_block: int = 1,
|
cores_per_y_block: int = 1,
|
||||||
x_block: Optional[block] = None,
|
x_block: Optional[block] = None,
|
||||||
y_block: Optional[block] = None,
|
y_block: Optional[block] = None,
|
||||||
xy_block: Optional[block] = None,
|
xy_block: Optional[block] = None,
|
||||||
initial_x_block:bool = False,
|
initial_x_block:bool = False,
|
||||||
initial_y_block:bool = False,
|
initial_y_block:bool = False,
|
||||||
final_x_block:bool = False,
|
final_x_block:bool = False,
|
||||||
final_y_block:bool = False
|
final_y_block:bool = False
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
a "block" is a 2d list of instances
|
a "block" is a 2d list of instances
|
||||||
core_block defines the main block that is tiled
|
core_block defines the main block that is tiled
|
||||||
num_core defines the number of times the core block is to be tiled
|
num_core defines the number of times the core block is to be tiled
|
||||||
(i.e. bitcells in dimension / bitcells in core_block)
|
(i.e. bitcells in dimension / bitcells in core_block)
|
||||||
x_block defines a block that is inserted to the right of the core_block
|
x_block defines a block that is inserted to the right of the core_block
|
||||||
y_block defines a block that is inserted below the core block
|
y_block defines a block that is inserted below the core block
|
||||||
|
|
@ -43,7 +48,7 @@ class pattern():
|
||||||
self.parent_design = parent_design
|
self.parent_design = parent_design
|
||||||
self.name = name
|
self.name = name
|
||||||
self.core_block = core_block
|
self.core_block = core_block
|
||||||
self.num_rows = num_rows
|
self.num_rows = num_rows
|
||||||
self.num_cols = num_cols
|
self.num_cols = num_cols
|
||||||
self.num_cores_x = num_cores_x
|
self.num_cores_x = num_cores_x
|
||||||
self.num_cores_y = num_cores_y
|
self.num_cores_y = num_cores_y
|
||||||
|
|
@ -62,22 +67,22 @@ class pattern():
|
||||||
self.final_x_block = final_x_block
|
self.final_x_block = final_x_block
|
||||||
self.final_y_block = final_y_block
|
self.final_y_block = final_y_block
|
||||||
if not OPTS.netlist_only:
|
if not OPTS.netlist_only:
|
||||||
self.verify_interblock_dimensions()
|
self.verify_interblock_dimensions()
|
||||||
|
|
||||||
def compute_and_verify_intrablock_dimensions(self, block: block) -> List[int]:
|
def compute_and_verify_intrablock_dimensions(self, block: block) -> List[int]:
|
||||||
for row in block:
|
for row in block:
|
||||||
row_height = row[0].height
|
row_height = row[0].height
|
||||||
for inst in row:
|
for inst in row:
|
||||||
debug.check(row_height == inst.height, "intrablock instances within the same row are different heights")
|
debug.check(row_height == inst.height, "intrablock instances within the same row are different heights")
|
||||||
|
|
||||||
for y in range(len(block[0])):
|
for y in range(len(block[0])):
|
||||||
debug.check(all([row[y].width for row in block]), "intrablock instances within the same column are different widths")
|
debug.check(all([row[y].width for row in block]), "intrablock instances within the same column are different widths")
|
||||||
|
|
||||||
block_width = sum([instance.width for instance in block[0]])
|
block_width = sum([instance.width for instance in block[0]])
|
||||||
block_height = sum([row[0].height for row in block])
|
block_height = sum([row[0].height for row in block])
|
||||||
|
|
||||||
return [block_width, block_height]
|
return [block_width, block_height]
|
||||||
|
|
||||||
def verify_interblock_dimensions(self) -> None:
|
def verify_interblock_dimensions(self) -> None:
|
||||||
"""
|
"""
|
||||||
Ensure the individual blocks are valid and interblock dimensions are valid
|
Ensure the individual blocks are valid and interblock dimensions are valid
|
||||||
|
|
@ -95,14 +100,14 @@ class pattern():
|
||||||
(self.y_block_width, self.y_block_height) = self.compute_and_verify_intrablock_dimensions(self.y_block)
|
(self.y_block_width, self.y_block_height) = self.compute_and_verify_intrablock_dimensions(self.y_block)
|
||||||
if self.xy_block:
|
if self.xy_block:
|
||||||
(self.xy_block_width, self.xy_block_height) = self.compute_and_verify_intrablock_dimensions(self.xy_block)
|
(self.xy_block_width, self.xy_block_height) = self.compute_and_verify_intrablock_dimensions(self.xy_block)
|
||||||
if(self.x_block):
|
if(self.x_block):
|
||||||
debug.check(self.core_block_width * self.cores_per_x_block == self.x_block_width, "core_block does not align with x_block")
|
debug.check(self.core_block_width * self.cores_per_x_block == self.x_block_width, "core_block does not align with x_block")
|
||||||
if(self.y_block):
|
if(self.y_block):
|
||||||
debug.check(self.core_block_height * self.cores_per_y_block == self.y_block_height, "core_block does not aligns with y_block")
|
debug.check(self.core_block_height * self.cores_per_y_block == self.y_block_height, "core_block does not aligns with y_block")
|
||||||
if(self.xy_block):
|
if(self.xy_block):
|
||||||
debug.check(self.xy_block_height == self.x_block_height, "xy_block does not align with x_block")
|
debug.check(self.xy_block_height == self.x_block_height, "xy_block does not align with x_block")
|
||||||
debug.check(self.xy_block_width == self.y_block_width, "xy_block does not align with y_block")
|
debug.check(self.xy_block_width == self.y_block_width, "xy_block does not align with y_block")
|
||||||
|
|
||||||
|
|
||||||
def connect_block(self, block: block, col: int, row: int):
|
def connect_block(self, block: block, col: int, row: int):
|
||||||
for dr in range(len(block)):
|
for dr in range(len(block)):
|
||||||
|
|
@ -141,7 +146,7 @@ class pattern():
|
||||||
x += inst.width
|
x += inst.width
|
||||||
inst.place((x, y), inst.mirror, inst.rotate)
|
inst.place((x, y), inst.mirror, inst.rotate)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def place_block(self, block: block, row: int, col: int, place_x: float, place_y: float, bx, by):
|
def place_block(self, block: block, row: int, col: int, place_x: float, place_y: float, bx, by):
|
||||||
x_offset = 0
|
x_offset = 0
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ class replica_column(bitcell_base_array):
|
||||||
|
|
||||||
def create_instances(self):
|
def create_instances(self):
|
||||||
self.cell_inst = {}
|
self.cell_inst = {}
|
||||||
core_block = [[0 for x in range(1)] for y in range(self.total_size)]
|
core_block = [[0 for x in range(1)] for y in range(self.total_size)]
|
||||||
|
|
||||||
current_row = self.row_start
|
current_row = self.row_start
|
||||||
for row in range(self.total_size):
|
for row in range(self.total_size):
|
||||||
|
|
@ -99,7 +99,7 @@ class replica_column(bitcell_base_array):
|
||||||
core_block[row][0] = geometry.instance("rbc_{}".format(row), mod=self.replica_cell, is_bitcell=True, mirror='MX')
|
core_block[row][0] = geometry.instance("rbc_{}".format(row), mod=self.replica_cell, is_bitcell=True, mirror='MX')
|
||||||
else:
|
else:
|
||||||
core_block[row][0] = geometry.instance("rbc_{}".format(row), mod=self.replica_cell, is_bitcell=True)
|
core_block[row][0] = geometry.instance("rbc_{}".format(row), mod=self.replica_cell, is_bitcell=True)
|
||||||
else:
|
else:
|
||||||
if current_row %2:
|
if current_row %2:
|
||||||
core_block[row][0] = geometry.instance("rbc_{}".format(row), mod=self.dummy_cell, is_bitcell=True, mirror='MX')
|
core_block[row][0] = geometry.instance("rbc_{}".format(row), mod=self.dummy_cell, is_bitcell=True, mirror='MX')
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue