Skip to content

Commit efc67de

Browse files
committed
chore: update to librelane 2.4.2, cleanup
1 parent 1a772a5 commit efc67de

File tree

32 files changed

+410
-597
lines changed

32 files changed

+410
-597
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ name: CI
88
jobs:
99
lint_models:
1010
name: Lint All Models
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v5
1515
- name: Get IcarusVerilog
1616
run: |
1717
sudo apt-get install -y iverilog
@@ -24,15 +24,15 @@ jobs:
2424
done
2525
lint_python:
2626
name: Lint Python Code
27-
runs-on: ubuntu-22.04
27+
runs-on: ubuntu-24.04
2828
steps:
2929
- name: Check out Git repository
3030
uses: actions/checkout@v2
3131
- name: Lint
3232
run: make lint
3333
verify_models:
3434
name: Verify (${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }})
35-
runs-on: ubuntu-22.04
35+
runs-on: ubuntu-24.04
3636
needs: [lint_models]
3737
strategy:
3838
matrix:
@@ -53,7 +53,7 @@ jobs:
5353
- { count: "2048", width: "32", variant: "1RW1R" }
5454
steps:
5555
- name: Checkout code
56-
uses: actions/checkout@v3
56+
uses: actions/checkout@v5
5757
- name: Get IcarusVerilog
5858
run: |
5959
sudo apt-get install -y iverilog
@@ -68,7 +68,7 @@ jobs:
6868
/bin/bash -c "! make | grep -c FATAL"
6969
harden:
7070
name: Harden (${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }})
71-
runs-on: ubuntu-22.04
71+
runs-on: ubuntu-24.04
7272
needs: [lint_models, lint_python]
7373
strategy:
7474
fail-fast: false
@@ -90,28 +90,28 @@ jobs:
9090
#- { count: "256", width: "32", variant: "1RW1R" } # Timeout
9191
steps:
9292
- name: Checkout code
93-
uses: actions/checkout@v3
94-
- name: Setup Nix
95-
uses: cachix/install-nix-action@v22
96-
with:
97-
nix_path: nixpkgs=channel:nixos-23.05
98-
- name: Setup Cachix
99-
uses: cachix/cachix-action@v12
100-
with:
101-
name: openlane
93+
uses: actions/checkout@v5
94+
- name: Install Lix
95+
run: |
96+
curl --proto '=https' --tlsv1.2 -sSf -L https://install.lix.systems/lix | sh -s -- install --no-confirm --extra-conf "
97+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
98+
experimental-features = nix-command flakes
99+
"
100+
echo "extra-substituters = https://nix-cache.fossi-foundation.org" | sudo tee -a /etc/nix/nix.conf
101+
echo "extra-trusted-public-keys = nix-cache.fossi-foundation.org:3+K59iFwXqKsL7BNu6Guy0v+uTlwsxYQxjspXzqLYQs=" | sudo tee -a /etc/nix/nix.conf
102102
- name: Run
103103
run: |
104104
building_blocks=ram
105105
if [ "${{ matrix.variant }}" == "2R1W" ]; then
106106
building_blocks=rf
107107
fi
108108
109-
nix-shell --pure --run "\
109+
nix develop --command "\
110110
./dffram.py ${{ matrix.count }}x${{ matrix.width }}\
111-
-p sky130A\
112-
-s sky130_fd_sc_hd\
113-
-v ${{ matrix.variant }}\
114-
-b $building_blocks\
111+
-p sky130A\
112+
-s sky130_fd_sc_hd\
113+
-v ${{ matrix.variant }}\
114+
-b $building_blocks\
115115
"
116116
117117
echo "PRODUCTS_PATH=$(echo products/*)" >> $GITHUB_ENV
@@ -122,17 +122,17 @@ jobs:
122122
# name: BUILD_${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }}
123123
# path: ./build
124124
- name: Upload Final Views
125-
uses: actions/upload-artifact@v3
125+
uses: actions/upload-artifact@v4
126126
with:
127127
name: ${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }}
128128
path: ${{ env.PRODUCTS_PATH }}
129129
publish:
130130
name: Publish Release
131131
if: always()
132132
needs: [harden, verify_models]
133-
runs-on: ubuntu-22.04
133+
runs-on: ubuntu-24.04
134134
steps:
135-
- uses: actions/checkout@v3
135+
- uses: actions/checkout@v5
136136
with:
137137
fetch-depth: 0
138138
- name: Export Repo URL
@@ -147,8 +147,12 @@ jobs:
147147
if [ "${{ github.event_name }}" != "pull_request" ] && [ "${{ env.BRANCH_NAME }}" = "main" ]; then
148148
python3 ./.github/scripts/generate_tag.py
149149
fi
150-
- name: Download All Artifacts
151-
uses: actions/download-artifact@v3
150+
- name: Merge Artifacts
151+
uses: actions/upload-artifact/merge@v4
152+
with:
153+
delete-merged: true
154+
- name: Download Artifacts
155+
uses: actions/download-artifact@v4
152156
with:
153157
path: ./artifacts
154158
- name: Create Release

Contributing.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Ensure that your local git clone also has an `upstream` remote. You can add it v
1515
```sh
1616
git remote get-url upstream
1717
> fatal: No such remote 'upstream'
18-
git remote add upstream https://github.com/Cloud-V/DFFRAM`
18+
git remote add upstream https://github.com/AUCOHL/DFFRAM`
1919
```
2020

2121
You can start a rebase by typing:
@@ -39,17 +39,7 @@ git push -fu origin main
3939
Then, create your pull request. If all went well, the CI should pass.
4040
4141
## Note to maintainers
42+
4243
If the number of commits is low, rebase and merge, but if it is high (5 commits or more), squash and merge.
4344
4445
Squash and merge makes for a cleaner commit history, but will require pretty much everyone to rebase any work they've had off the main branch with a great degree more difficulty.
45-
46-
# Legal
47-
By submitting a pull request, you (the Contributor) hereby grant The American University in Cairo a world-wide, royalty-free, non-exclusive license under intellectual property rights (other than patent or trademark) licensable by such Contributor to:
48-
49-
* use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work;
50-
51-
* under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
52-
53-
Copyright notice: above text adapted from the Mozilla Public License, version 2.0.
54-
55-
You are entitled and encouraged to add your name and email to the AUTHORS document at the root of the repository under 'Other Contributors', as well as include your name in any modified or created file.

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</p>
55
<p align="center">
66
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License: Apache 2.0"/></a>
7-
<img src="https://github.com/Cloud-V/DFFRAM/actions/workflows/main.yml/badge.svg?branch=main" alt="CI Status" />
7+
<img src="https://github.com/AUCOHL/DFFRAM/actions/workflows/main.yml/badge.svg?branch=main" alt="CI Status" />
88
<a href="https://invite.skywater.tools"><img src="https://img.shields.io/badge/Community-Skywater%20PDK%20Slack-ff69b4?logo=slack" alt="Invite to the Skywater PDK Slack"/></a>
99
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style: Black"/></a>
1010
</p>

dffram.py

Lines changed: 7 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -1,194 +1,18 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf8 -*-
3-
# Copyright ©2020-2023 The American University in Cairo
3+
# SPDX-License-Identifier: Apache-2.0
4+
# Copyright ©2020-2025, The American University in Cairo
45
# Copyright ©2023 Efabless Corporation
5-
#
6-
# This file is part of the DFFRAM Memory Compiler.
7-
# See https://github.com/Cloud-V/DFFRAM for further info.
8-
#
9-
# Licensed under the Apache License, Version 2.0 (the "License");
10-
# you may not use this file except in compliance with the License.
11-
# You may obtain a copy of the License at
12-
#
13-
# http://www.apache.org/licenses/LICENSE-2.0
14-
#
15-
# Unless required by applicable law or agreed to in writing, software
16-
# distributed under the License is distributed on an "AS IS" BASIS,
17-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18-
# See the License for the specific language governing permissions and
19-
# limitations under the License.
206
import os
217
import re
22-
import math
23-
from typing import List
248
from fnmatch import fnmatch
259
from decimal import Decimal
2610

2711
import yaml
2812
import cloup
29-
from openlane.common import mkdirp
30-
from openlane.config import Variable
31-
from openlane.logging import warn, err
32-
from openlane.state import DesignFormat
33-
from openlane.flows import SequentialFlow, cloup_flow_opts, Flow
34-
from openlane.steps import Yosys, OpenROAD, Magic, KLayout, Netgen, Odb, Checker, Misc
35-
36-
37-
class PlaceRAM(Odb.OdbpyStep):
38-
id = "DFFRAM.PlaceRAM"
39-
40-
config_vars = [
41-
Variable(
42-
"RAM_SIZE",
43-
str,
44-
"The size of the RAM macro being hardened the format {words}x{bits}",
45-
),
46-
Variable(
47-
"BUILDING_BLOCKS",
48-
str,
49-
"The set of building blocks being used.",
50-
default="ram",
51-
),
52-
]
53-
54-
def get_script_path(self):
55-
return "placeram"
56-
57-
def get_command(self) -> List[str]:
58-
raw = super().get_command() + [
59-
"--building-blocks",
60-
f"{self.config['PDK']}:{self.config['STD_CELL_LIBRARY']}:{self.config['BUILDING_BLOCKS']}",
61-
"--size",
62-
self.config["RAM_SIZE"],
63-
]
64-
raw.insert(raw.index("placeram"), "-m")
65-
return raw
66-
67-
68-
class Floorplan(OpenROAD.Floorplan):
69-
id = "DFFRAM.Floorplan"
70-
71-
outputs = [
72-
DesignFormat.ODB,
73-
]
74-
75-
config_vars = [
76-
var
77-
for var in OpenROAD.Floorplan.config_vars
78-
if var.name not in ["FP_SIZING", "CORE_AREA", "DIE_AREA"]
79-
] + [
80-
Variable(
81-
"HORIZONTAL_HALO",
82-
type=Decimal,
83-
description="The space between the horizontal edges of the die area and the core area in microns.",
84-
units="µm",
85-
default=2.5,
86-
),
87-
Variable(
88-
"VERTICAL_HALO",
89-
type=Decimal,
90-
description="The space between the vertical edges of the die area and the core area in microns.",
91-
units="µm",
92-
default=2.5,
93-
),
94-
Variable(
95-
"MINIMUM_HEIGHT",
96-
type=Decimal,
97-
description="A minimum height to be applied",
98-
default=0,
99-
units="µm",
100-
),
101-
]
102-
103-
def run(self, state_in, **kwargs):
104-
min_height = self.config["MINIMUM_HEIGHT"]
105-
106-
core_width = Decimal(
107-
state_in.metrics.get("dffram__suggested__core_width") or 20000
108-
)
109-
core_height = Decimal(
110-
state_in.metrics.get("dffram__suggested__core_height") or 20000
111-
)
112-
113-
horizontal_halo = self.config["HORIZONTAL_HALO"]
114-
vertical_halo = self.config["VERTICAL_HALO"]
115-
116-
pdk = self.config["PDK"]
117-
scl = self.config["STD_CELL_LIBRARY"]
118-
119-
tech_info_path = os.path.join(".", "platforms", pdk, scl, "tech.yml")
120-
tech_info = yaml.safe_load(open(tech_info_path))
121-
site_info = tech_info.get("site")
122-
123-
site_width = Decimal(1)
124-
site_height = Decimal(1)
125-
126-
if site_info is not None:
127-
site_width = Decimal(site_info["width"])
128-
site_height = Decimal(site_info["height"])
129-
130-
horizontal_halo = math.ceil(horizontal_halo / site_width) * site_width
131-
vertical_halo = math.ceil(vertical_halo / site_height) * site_height
132-
else:
133-
if horizontal_halo != 0.0 or vertical_halo != 0.0:
134-
warn(
135-
"Note: This platform does not have site information. The halo will not be rounded up to the nearest number of sites. This may cause off-by-one issues with some tools."
136-
)
137-
138-
die_width = core_width + horizontal_halo * 2
139-
die_height = core_height + vertical_halo * 2
140-
if die_height < min_height:
141-
die_height = min_height
142-
vertical_halo = (die_height - core_height) / 2
143-
vertical_halo = math.ceil(vertical_halo / site_height) * site_height
144-
145-
kwargs, env = self.extract_env(kwargs)
146-
147-
env["DIE_AREA"] = f"0 0 {die_width} {die_height}"
148-
env[
149-
"CORE_AREA"
150-
] = f"{horizontal_halo} {vertical_halo} {horizontal_halo + core_width} {vertical_halo + core_height}"
151-
env["FP_SIZING"] = "absolute"
152-
return super().run(state_in, env=env, **kwargs)
153-
154-
155-
@Flow.factory.register()
156-
class DFFRAM(SequentialFlow):
157-
Steps = [
158-
Yosys.Synthesis,
159-
Misc.LoadBaseSDC,
160-
OpenROAD.STAPrePNR,
161-
Floorplan,
162-
PlaceRAM,
163-
Floorplan,
164-
PlaceRAM,
165-
OpenROAD.IOPlacement,
166-
Odb.CustomIOPlacement,
167-
OpenROAD.GeneratePDN,
168-
OpenROAD.STAMidPNR,
169-
OpenROAD.GlobalRouting,
170-
OpenROAD.STAMidPNR,
171-
OpenROAD.DetailedRouting,
172-
Checker.TrDRC,
173-
Odb.ReportDisconnectedPins,
174-
Checker.DisconnectedPins,
175-
Odb.ReportWireLength,
176-
Checker.WireLength,
177-
OpenROAD.RCX,
178-
OpenROAD.STAPostPNR,
179-
OpenROAD.IRDropReport,
180-
Magic.StreamOut,
181-
Magic.WriteLEF,
182-
KLayout.StreamOut,
183-
KLayout.XOR,
184-
Checker.XOR,
185-
Magic.DRC,
186-
Checker.MagicDRC,
187-
Magic.SpiceExtraction,
188-
Checker.IllegalOverlap,
189-
Netgen.LVS,
190-
Checker.LVS,
191-
]
13+
from librelane.common import mkdirp
14+
from librelane.logging import err
15+
from librelane.flows import cloup_flow_opts, Flow
19216

19317

19418
@cloup.command()
@@ -319,7 +143,7 @@ def main(
319143

320144
rt_max_layer = tech_info["metal_layers"]["rt-max-layer"]
321145

322-
TargetFlow = Flow.factory.get(flow_name) or DFFRAM
146+
TargetFlow = Flow.factory.get(flow_name) or Flow.factory.get("DFFRAMFlow")
323147
dffram_flow = TargetFlow(
324148
{
325149
"DESIGN_NAME": design,
@@ -339,8 +163,6 @@ def main(
339163
],
340164
"SYNTH_ELABORATE_ONLY": True,
341165
"SYNTH_ELABORATE_FLATTEN": True,
342-
"SYNTH_READ_BLACKBOX_LIB": True,
343-
"SYNTH_EXCLUSION_CELL_LIST": "/dev/null",
344166
"SYNTH_PARAMETERS": [f"WSIZE={logical_width}"],
345167
"GRT_REPAIR_ANTENNAS": False,
346168
"MINIMUM_HEIGHT": min_height,
@@ -356,7 +178,7 @@ def main(
356178
"FP_IO_VLENGTH": 2,
357179
"FP_IO_HLENGTH": 2,
358180
# PDN
359-
"DESIGN_IS_CORE": False,
181+
"FP_PDN_MULTILAYER": False,
360182
},
361183
design_dir=os.path.abspath(build_dir),
362184
pdk_root=pdk_root,

0 commit comments

Comments
 (0)