Skip to content

Commit

Permalink
Isolate substitution changes
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Jan 26, 2025
1 parent 7263983 commit 94206af
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 115 deletions.
22 changes: 6 additions & 16 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@
* Added `DRT_ANTENNA_MARGIN` which is similar to `GRT_ANTENNA_MARGIN` but for
the aforementioned antenna repair iterations

* `OpenROAD.Floorplan`

* Fixed an issue in `FP_SIZING`: `absolute` mode where if the die area's
x0 > x1 or y0 > y1, the computed core area would no longer fit in the die
area. Not that we recommend you ever do that, but technically OpenROAD
allows it.

* `OpenROAD.GlobalPlacement`

* Added optional variable `PL_ROUTABILITY_MAX_DENSITY_PCT`
Expand Down Expand Up @@ -117,15 +110,12 @@

* Updated nix-eda
* Updated nixpkgs to nixos-24.11 (@ `3c53b4b`)
* Updated KLayout to `0.29.10`
* Updated Magic to `8.3.515`
* Updated Netgen to `1.5.291`
* Updated ioplace-parser to `0.4.0`
* Updated OpenROAD to `655640a`
* Adds new DFT features
* Updated OpenSTA to `aa598a2`
* Updated Volare to `0.20.5`
* Includes support for ihp-sg13g2
* 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`

## Testing

Expand Down
23 changes: 12 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 4 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};

inputs.ioplace-parser.inputs.nix-eda.follows = "nix-eda";
inputs.volare.inputs.nix-eda.follows = "nix-eda";
inputs.libparse.inputs.nixpkgs.follows = "nix-eda/nixpkgs";
inputs.ioplace-parser.inputs.nix-eda.follows = "nix-eda";
inputs.volare.inputs.nixpkgs.follows = "nix-eda/nixpkgs";
inputs.devshell.inputs.nixpkgs.follows = "nix-eda/nixpkgs";

outputs = {
Expand All @@ -53,8 +53,7 @@
overlays = {
default = lib.composeManyExtensions [
(import ./nix/overlay.nix)
(nix-eda.flakesToOverlay [libparse volare])
ioplace-parser.overlays.default
(nix-eda.flakesToOverlay [libparse ioplace-parser volare])
(
pkgs': pkgs: let
callPackage = lib.callPackageWith pkgs';
Expand Down Expand Up @@ -85,10 +84,6 @@
sphinx-tippy = callPythonPackage ./nix/sphinx-tippy.nix {};
sphinx-subfigure = callPythonPackage ./nix/sphinx-subfigure.nix {};
yamlcore = callPythonPackage ./nix/yamlcore.nix {};
tclint = pypkgs.tclint.override {
version = "0.4.2";
sha256 = "sha256-q01HEnSVB8xr8Z8vaBJjmf2GioXGzcq5JHsRKwMVfU4=";
};

# ---
openlane = callPythonPackage ./default.nix {};
Expand All @@ -115,11 +110,7 @@
system:
import nix-eda.inputs.nixpkgs {
inherit system;
overlays = [
devshell.overlays.default
nix-eda.overlays.default
self.overlays.default
];
overlays = [devshell.overlays.default nix-eda.overlays.default self.overlays.default];
}
);

Expand Down
14 changes: 6 additions & 8 deletions nix/create-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@
in
devshell.mkShell {
devshell.packages = packages;
env =
[
{
name = "NIX_PYTHONPATH";
value = "${openlane-env-sitepackages}";
}
]
++ extra-env;
env = [
{
name = "NIX_PYTHONPATH";
value = "${openlane-env-sitepackages}";
}
] ++ extra-env;
devshell.interactive.PS1 = {
text = ''PS1="${prompt}"'';
};
Expand Down
5 changes: 2 additions & 3 deletions nix/openroad-abc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
fetchFromGitHub,
zlib,
abc-namespace-name ? "abc",
rev ? "5c9448c085eb8bf1e433a22a954532e44206c6f9",
sha256 ? "sha256-5juDIbn77cqgqU2CQjIwYERemqs7XbqSJaT7VLtKWHc=",
rev ? "ef5389d31526003c2ebd7e6d6d6fe3848a20f0a2",
sha256 ? "sha256-7W66b1Toa9uEAKoijPujqQXVjxf1Ku4w2eP2Vk0ri8c=",
}:
abc-verifier.overrideAttrs (finalAttrs: previousAttrs: {
name = "openroad-abc";
Expand All @@ -38,7 +38,6 @@ abc-verifier.overrideAttrs (finalAttrs: previousAttrs: {
"-DREADLINE_FOUND=FALSE"
"-DUSE_SYSTEM_ZLIB:BOOL=ON"
"-DABC_USE_NAMESPACE=${abc-namespace-name}"
"-DABC_SKIP_TESTS:BOOL=ON"
];

buildInputs = [zlib];
Expand Down
53 changes: 20 additions & 33 deletions nix/openroad.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
eigen,
cudd,
tcl,
tclreadline,
python3,
readline,
tclreadline,
spdlog,
libffi,
llvmPackages,
Expand All @@ -45,27 +45,16 @@
cmake,
ninja,
git,
gtest,
# environments,
rev ? "655640a795db2d2f6911f3cf447d410382c04c0a",
rev-date ? "2025-01-13",
sha256 ? "sha256-HRnF+taG3iUgOG4nYlXD2O0znF4zoZvxDpMMIkoNsL4=",
rev ? "87af90f72f3f9be1fdfa1d886f0dd8d8b8f34694",
rev-date ? "2024-12-08",
sha256 ? "sha256-GS8DLpAtC5gJfQeP+YOCImVXaAPQNzVbdDjdiB7Aovc=",
openroad,
buildPythonEnvForInterpreter,
}: let
stdenv = llvmPackages_17.stdenv;
cmakeFlagsCommon = debug: [
"-DTCL_LIBRARY=${tcl}/lib/libtcl${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DTCL_HEADER=${tcl}/include/tcl.h"
"-DUSE_SYSTEM_BOOST:BOOL=ON"
"-DCMAKE_CXX_FLAGS=-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED=1 -I${eigen}/include/eigen3 ${lib.strings.optionalString debug "-g -O0"}"
"-DCMAKE_EXE_LINKER_FLAGS=-L${cudd}/lib -lcudd"
"-DVERBOSE=1"
];
in
stdenv.mkDerivation (finalAttrs: {
__structuredAttrs = true; # better serialization; enables spaces in cmakeFlags

pname = "openroad";
version = rev-date;

Expand All @@ -76,20 +65,23 @@ in
inherit sha256;
};

cmakeFlagsDevDebug = lib.strings.concatMapStrings (
x: " \"${x}\" "
) (cmakeFlagsCommon true);
patches = [./patches/openroad/patches.diff];

cmakeFlagsDevRelease = lib.strings.concatMapStrings (
x: " \"${x}\" "
) (cmakeFlagsCommon false);
cmakeFlagsAll = [
"-DTCL_LIBRARY=${tcl}/lib/libtcl${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DTCL_HEADER=${tcl}/include/tcl.h"
"-DUSE_SYSTEM_BOOST:BOOL=ON"
"-DCMAKE_CXX_FLAGS=-I${openroad-abc}/include"
"-DENABLE_TESTS:BOOL=OFF"
"-DVERBOSE=1"
];

cmakeFlags =
(cmakeFlagsCommon false)
finalAttrs.cmakeFlagsAll
++ [
"-DUSE_SYSTEM_ABC:BOOL=ON"
"-DUSE_SYSTEM_OPENSTA:BOOL=ON"
"-DENABLE_TESTS:BOOL=OFF"
"-DCMAKE_CXX_FLAGS=-I${eigen}/include/eigen3"
"-DOPENSTA_HOME=${opensta}"
"-DABC_LIBRARY=${openroad-abc}/lib/libabc.a"
];
Expand All @@ -100,7 +92,8 @@ in
sed -i 's@#include "base/abc/abc.h"@#include <base/abc/abc.h>@' src/rmp/src/Restructure.cpp
sed -i 's@#include "base/main/abcapis.h"@#include <base/main/abcapis.h>@' src/rmp/src/Restructure.cpp
sed -i 's@# tclReadline@target_link_libraries(openroad readline ${cudd}/lib/libcudd.a)@' src/CMakeLists.txt
sed -i 's@# tclReadline@target_link_libraries(openroad readline)@' src/CMakeLists.txt
sed -i 's@''${TCL_LIBRARY}@''${TCL_LIBRARY}\n${cudd}/lib/libcudd.a@' src/CMakeLists.txt
'';

buildInputs = [
Expand All @@ -117,15 +110,13 @@ in
libsForQt5.qtbase
libsForQt5.qt5.qtcharts
llvmPackages.openmp
llvmPackages.libunwind

lemon-graph
opensta
glpk
zlib
clp
cbc
gtest

or-tools_9_11
];
Expand All @@ -140,16 +131,12 @@ in
ninja
libsForQt5.wrapQtAppsHook
llvmPackages_17.clang-tools
python3.pkgs.tclint
];

shellHook = ''
ord-format-changed() {
${git}/bin/git diff --name-only | grep -E '\.(cpp|cc|c|h|hh)$' | xargs clang-format -i -style=file:.clang-format
${git}/bin/git diff --name-only | grep -E '\.(tcl)$' | xargs tclfmt --in-place
}
alias ord-cmake-debug="cmake -DCMAKE_BUILD_TYPE=Debug $cmakeFlagsDevDebug -G Ninja"
alias ord-cmake-release="cmake -DCMAKE_BUILD_TYPE=Release $cmakeFlagsDevRelease -G Ninja"
alias ord-format-changed="${git}/bin/git diff --name-only | grep -E '\.(cpp|cc|c|h|hh)$' | xargs clang-format -i -style=file:.clang-format";
alias ord-cmake-debug="cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-g" -G Ninja $cmakeFlags .."
alias ord-cmake-release="cmake -DCMAKE_BUILD_TYPE=Release -G Ninja $cmakeFlags .."
'';

passthru = {
Expand Down
10 changes: 5 additions & 5 deletions nix/patches/openroad-abc/zlib.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 918fb79a1..272278b04 100644
index b90ac02d..b0d6b13f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,11 @@ if( APPLE )
Expand Down Expand Up @@ -40,10 +40,10 @@ index 918fb79a1..272278b04 100644

set(ABC_MAIN_SRC src/base/main/main.c)
diff --git a/Makefile b/Makefile
index 798fb2e7b..be9e01b65 100644
index e94591b2..89e2500b 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ MODULES := \
@@ -22,7 +22,7 @@ MODULES := \
src/map/mapper src/map/mio src/map/super src/map/if src/map/if/acd \
src/map/amap src/map/cov src/map/scl src/map/mpm \
src/misc/extra src/misc/mvc src/misc/st src/misc/util src/misc/nm \
Expand All @@ -52,7 +52,7 @@ index 798fb2e7b..be9e01b65 100644
src/misc/mem src/misc/bar src/misc/bbl src/misc/parse \
src/opt/cut src/opt/fxu src/opt/fxch src/opt/rwr src/opt/mfs src/opt/sim \
src/opt/ret src/opt/fret src/opt/res src/opt/lpk src/opt/nwk src/opt/rwt \
@@ -46,6 +46,12 @@ $(ARCHFLAGS_EXE) : arch_flags.c
@@ -45,6 +45,12 @@ $(ARCHFLAGS_EXE) : arch_flags.c

INCLUDES += -I$(ABCSRC)/src

Expand All @@ -66,7 +66,7 @@ index 798fb2e7b..be9e01b65 100644
ifdef ABC_USE_STDINT_H
ARCHFLAGS ?= -DABC_USE_STDINT_H=1
diff --git a/src/misc/zlib/zlib.h b/src/misc/zlib/zlib.h
index 46c1a1aec..1667a8cfe 100644
index 46c1a1ae..1667a8cf 100644
--- a/src/misc/zlib/zlib.h
+++ b/src/misc/zlib/zlib.h
@@ -28,6 +28,10 @@
Expand Down
28 changes: 28 additions & 0 deletions nix/patches/openroad/patches.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/src/drt/src/dr/FlexGridGraph_maze.cpp b/src/drt/src/dr/FlexGridGraph_maze.cpp
index b3298cc9a..0da5e2322 100644
--- a/src/drt/src/dr/FlexGridGraph_maze.cpp
+++ b/src/drt/src/dr/FlexGridGraph_maze.cpp
@@ -58,7 +58,7 @@ void FlexGridGraph::printExpansion(const FlexWavefrontGrid& currGrid,
pt,
currGrid.getCost(),
currGrid.getPathCost(),
- currGrid.getLastDir(),
+ int(currGrid.getLastDir()),
currGrid.getCost() - currGrid.getPathCost(),
gridX,
gridY);
diff --git a/src/gui/src/tclCmdInputWidget.h b/src/gui/src/tclCmdInputWidget.h
index 86372b22c..94a89601d 100644
--- a/src/gui/src/tclCmdInputWidget.h
+++ b/src/gui/src/tclCmdInputWidget.h
@@ -33,6 +33,10 @@
#pragma once

#include <tcl.h>
+// Workaround for https://github.com/swig/swig/issues/2887
+#ifndef TCL_SIZE_MAX
+using Tcl_Size = int;
+#endif

#include <QCompleter>
#include <QMenu>
7 changes: 0 additions & 7 deletions openlane/scripts/openroad/common/io.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,6 @@ proc write_views {args} {
write_verilog $::env(SAVE_NL)
}

if { [info exists ::env(SAVE_LOGICAL_NL)] } {
puts "Writing logic-only netlist to '$::env(SAVE_LOGICAL_NL)'…"
write_verilog\
-remove_cells "[get_physical_cells]"\
$::env(SAVE_LOGICAL_NL)
}

if { [info exists ::env(SAVE_PNL)] } {
puts "Writing powered netlist to '$::env(SAVE_PNL)'…"
write_verilog -include_pwr_gnd $::env(SAVE_PNL)
Expand Down
Loading

0 comments on commit 94206af

Please sign in to comment.