-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py.example
More file actions
178 lines (151 loc) · 6.8 KB
/
Copy pathconfig.py.example
File metadata and controls
178 lines (151 loc) · 6.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Copyright (c) 2026 PeraMorphIQ
# SPDX-License-Identifier: BSD-3-Clause
#
# This file is part of Pera-OpenRAM.
# Developed by the PeraCom Neuromorphic Research Group.
#
# Author: PeraMorphIQ Team
# ==============================================================================
# PeraMorphIQ SRAM Configuration Example
# ==============================================================================
# Copy this file to config.py and edit the parameters below
# Then run: python generate_sram.py
# ==============================================================================
# ==============================================================================
# SRAM Architecture Parameters
# ==============================================================================
# Word size: Number of bits per word (data width)
# Common values: 8, 16, 32, 64, 128, 256
word_size = 64
# Number of words: Depth of the SRAM (number of addressable locations)
# Must be a power of 2: 32, 64, 128, 256, 512, 1024, 2048, 4096, etc.
num_words = 256
# Number of banks: TOTAL number of physical macro instances in the array.
# Must be a power of 2 (1, 2, 4, 8, etc.) and equal to num_h_banks * num_v_banks.
# More banks = better performance but larger area
num_banks = 1
# Banking mode: "vertical", "horizontal" or "mixed" (for multi-bank SRAMs)
#
# "vertical" (default): Address space divided across banks
# - Each bank stores different words
# - Bank selection via address bits
# - Example: 4 banks, 2048 words → each bank has 512 words
# - Use case: Standard multi-bank SRAM
#
# "horizontal": Word width divided across banks (bit-slicing)
# - Each bank stores portion of bits for ALL words
# - All banks accessed in parallel
# - Example: 1024-bit word, 4 banks → each bank has 256 bits
# - Advantage: No bank mux latency, better for wide words
# - Use case: Cache lines, vector processors, wide data paths
#
# "mixed": BOTH axes at once (a num_v_banks x num_h_banks array)
# - ONE macro of (word_size / num_h_banks) bits x (num_words / num_v_banks)
# words is generated; <name>_top.v instantiates num_h_banks * num_v_banks
# copies of it.
# - Top log2(num_v_banks) address bits select the vertical group; all
# num_h_banks slices of that group fire in parallel; other groups have csb
# deasserted.
# - Example: 1024-bit word, 2048 words, 4h x 2v → eight 256b x 1024w macros
# - Use case: wide words that are ALSO too deep for a single bank, where a
# purely horizontal split would leave each macro over OpenRAM's row limit.
banking_mode = "vertical"
# Read ONLY when banking_mode == "mixed". Both must be powers of 2 and their
# product must equal num_banks.
# num_h_banks -> word-width slices (word_size must divide evenly)
# num_v_banks -> address-space groups (num_words must divide evenly)
num_h_banks = 1
num_v_banks = 1
# ==============================================================================
# Technology Configuration
# ==============================================================================
# Process technology node
# Available options:
# - "freepdk45" : 45nm predictive PDK (most tested)
# - "sky130" : SkyWater 130nm open-source PDK
# - "gf180mcu" : GlobalFoundries 180nm mixed-signal PDK
# - "scn4m_subm" : MOSIS 0.5um scalable CMOS (4-metal)
# - "scn3me_subm" : MOSIS 0.8um scalable CMOS (3-metal)
tech_name = "freepdk45"
# Use conda for dependency management (set to False to skip conda installation)
use_conda = False
# ==============================================================================
# Advanced Options (Optional)
# ==============================================================================
# Number of parallel threads for generation (default: 4)
# Increase for faster generation on multi-core systems
num_threads = 4
# Performance optimizations (uncomment to enable)
# These make generation faster but may reduce accuracy
# analytical_delay = True # Use fast analytical delay models (no SPICE)
# use_pex = False # Disable parasitic extraction (faster)
# check_lvsdrc = False # Skip DRC/LVS checks (faster iteration)
# trim_netlist = True # Remove unused subcircuits from netlist
# ==============================================================================
# Post-Processing Configuration
# ==============================================================================
# Technology library path for Synopsys tools (NDM generation)
# Update this path to match your technology library location
# Only needed if you plan to run run_post_process.sh
tech_lib_path = "/path/to/your/tech/lib/NangateOpenCellLibrary.ndm"
# PVT corners to process during post-generation
# Format: <corner>_<voltage>_<temp>
# Multiple corners separated by spaces
#
# Common corners:
# TT_1p0V_25C : Typical-Typical, 1.0V, 25°C (nominal)
# FF_1p1V_125C : Fast-Fast, 1.1V, 125°C (best case)
# SS_0p9V_m40C : Slow-Slow, 0.9V, -40°C (worst case)
#
# Example with multiple corners:
# pvt_corners = "TT_1p0V_25C FF_1p1V_125C SS_0p9V_m40C"
pvt_corners = "TT_1p0V_25C"
# ==============================================================================
# Auto-Generated Settings (Do Not Edit)
# ==============================================================================
# SRAM instance name (auto-generated from parameters)
# Suffix: '<N>v' vertical (default), '<N>h' horizontal, '<H>h<V>v' mixed
if banking_mode == "mixed":
_banking_suffix = f"{num_h_banks}h{num_v_banks}v"
elif banking_mode == "horizontal":
_banking_suffix = f"{num_banks}h"
else:
_banking_suffix = f"{num_banks}v"
sram_name = f"sram_{word_size}x{num_words}_{_banking_suffix}"
# Output directory for generated files
output_path = "./outputs"
# ==============================================================================
# Example Configurations
# ==============================================================================
# Uncomment one of these example configurations or create your own
# --- Small Cache / Register File ---
# word_size = 32
# num_words = 32
# num_banks = 1
# --- Medium SRAM ---
# word_size = 64
# num_words = 256
# num_banks = 1
# --- Large SRAM ---
# word_size = 128
# num_words = 1024
# num_banks = 2
# banking_mode = "vertical"
# --- Very Large Multi-Bank SRAM ---
# word_size = 128
# num_words = 2048
# num_banks = 4
# banking_mode = "vertical"
# --- Wide-Word High-Performance SRAM (Horizontal Banking) ---
# word_size = 1024
# num_words = 2048
# num_banks = 8
# banking_mode = "horizontal" # Bit-slicing, no mux latency
# --- Wide AND Deep SRAM (Mixed 2-D Banking) ---
# Eight 256b x 1024w macros: the word is split 4 ways, the depth 2 ways.
# word_size = 1024
# num_words = 2048
# num_banks = 8 # must equal num_h_banks * num_v_banks
# banking_mode = "mixed"
# num_h_banks = 4 # word-width slices
# num_v_banks = 2 # address-space groups