Skip to content

Commit

Permalink
Add LEF output for ROM
Browse files Browse the repository at this point in the history
  • Loading branch information
mole99 committed Dec 21, 2023
1 parent 05884cf commit 8032fa7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion compiler/modules/rom_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
from openram.base import vector
from openram.base import design
from openram.base import rom_verilog
from openram.base import lef
from openram import OPTS, print_time
from openram.sram_factory import factory
from openram.tech import spice
from openram.tech import drc, layer, parameter


class rom_bank(design,rom_verilog):
class rom_bank(design, rom_verilog, lef):

"""
Rom data bank with row and column decoder + control logic
Expand All @@ -27,6 +28,7 @@ class rom_bank(design,rom_verilog):

def __init__(self, name, rom_config):
super().__init__(name=name)
lef.__init__(self, ["m1", "m2", "m3", "m4"])
self.rom_config = rom_config
rom_config.set_local_config(self)

Expand Down
10 changes: 10 additions & 0 deletions compiler/rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def __init__(self, rom_config=None, name=None):
def sp_write(self, name, lvs=False, trim=False):
self.r.sp_write(name, lvs, trim)

def lef_write(self, name):
self.r.lef_write(name)

def gds_write(self, name):
self.r.gds_write(name)

Expand Down Expand Up @@ -106,6 +109,13 @@ def save(self):
output_path=OPTS.output_path)
print_time("GDS", datetime.datetime.now(), start_time)

# Create a LEF physical model
start_time = datetime.datetime.now()
lefname = OPTS.output_path + self.r.name + ".lef"
debug.print_raw("LEF: Writing to {0}".format(lefname))
self.lef_write(lefname)
print_time("LEF", datetime.datetime.now(), start_time)

# Save the LVS file
start_time = datetime.datetime.now()
lvsname = OPTS.output_path + self.r.name + ".lvs.sp"
Expand Down
4 changes: 2 additions & 2 deletions rom_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
output_extensions = [ "sp", "v"]
# Only output lef/gds if back-end
if not OPTS.netlist_only:
output_extensions.extend(["gds"])
output_extensions.extend(["lef", "gds"])

output_files = ["{0}{1}.{2}".format(OPTS.output_path,
OPTS.output_name, x)
Expand All @@ -69,4 +69,4 @@

# Delete temp files etc.
openram.end_openram()
openram.print_time("End", datetime.datetime.now(), start_time)
openram.print_time("End", datetime.datetime.now(), start_time)

0 comments on commit 8032fa7

Please # to comment.