From fd08a202f158b4d0843bec3cc5c771231133ad43 Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 12:53:40 +0300 Subject: [PATCH 1/8] Fix PDN Config ~ Configure PDN as a macro ~ Update OpenLane 2 to Beta 14 ~ Fix bug where `odbpy` returns a goddamn pointer to an int64 --- dffram.py | 3 ++- placeram/cli.py | 6 +++--- requirements.txt | 2 +- shell.nix | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dffram.py b/dffram.py index 5acd22f..73e2c57 100755 --- a/dffram.py +++ b/dffram.py @@ -352,7 +352,8 @@ def main( "FP_IO_VEXTEND": Decimal(0), "FP_IO_VLENGTH": 2, "FP_IO_HLENGTH": 2, - "STA_CORNERS": ["nom_ss_100C_1v60"], + # PDN + "DESIGN_IS_CORE": False, }, design_dir=build_dir, ) diff --git a/placeram/cli.py b/placeram/cli.py index 7793af1..ac7fb24 100644 --- a/placeram/cli.py +++ b/placeram/cli.py @@ -183,9 +183,9 @@ def place(self): utl.metric_float("dffram__suggested__core_width", self.core_width) utl.metric_float("dffram__suggested__core_height", self.core_height) - die_area = self.block.getDieArea().area() / ( - self.micron_in_units * self.micron_in_units - ) + die_width = self.block.getDieArea().dx() / self.micron_in_units + die_height = self.block.getDieArea().dy() / self.micron_in_units + die_area = die_width * die_height self.density = logical_area / die_area utl.metric_float("dffram__logic__density", self.density) diff --git a/requirements.txt b/requirements.txt index cf76c00..6722f71 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -openlane==2.0.0b3 +openlane==2.0.0b14 pyyaml cloup \ No newline at end of file diff --git a/shell.nix b/shell.nix index 63519f1..013a8a6 100644 --- a/shell.nix +++ b/shell.nix @@ -18,6 +18,6 @@ let openlane-src = pkgs.fetchFromGitHub { owner = "efabless"; repo = "openlane2"; - rev = "0b2cb7eb6681b644e65082701175044e6e97cc0f"; - sha256 = "sha256-qYMZJGRfqNhf0FFf2VdF2AOsAqVTlWLrYlc3krvKp0I="; + rev = "0c05b7ea04eac74203a9a33f8a8b519f33220f2f"; + sha256 = "sha256-fjYz6HuIYrGbkb1oA6wPIlEjieYU5hu0aygYQFj2d2I="; }; in import "${openlane-src}/shell.nix" {} \ No newline at end of file From c90c0c9db1f18357a8b669f1f568b5cc68cf252d Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 13:18:35 +0300 Subject: [PATCH 2/8] Make CI pure? --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b0ce9f..5aa13cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -106,7 +106,7 @@ jobs: building_blocks=rf fi - nix-shell --run "\ + nix-shell --pure --run "\ ./dffram.py ${{ matrix.count }}x${{ matrix.width }}\ -p sky130A\ -s sky130_fd_sc_hd\ From 0baeb347f6e670ff9f4cb239cf7ecfc58a509daa Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 13:31:52 +0300 Subject: [PATCH 3/8] oh the misery --- shell.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 013a8a6..9cbe8fe 100644 --- a/shell.nix +++ b/shell.nix @@ -20,4 +20,6 @@ let openlane-src = pkgs.fetchFromGitHub { repo = "openlane2"; rev = "0c05b7ea04eac74203a9a33f8a8b519f33220f2f"; sha256 = "sha256-fjYz6HuIYrGbkb1oA6wPIlEjieYU5hu0aygYQFj2d2I="; -}; in import "${openlane-src}/shell.nix" {} \ No newline at end of file +}; in import "${openlane-src}/shell.nix" { + inherit pkgs; +} \ No newline at end of file From d6afc9f244ebddad5cf776efa3365d2ecab8c691 Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 13:33:48 +0300 Subject: [PATCH 4/8] OG THE MISSED TREE --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5aa13cc..4b1b9cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,7 +94,7 @@ jobs: - name: Setup Nix uses: cachix/install-nix-action@v22 with: - nix_path: nixpkgs=channel:nixos-22.11 + nix_path: nixpkgs=channel:nixos-23.05 - name: Setup Cachix uses: cachix/cachix-action@v12 with: From 3fafb47e91682e9b045ed0f2cb0dae00575e9330 Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 13:45:21 +0300 Subject: [PATCH 5/8] : ) --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b1b9cc..f06a52f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -115,6 +115,12 @@ jobs: " echo "PRODUCTS_PATH=$(echo products/*)" >> $GITHUB_ENV + - name: Upload Build Folder [TEMP] + uses: actions/upload-artifact@v3 + if: always() + with: + name: BUILD_${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }} + path: ./build - name: Upload Final Views uses: actions/upload-artifact@v3 with: From 16889d82702985f3c4c805bcb386813bdc1627ed Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 15:29:14 +0300 Subject: [PATCH 6/8] mitigate determinism issues --- Makefile | 5 ++--- dffram.py | 2 +- shell.nix | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 0596a39..1ec8f7a 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,13 @@ lint: venv/manifest.txt ./venv/bin/flake8 . venv: venv/manifest.txt -venv/manifest.txt: ./requirements_dev.txt ./requirements.txt +venv/manifest.txt: ./requirements_dev.txt rm -rf venv python3 -m venv ./venv PYTHONPATH= ./venv/bin/python3 -m pip install --upgrade pip PYTHONPATH= ./venv/bin/python3 -m pip install --upgrade wheel PYTHONPATH= ./venv/bin/python3 -m pip install --upgrade\ - -r ./requirements_dev.txt\ - -r ./requirements.txt + -r ./requirements_dev.txt PYTHONPATH= ./venv/bin/python3 -m pip freeze > $@ touch venv/manifest.txt diff --git a/dffram.py b/dffram.py index 73e2c57..a52a4f9 100755 --- a/dffram.py +++ b/dffram.py @@ -355,7 +355,7 @@ def main( # PDN "DESIGN_IS_CORE": False, }, - design_dir=build_dir, + design_dir=os.path.abspath(build_dir), ) final_state = dffram_flow.start( diff --git a/shell.nix b/shell.nix index 9cbe8fe..b49eef5 100644 --- a/shell.nix +++ b/shell.nix @@ -18,8 +18,8 @@ let openlane-src = pkgs.fetchFromGitHub { owner = "efabless"; repo = "openlane2"; - rev = "0c05b7ea04eac74203a9a33f8a8b519f33220f2f"; - sha256 = "sha256-fjYz6HuIYrGbkb1oA6wPIlEjieYU5hu0aygYQFj2d2I="; + rev = "fbbe66691c281da8b39eb74bbf83309959477d8a"; + sha256 = "sha256-G6SQAxmd2RUWqDnGCYNkBungO8dWvMT9rNiDZ+uQQYU="; }; in import "${openlane-src}/shell.nix" { inherit pkgs; } \ No newline at end of file From 09df5b32cbadf159e514afc2a8fa93a96eca813a Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 15:37:54 +0300 Subject: [PATCH 7/8] Move fills to SCL tech file + remove ef cells --- placeram/cli.py | 7 +++---- platforms/sky130A/fill_cells.yml | 5 ----- platforms/sky130A/sky130_fd_sc_hd/tech.yml | 11 ++++++++--- 3 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 platforms/sky130A/fill_cells.yml diff --git a/placeram/cli.py b/placeram/cli.py index ac7fb24..b5cbd95 100644 --- a/placeram/cli.py +++ b/placeram/cli.py @@ -239,8 +239,8 @@ def cli( odb_in, ): pdk, scl, blocks = building_blocks.split(":") - fill_cells_file = os.path.join(".", "platforms", pdk, "fill_cells.yml") - if not os.path.isfile(fill_cells_file): + platform_tech_file = os.path.join(".", "platforms", pdk, scl, "tech.yml") + if not os.path.isfile(platform_tech_file): eprint("Platform %s not found." % pdk) exit(os.EX_NOINPUT) @@ -264,7 +264,6 @@ def cli( "WARNING: Word length must be a non-zero multiple of 8. Results may be unexpected." ) - platform_tech_file = os.path.join(".", "platforms", pdk, scl, "tech.yml") platform_tech_config = yaml.safe_load(open(platform_tech_file)) tap_distance = platform_tech_config["tap_distance"] @@ -272,7 +271,7 @@ def cli( for input in [odb_in]: check_readable(input) - fill_cell_data = yaml.load(open(fill_cells_file).read(), Loader=yaml.SafeLoader) + fill_cell_data = platform_tech_config["fills"] placer = Placer( odb_in, diff --git a/platforms/sky130A/fill_cells.yml b/platforms/sky130A/fill_cells.yml deleted file mode 100644 index 0655728..0000000 --- a/platforms/sky130A/fill_cells.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Non-logical Cells -decap: sky130_\w+__decap_(\d+) -fill: sky130_\w+__fill_(\d+) -tap: sky130_\w+__tapvpwrvgnd_(\d+) -diode: sky130_\w+__diode_(\d+) diff --git a/platforms/sky130A/sky130_fd_sc_hd/tech.yml b/platforms/sky130A/sky130_fd_sc_hd/tech.yml index b65aa9a..7b0edf5 100644 --- a/platforms/sky130A/sky130_fd_sc_hd/tech.yml +++ b/platforms/sky130A/sky130_fd_sc_hd/tech.yml @@ -1,5 +1,5 @@ tap_distance: 15 -metal_layers: +metal_layers: hor-layer: met3 ver-layer: met2 rt-max-layer: met4 @@ -7,11 +7,11 @@ site: width: 0.46 height: 2.72 name: unithd -tie: +tie: tie_lo_cell: sky130_fd_sc_hd__conb_1 tie_lo_port: LO tie_hi_cell: sky130_fd_sc_hd__conb_1 - tie_hi_port: HI + tie_hi_port: HI sta: driving_cell: name: sky130_fd_sc_hd__inv_8 @@ -30,3 +30,8 @@ sta: "1024x*": 16.5 "2048x*": 16.5 rf: {} +fills: + decap: sky130_fd_sc_hd__decap_(\d+) + fill: sky130_fd_sc_hd__fill_(\d+) + tap: sky130_fd_sc_hd__tapvpwrvgnd_(\d+) + diode: sky130_fd_sc_hd__diode_(\d+) From 992fd781c5af71ae2b392b21136a47e0f802f0a1 Mon Sep 17 00:00:00 2001 From: Donn Date: Thu, 21 Sep 2023 15:42:15 +0300 Subject: [PATCH 8/8] Remove build folder --- .github/workflows/main.yml | 12 ++++++------ shell.nix | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f06a52f..53e70c7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -115,12 +115,12 @@ jobs: " echo "PRODUCTS_PATH=$(echo products/*)" >> $GITHUB_ENV - - name: Upload Build Folder [TEMP] - uses: actions/upload-artifact@v3 - if: always() - with: - name: BUILD_${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }} - path: ./build + # - name: Upload Build Folder [TEMP] + # uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: BUILD_${{ matrix.count }}x${{ matrix.width }}_${{ matrix.variant }} + # path: ./build - name: Upload Final Views uses: actions/upload-artifact@v3 with: diff --git a/shell.nix b/shell.nix index b49eef5..9cbe8fe 100644 --- a/shell.nix +++ b/shell.nix @@ -18,8 +18,8 @@ let openlane-src = pkgs.fetchFromGitHub { owner = "efabless"; repo = "openlane2"; - rev = "fbbe66691c281da8b39eb74bbf83309959477d8a"; - sha256 = "sha256-G6SQAxmd2RUWqDnGCYNkBungO8dWvMT9rNiDZ+uQQYU="; + rev = "0c05b7ea04eac74203a9a33f8a8b519f33220f2f"; + sha256 = "sha256-fjYz6HuIYrGbkb1oA6wPIlEjieYU5hu0aygYQFj2d2I="; }; in import "${openlane-src}/shell.nix" { inherit pkgs; } \ No newline at end of file