Skip to content

Commit

Permalink
Merge branch 'dev' into post-drt-antenna
Browse files Browse the repository at this point in the history
  • Loading branch information
kareefardi authored Jan 14, 2025
2 parents 0a4a8bb + dffc442 commit 9f4bcd9
Show file tree
Hide file tree
Showing 47 changed files with 972 additions and 452 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ jobs:
--pdk-root ./.volare-sky130\
--smoke-test
- name: Upload Docker Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docker-image-${{ matrix.arch }}
path: ${{ env.IMAGE_PATH }}
Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:
fi
- name: Upload Run Folder
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.design.test_name }}-${{ matrix.design.pdk }}-${{ matrix.design.scl }}
path: ${{ matrix.design.run_dir }}
Expand All @@ -375,14 +375,25 @@ jobs:
--extract-metrics-to ${{ matrix.design.pdk }}-${{ matrix.design.scl }}-${{ matrix.design.test_name }}.metrics.json
- name: Upload Metrics
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: metrics
name: ${{ matrix.design.pdk }}-${{ matrix.design.scl }}-${{ matrix.design.test_name }}.metrics.json
path: ${{ matrix.design.pdk }}-${{ matrix.design.scl }}-${{ matrix.design.test_name }}.metrics.json
merge_metrics:
name: Merge Metrics
runs-on: ubuntu-22.04
needs: test
if: ${{ always() }}
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: metrics
pattern: "*.metrics.json"
upload_metrics:
name: Upload Metrics
runs-on: ubuntu-22.04
needs: [test]
needs: [test, merge_metrics]
if: ${{ always() }}
steps:
- name: Check out repo
Expand All @@ -395,7 +406,7 @@ jobs:
python3 -m pip install -e .
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Download Metrics
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: metrics
path: current
Expand Down Expand Up @@ -447,12 +458,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Download Image (Docker/amd64)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docker-image-amd64
path: /tmp/docker
- name: Download Image (Docker/aarch64)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docker-image-aarch64
path: /tmp/docker
Expand Down
3 changes: 3 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# Required
version: 2

sphinx:
configuration: docs/source/conf.py

build:
os: ubuntu-22.04
tools:
Expand Down
135 changes: 127 additions & 8 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,100 @@

## Steps

* `Yosys.*`
* Added `SYNTH_CORNER`
* `Odb.AddPDNObstructions`, `Odb.AddRoutingObstructions`

* `PDN_OBSTRUCTIONS` and `ROUTING_OBSTRUCTIONS` are now lists of tuples
instead of variable-length Tcl-style lists (AKA: strings).

* `OpenROAD.*`

* Added `log_cmd` from OpenROAD-flow-scripts -- neat idea for consistency
* New convenience methods to append flags to calls based on environment
variables
* **Internal**: Steps now sensitive to `_OPENROAD_GUI` environment variable --
coupled with `--only`, it runs a step in OpenROAD then doesn't quit so you
may inspect the result.
* This is not part of the OpenLane stable API and may be broken at any
moment.

* `OpenROAD.CTS`

* Added flags `CTS_OBSTRUCTION_AWARE` and `CTS_BALANCE_LEVELS`
* Added `CTS_SINK_BUFFER_MAX_CAP_DERATE_PCT`
* Added `CTS_DELAY_BUFFER_DERATE_PCT`

* `OpenROAD.CutRows`

* Added `FP_PRUNE_THRESHOLD` to prune rows not meeting the threshold after
cutting.

* `OpenROAD.DetailedRouting`
* Added `DRT_SAVE_SNAPSHOTS` which enables saving snapshots of the layout each detalied routing iteration.

* Added `DRT_SAVE_SNAPSHOTS` which enables saving snapshots of the layout each
detalied routing iteration.
* Added `DRT_SAVE_DRC_REPORT_ITERS`


* `OpenROAD.GlobalPlacement`

* Added optional variable `PL_ROUTABILITY_MAX_DENSITY_PCT`

* `OpenROAD.RepairDesignPostGPL`

* Added optional variable `DESIGN_REPAIR_MAX_UTIL_PCT`

* `OpenROAD.ResizerTimingPostCTS`

* Renamed `PL_RESIZER_GATE_CLONING` to `PL_RESIZER_SETUP_GATE_CLONING`

* Fixed `PL_RESIZER_SETUP_GATE_CLONING` incorrectly applied to hold fixing

* Added the following optional variables

* `PL_RESIZER_SETUP_BUFFERING`
* `PL_RESIZER_SETUP_BUFFER_REMOVAL`
* `PL_RESIZER_SETUP_REPAIR_TNS_PCT`
* `PL_RESIZER_SETUP_MAX_UTIL_PCT`
* `PL_RESIZER_HOLD_REPAIR_TNS_PCT`
* `PL_RESIZER_HOLD_MAX_UTIL_PCT`

* `OpenROAD.RepairDesignPostGRT`

* Renamed `GRT_RESIZER_GATE_CLONING` to `GRT_RESIZER_SETUP_GATE_CLONING`

* Fixed `GRT_RESIZER_SETUP_GATE_CLONING` incorrectly applied to hold fixing

* Added the following optional variables

* `GRT_RESIZER_SETUP_BUFFERING`
* `GRT_RESIZER_SETUP_BUFFER_REMOVAL`
* `GRT_RESIZER_SETUP_REPAIR_TNS_PCT`
* `GRT_RESIZER_SETUP_MAX_UTIL_PCT`
* `GRT_RESIZER_HOLD_REPAIR_TNS_PCT`
* `GRT_RESIZER_HOLD_MAX_UTIL_PCT`

* Created `OpenROAD.UnplaceAll`

* Removes the placement status of all instances.

* `Yosys.*Synthesis`

* Added `SYNTH_CORNER`: a step-specific override for `DEFAULT_CORNER`.

## Tool Updates

* Updated nix-eda
* Updated nixpkgs to nixos-24.11 (@ `3c53b4b`)
* Updated KLayout to `0.29.9`
* Updated Magic to `8.3.503`
* Updated Netgen to `1.5.287`
* Updated nixpkgs to nixos-24.11 (@ `3c53b4b`)
* Updated KLayout to `0.29.9`
* Updated Magic to `8.3.503`
* Updated Netgen to `1.5.287`
* Updated ioplace-parser to`0.4.0`
* Updated OpenROAD to `1d61007`
* Updated OpenSTA to `aa598a2`

## Misc. Enhancements/Bugfixes

* `openlane.state`

* `DesignFormat`
* Now a dataclass encapsulating the information about the DesignFormat
directly.
Expand All @@ -60,8 +127,28 @@
* States initialized with keys that have values that are `None` now remove
said keys.

* `openlane.config`

* Moved a number of global variables:
* `WIRE_LENGTH_THRESHOLD` moved from global variables to
`Checker.WireLength`
* `GPIO_PAD_*` removed- no step currently uses them
* `FP_TRACKS_INFO`, `FP_TAPCELL_DIST` moved to relevant steps
* `FILL_CELL` and `DECAP_CELL` renamed to `FILL_CELLS` and `DECAP_CELLS` as
they are both lists
* `EXTRA_GDS_FILES` and `FALLBACK_SDC_FILE` renamed to `EXTRA_GDS` and
`FALLBACK_SDC`: information can be obtained from their typing
* Changed some `decimal.Decimal` initializations to use integers or strings
instead of floats.

## API Breaks

* `Odb.AddRoutingObstructions`, `Odb.AddPDNObstructions`

* Typing for representation of obstructions has been changed. Designs with a
meta version of 2 or higher must update their variables from strings to
tuples.

* `openlane.steps`

* `TclStep` now uses the IDs uppercased for `CURRENT_` and `SAVE_`.
Expand All @@ -79,6 +166,38 @@
to `full_name`. The enumeration's name has been added to `alts`, while
`.name` is now an alias for `.id`.

* `openlane.config`

* `WIRE_LENGTH_THRESHOLD`, `GPIO_PAD_*`, `FP_TRACKS_INFO`, `FP_TAPCELL_DIST`
are no longer global variables.

* `FILL_CELL`, `DECAP_CELL`, `EXTRA_GDS_FILES`, `FALLBACK_SDC_FILE` were all
renamed, see Misc. Enhancements/Bugfixes.

# 2.3.2

## Steps

* `Yosys.*`
* Fixed blackbox Verilog and lib models causing a crash if they are gzipped
and/or have the extension `.gz`.

## Tool Updates

* Relaxed requirement on `httpx` to include `0.28.X`, which has no removals
compared to `0.27.0`.

## Documentation

* Clarified support for gzipped files in the Classic flow.

# 2.3.1

## Tool Updates

* KLayout now compiled with `-qt-binding`, which increases distribution size but
allows for more features.

# 2.3.0

## Steps
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2020 Efabless Corporation
# SPDX-FileCopyrightText: 2020-2025 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,7 @@

# -- Project information -----------------------------------------------------
project = "OpenLane"
copyright = "2020-2023 Efabless Corporation and contributors"
copyright = "2020-2025 Efabless Corporation and contributors"
author = "Efabless Corporation"
repo = "https://github.com/efabless/openlane2"
branch = "main"
Expand Down
18 changes: 18 additions & 0 deletions docs/source/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,23 @@ MPW
of a wafer to be spread across multiple projects.
{term}`OpenMPW` and {term}`chipIgnite` are examples of MPW projects.
dotlib
Also `.lib`.
A library format for macros including standard cells, modeling at an
abstract level the interface to and timing properties of a cell.
Typically used for Synthesis and {term}`STA`.
Gzip
A free and open-source compression format. A great many number of tools
support Gzipped inputs transparently, i.e., any file beginning with the
bytes `1f 8b` is automatically decompressed without any special input
from the user.
Gzipping is popular for text-heavy formats such as {term}`dotlib` or
{term}`SPEF` formats.
```
17 changes: 15 additions & 2 deletions docs/source/usage/using_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ views- the former of which is used in PnR and the latter is used for tape-out.
* Used as a fallback during synthesis if neither Verilog headers nor regular
netlists (`.gl.v`/`.nl.v`) exist. It is not recommended for this use as
synthesis checks may fail.
* Lib file (`.lib`): Optional
* {term}`dotlib` file (`.lib`): Optional
* May be used during STA (see [relevant section](#sta)).
* Used as a last resort for synthesis if no Verilog header (`.vh`) or any
netlists (`.nl.v`/`.gl.v`/`.pnl.v`) are available. It is not recommended for
Expand All @@ -83,13 +83,26 @@ thereof) and the values are a Python dataclass. You can find the API reference
for the macros hashmap at {class}`openlane.common.Macro`, but a less mechanical
explanation is as follows:

```{tip}
To save space in your repositories, {term}`Gzip`ped views may be supported
depending on the flow. The Classic flow generally supports gzipping the
following formats:
* gds
* lef
* vh
* lib
* spef
```

* The keys contain the name of the Macro itself (not instances thereof.)
* The values are:
* A dictionary of instance names to instance objects
* The instance objects in turn consist off:
* `location`: A tuple of two numbers, in microns, indicating the location
of the macro (optional)
* `orientation`: The orientation of the placed macro-- see page 250 of the
* `orientation`: The orientation of the placed macro-- see the
{term}`LEFDEFREF` for a definition and visual.
* `gds`: List of GDS files comprising the macro (usually only one)
* `lef`: List of LEF files comprising the macro (usually only one)
Expand Down
26 changes: 26 additions & 0 deletions openlane/common/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os
import re
import glob
import gzip
import typing
import fnmatch
import pathlib
Expand All @@ -29,6 +30,7 @@
SupportsFloat,
Union,
)

import httpx

from .types import AnyPath, Path
Expand Down Expand Up @@ -374,3 +376,27 @@ def process_list_file(from_file: AnyPath) -> List[str]:

def _get_process_limit() -> int:
return int(os.getenv("_OPENLANE_MAX_CORES", os.cpu_count() or 1))


def gzopen(filename, mode="rt"):
"""
This method (tries to?) emulate the gzopen from the Linux Standard Base,
specifically this part:
If path refers to an uncompressed file, and mode refers to a read mode,
gzopen() shall attempt to open the file and return a gzFile object suitable
for reading directly from the file without any decompression.
gzip.open does not have this behavior.
"""
try:
g = gzip.open(filename, mode=mode)
# Incredibly, it won't actually try to figure out if it's a gzipped
# file until you try to read from it.
if "r" in mode:
g.read(1)
g.seek(0)
return g
except gzip.BadGzipFile:
g.close()
return open(filename, mode=mode)
8 changes: 4 additions & 4 deletions openlane/common/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from deprecated.sphinx import deprecated


from .misc import mkdirp
from .misc import mkdirp, gzopen
from .types import Path
from .metrics import aggregate_metrics
from .generic_dict import GenericImmutableDict, is_string
Expand Down Expand Up @@ -388,9 +388,9 @@ class State(IntEnum):
excluded_cells_filter = Filter(excluded_cells)

for file in input_lib_files:
input_lib_stream = open(file)
out_filename = f"{uuid.uuid4().hex}.lib"
out_path = os.path.join(self.tmp_dir, out_filename)
input_lib_stream = gzopen(file)
# can't be gzip -- abc cannot read gzipped lib files
out_path = os.path.join(self.tmp_dir, f"{uuid.uuid4().hex}.lib")

state = State.initial
brace_count = 0
Expand Down
Loading

0 comments on commit 9f4bcd9

Please sign in to comment.