Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tools/FakeRAM2.0/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
utils/__pycache__
results
*~
.coverage
htmlcov
__pycache__
8 changes: 8 additions & 0 deletions tools/FakeRAM2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FakeRAM2.0

FakeRAM2.0 aims to build a fake memory compiler which can be used by Physical Design research teams to get memory models (Liberty, LEF and Verilog) compatible with the PDK of their choice. <br/>

Inputs : configuration file eg. example_input_file.cfg <br/>
Run command : python run.py <example_input_file name> <br/>

Originally located at https://github.com/The-OpenROAD-Project/FakeRAM2.0
4 changes: 4 additions & 0 deletions tools/FakeRAM2.0/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# To get relative imports to work
import os, sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)))
55 changes: 55 additions & 0 deletions tools/FakeRAM2.0/example_input_file.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#SAMPLE INPUT FILE; VALUES NOT REALISTIC
{
# The process node.
"tech_nm": 7,

# The operating voltage.
"voltage": 0.7,

# String to add in front of every metal layer number for the layer name.
"metal_prefix": "M",

# Horizontal Metal layer for macro pins
"metal_layer": "M4",

# The pin width for signal pins.
"pin_width_nm": 24,

# The minimum pin pitch for signal pins
"pin_pitch_nm": 48,

# Metal track pitch
"metal_track_pitch_nm": 48,

# Manufacturing Grid
"manufacturing_grid_nm": 1,

# Contacted Poly Pitch
"contacted_poly_pitch_nm": 54,

#column mux factor
"column_mux_factor": 1,

# Fin pitch
"fin_pitch_nm" : 27,

# Optional snap the width and height of the sram to a multiple value.
"snap_width_nm": 190,
"snap_height_nm": 1400,

# List of SRAM configurations (name width depth and banks)
"srams": [
{"name": "fakeram7_2048x39", "width": 39, "depth": 2048, "banks": 4},
{"name": "fakeram7_256x32", "width": 32, "depth": 256, "banks": 2},
{"name": "fakeram7_256x34", "width": 34, "depth": 256, "banks": 2},
{"name": "fakeram7_64x21", "width": 21, "depth": 64, "banks": 2},
{"name": "fakeram_256x128", "width": 128, "depth": 256, "banks": 1},
{"name": "fakeram_256x64", "width": 64, "depth": 256, "banks": 2},
{"name": "fakeram_32x46", "width": 46, "depth": 32, "banks": 1},
{"name": "fakeram_512x8", "width": 8, "depth": 512, "banks": 4},
{"name": "fakeram_64x20", "width": 20, "depth": 64, "banks": 2},
{"name": "fakeram_64x22", "width": 22, "depth": 64, "banks": 2}
]

# TENTATIVE PARAMETERS
}
53 changes: 53 additions & 0 deletions tools/FakeRAM2.0/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3

import sys
import argparse

from utils.run_utils import RunUtils
from utils.class_process import Process
from utils.memory_config import MemoryConfig
from utils.memory_factory import MemoryFactory
from utils.timing_data import TimingData


def get_args() -> argparse.Namespace:
"""
Get command line arguments
"""
parser = argparse.ArgumentParser(description="""
This project is designed to generate black-boxed SRAMs for use in CAD
flows where either an SRAM generator is not available or doesn't
exist. """)
parser.add_argument("config", help="JSON configuration file")
parser.add_argument(
"--output_dir",
action="store",
help="Output directory ",
required=False,
default="results",
)
return parser.parse_args()


def main(args: argparse.Namespace):
json_data = RunUtils.get_config(args.config)
# Create a process object (shared by all srams)
process = Process(json_data)
timing_data = TimingData(json_data)

memory_type = json_data.get("memory_type", "RAM")
port_config = json_data.get("port_configuration", "SP")

# Go through each sram and generate the lib, lef and v files
for sram_data in json_data["srams"]:
mem_config = MemoryConfig.from_json(sram_data)
memory = MemoryFactory.create(
mem_config, memory_type, port_config, process, timing_data
)
RunUtils.write_memory(memory, args.output_dir)


### Entry point
if __name__ == "__main__":
args = get_args()
main(args)
Loading