Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sky130 - Convert to Pydantic, support sky130_scl #848

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
52ee341
implemented abstract method for tech plugins to generate their own li…
harrisonliew Mar 8, 2024
4206c3b
remove original tech JSON
harrisonliew Mar 8, 2024
e59a9b5
Move tech LEF metals parsing to LEFUtils (a bit clunky), fix type che…
harrisonliew Mar 8, 2024
87de6ef
working through fixing paths for sky130 cds
elamdf Mar 8, 2024
d4916a3
no abstractmethod, remove sky130-specific things in tech LEF parsing
harrisonliew Mar 8, 2024
73223f8
typo, type checker
harrisonliew Mar 8, 2024
d58c30e
Add sky130_scl key, documentation, and cleanup
harrisonliew Mar 8, 2024
3e4ca48
Merge branch 'sky130_pydantic' of github.com:ucb-bar/hammer into HEAD
elamdf Mar 8, 2024
43e2506
give offset default value
elamdf Mar 8, 2024
b4f020d
Merge branch 'sky130_pydantic' of github.com:ucb-bar/hammer into HEAD
elamdf Mar 8, 2024
56ad76d
move sky130_lefpin.map to plugin root, clarify prefixes documentation
harrisonliew Mar 8, 2024
eb0bbc6
update variable refs
elamdf Mar 8, 2024
be66509
Merge branch 'sky130_pydantic' of github.com:ucb-bar/hammer into HEAD
elamdf Mar 8, 2024
67b1786
fixing Makefile error from spaces instead of tabs
nayiri-k Mar 9, 2024
0a61cd9
we hack the calibre lvs deck in setup_calibre_lvs_deck so need to spe…
nayiri-k Mar 9, 2024
5571f59
merge lines separated by \ in libfiles
nayiri-k Mar 9, 2024
2c18e6b
stuck on where the io lefs are in cadence pdk
elamdf Mar 10, 2024
00a9bf7
readd 130a io libs
elamdf Mar 10, 2024
3f3aa0f
Merge branch 'sky130_pydantic' of github.com:ucb-bar/hammer into cade…
elamdf Mar 10, 2024
8264cfa
set_setting for hammertech
elamdf Mar 10, 2024
cd53650
perliminary (non-fully-functional) support for sky130_cdl.
elamdf Mar 10, 2024
b6094f3
take out unused hacks
elamdf Mar 10, 2024
88ef8f3
take out pad io lef hack
elamdf Mar 10, 2024
ff937d6
undo autoformatting
elamdf Mar 11, 2024
1ba69b2
synthesis runs for commercial tutorial flow.
elamdf Apr 4, 2024
adcdfae
hack around various issues related to the cadence pdk (no
elamdf Apr 5, 2024
6554d91
make power-rtl work with joules
elamdf May 6, 2024
1066c89
working on lvs, par still not 100% clean
elamdf Jul 8, 2024
7e5adfe
formatting + [TODO test lvs on more designs] add hardcoded power stra…
elamdf Aug 27, 2024
f1c67c3
seperate drc decks to be library specific, set PEGASUS_DRC to make
elamdf Aug 27, 2024
8500f3b
don't draw straps on met2 or met3 to prevent congestion
elamdf Oct 20, 2024
a9e4780
remove sram with bad lef from cache
elamdf Oct 21, 2024
d19a3db
hack tlefs for both cadence and 130a stdcells, since we need to use the
elamdf Oct 24, 2024
00e2a02
add scaled versions of drivers, clkbuffers for sky130_scl and add cor…
elamdf Oct 25, 2024
bb03824
use cached (hacked) io lef for sky130_scl to prevent routing to filler
elamdf Oct 28, 2024
0973afb
don't use spice files for IO in sky130_scl since they're blackboxed i…
elamdf Oct 29, 2024
26fe2f0
Revert "use cached (hacked) io lef for sky130_scl to prevent routing …
elamdf Oct 29, 2024
8fa0f34
fix tlef hack for 130a
elamdf Nov 1, 2024
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
1 change: 1 addition & 0 deletions doc/Technology/Tech-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ HammerTechnology Class

The HammerTechnology class is the base class that all technology plugins should inherit from and is defined in ``hammer/tech/__init__.py``. Particularly useful methods are:

* ``gen_config``: the plugin subclass should override this method to generate the tech config. See the next section (:ref:`tech-json`) for details.
* ``post_install_script``: the plugin subclass should override this method to apply any non-default PDK installation steps or hotfixes in order to set up the technology libraries for use with Hammer.
* ``read_libs``: this is a particularly powerful method to read the libraries contained in the ``tech.json`` file and filter them using the filters also contained the same file. See the :ref:`filters` section for details.
* ``get_tech_<action>_hooks``: these methods are necessary if tech--specific hooks are needed, and must return a list of hooks when a given tool name implementing the relevant action is called. Refer to the :ref:`hooks` section for details about how to write hooks.
205 changes: 187 additions & 18 deletions doc/Technology/Tech-json.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ $(HAMMER_D_MK):
-include $(HAMMER_D_MK)

clean:
rm -rf $(OBJ_DIR) hammer-vlsi-*.log
rm -rf $(OBJ_DIR) hammer-vlsi-*.log
4 changes: 3 additions & 1 deletion hammer/par/openroad/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,9 @@ def write_gds(self) -> str:
ilm_gds = list(map(lambda ilm: ilm.gds, self.get_input_ilms()))
gds_files.extend(ilm_gds)

layer_map_file=self.get_setting('par.inputs.gds_map_file')
layer_map_file=self.get_gds_map_file()
if layer_map_file is None:
raise FileNotFoundError(f"Must have GDS layer map for write_gds! KLayout won't be able to write GDS file. ({layer_map_file}")

# the first entry of $KLAYOUT_PATH will be the one where the configuration is stored when KLayout exits
# otherwise KLayout tries to write everything to the same directory as the klayout binary and throws an error if it is not writeable
Expand Down
2 changes: 2 additions & 0 deletions hammer/synthesis/genus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def init_environment(self) -> bool:
verbose_append("set_db lp_clock_gating_prefix {CLKGATE}")
verbose_append("set_db lp_insert_clock_gating true")
verbose_append("set_db lp_clock_gating_register_aware true")
else:
verbose_append("set_db lp_clock_gating_infer_enable false")

# Set up libraries.
# Read timing libraries.
Expand Down
22 changes: 16 additions & 6 deletions hammer/tech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,12 @@ def __init__(self):
self.time_unit: Optional[str] = None
self.cap_unit: Optional[str] = None

def gen_config(self) -> None:
"""For subclasses to set self.config (type: TechJSON) directly, instead of from static JSON file"""
pass

@classmethod
def load_from_module(cls, tech_module: str) -> Optional["HammerTechnology"]:
def load_from_module(cls, tech_module: str) -> "HammerTechnology":
"""Load a technology from a given module.

:param tech_module: Technology module (e.g. "hammer.technology.asap7")
Expand All @@ -375,8 +379,8 @@ def load_from_module(cls, tech_module: str) -> Optional["HammerTechnology"]:
elif tech_yaml.is_file():
tech.config = TechJSON.model_validate_json(json.dumps(load_yaml(tech_yaml.read_text())))
return tech
else: #TODO - from Pydantic model instance
return None
else: # Assume tech implents gen_config()
return tech

def get_lib_units(self) -> None:
"""
Expand Down Expand Up @@ -415,6 +419,12 @@ def get_setting(self, key: str) -> Any:
print(e) # TODO: fix the root cause
return None

def set_setting(self, key: str, value: Any) -> None:
"""
Set a runtime setting in the database.
"""
self._database.set_setting(key, value)

def get_setting_suffix(self, key: str) -> Any:
"""Get a particular setting from the database with a suffix.
"""
Expand Down Expand Up @@ -648,15 +658,15 @@ def prepend_dir_path(self, path: str, lib: Optional[Library] = None) -> str:

1. Absolute path: the path starts with "/" and refers to an absolute path on the filesystem
/path/to/a/lib/file.lib -> /path/to/a/lib/file.lib
2. Tech plugin relative path: the path has no "/"s and refers to a file directly inside the tech plugin folder
2. Tech plugin relative path: the path has no "/"s and refers to a file directly inside the tech plugin folder (no subdirectories allowed, else it conflicts with 3-5. below!)
techlib.lib -> <tech plugin package>/techlib.lib
3. Tech cache relative path: the path starts with an identifier which is "cache" (this is used in the SKY130 tech JSON)
3. Tech cache relative path: the path starts with an identifier which is "cache" (this is used in the SKY130 Libraries)
cache/primitives.v -> <tech plugin cache dir>/primitives.v
4. Install relative path: the path starts with an install/tarball identifier (installs.id, tarballs.root.id)
and refers to a file relative to that identifier's path
pdkroot/dac/dac.lib -> /nfs/ecad/tsmc100/stdcells/dac/dac.lib
5. Library extra_prefix path: the path starts with an identifier present in the provided
library's extra_prefixes
library's extra_prefixes Field
lib1/cap150f.lib -> /design_files/caps/cap150f.lib
"""
assert len(path) > 0, "path must not be empty"
Expand Down
16 changes: 16 additions & 0 deletions hammer/technology/sky130/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ Now in your Hammer YAML configs, point to the location of this install:
technology.sky130.sky130A: "<PREFIX>/share/pdk/sky130A"
```

### Cadence PDK

Cadence has also created a PDK and standard cell library based on the original open PDK, and optimized for use with Cadence tools. Usage of this PDK is purely optional, but enables DRC/LVS with Pegasus, and IR drop analysis with Voltus.

You can download them from [here](https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od000000051TqEAI&pageName=ArticleContent) (Cadence Support account is required). After downloading and untar-ing the packages, point to the location of this install:

```yaml
technology.sky130.sky130_cds: "<path/to/sky130_pdk>"
technology.sky130.sky130_scl: "<path/to/sky130_scl>"
```

To select this standard cell library (instead of the default `sky130_fd_sc_hd`):

```yaml
technology.sky130.stdcell_library: "sky130_scl"
```

SRAM Macros
-----------
Expand Down
Loading
Loading