From ae1f77dee5d9a93d685ef61033f4f2e80acbb6d4 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 25 Jun 2025 16:55:53 -0700 Subject: [PATCH 01/45] github action --- .github/event.json | 1 + .github/workflows/openroad-flow.yml | 63 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/event.json create mode 100644 .github/workflows/openroad-flow.yml diff --git a/.github/event.json b/.github/event.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.github/event.json @@ -0,0 +1 @@ +{} diff --git a/.github/workflows/openroad-flow.yml b/.github/workflows/openroad-flow.yml new file mode 100644 index 0000000..f97e0bf --- /dev/null +++ b/.github/workflows/openroad-flow.yml @@ -0,0 +1,63 @@ +name: Run OpenROAD Flow + +on: + push: + branches: [main] + pull_request: + +jobs: + openroad-flow: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: link ORFS files + run: | + ln -s OpenROAD-flow-scripts/flow/util . + ln -s OpenROAD-flow-scripts/flow/scripts . + ln -s OpenROAD-flow-scripts/flow/platforms . + ln -s OpenROAD-flow-scripts/flow/Makefile . + + - name: Determine ORFS tag + id: get_tag + run: | + cd OpenROAD-flow-scripts + tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest") + echo "Using ORFS Docker tag: $tag" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + + - name: Run ORFS Docker container + run: | + tag="${{ steps.get_tag.outputs.tag }}" + echo "Using Docker tag: $tag" + + docker run --rm \ + -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ + -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ + -w /OpenROAD-flow-scripts \ + openroad/orfs:$tag \ + bash -c "cd /OpenROAD-flow-scripts/UCSC_ML_suite && make DESIGN_CONFIG=./designs/nangate45/gcd/config.mk" + + # - name: Run ORFS Docker container + # run: | + # tag="${{ steps.get_tag.outputs.tag }}" + # echo "Using Docker tag: $tag" + + # docker run --rm \ + # -v ${{ github.workspace }}/OpenROAD-flow-scripts:/OpenROAD-flow-scripts/flow \ + # -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ + # -w /OpenROAD-flow-scripts/UCSC_ML_suite \ + # openroad/orfs:$tag \ + # bash -c "\ + # ln -s /OpenROAD-flow-scripts/flow/util . && \ + # ln -s /OpenROAD-flow-scripts/flow/scripts . && \ + # ln -s /OpenROAD-flow-scripts/flow/platforms . && \ + # ln -s /OpenROAD-flow-scripts/flow/Makefile . && \ + # ln -s /OpenROAD-flow-scripts/flow/utils /OpenROAD-flow-scripts/utils && \ + # ls -la && \ + # make DESIGN_CONFIG=./designs/nangate45/gcd/config.mk" + \ No newline at end of file From b3a747d387b58f2b2d881d8984b219f4c3b81de8 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:19:23 -0700 Subject: [PATCH 02/45] test action --- .github/workflows/main.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6c53717 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,14 @@ +name: Push Workflow + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run a sample command + run: echo "This runs on every push" From d46a7d0c3a40d8381e32300e78b51a6a903025d9 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:20:46 -0700 Subject: [PATCH 03/45] test push --- .github/event.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/event.json diff --git a/.github/event.json b/.github/event.json deleted file mode 100644 index 0967ef4..0000000 --- a/.github/event.json +++ /dev/null @@ -1 +0,0 @@ -{} From a3de29cf3c6ea26f5055ec8d155252805eb2d49a Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:24:42 -0700 Subject: [PATCH 04/45] ls --- .github/workflows/main.yml | 6 ++- .github/workflows/openroad-flow.yml | 63 ----------------------------- 2 files changed, 4 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/openroad-flow.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c53717..53573b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: recursive - - name: Run a sample command - run: echo "This runs on every push" + - name: Run ls + run: ls -la \ No newline at end of file diff --git a/.github/workflows/openroad-flow.yml b/.github/workflows/openroad-flow.yml deleted file mode 100644 index f97e0bf..0000000 --- a/.github/workflows/openroad-flow.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Run OpenROAD Flow - -on: - push: - branches: [main] - pull_request: - -jobs: - openroad-flow: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: link ORFS files - run: | - ln -s OpenROAD-flow-scripts/flow/util . - ln -s OpenROAD-flow-scripts/flow/scripts . - ln -s OpenROAD-flow-scripts/flow/platforms . - ln -s OpenROAD-flow-scripts/flow/Makefile . - - - name: Determine ORFS tag - id: get_tag - run: | - cd OpenROAD-flow-scripts - tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest") - echo "Using ORFS Docker tag: $tag" - echo "tag=$tag" >> "$GITHUB_OUTPUT" - - - name: Run ORFS Docker container - run: | - tag="${{ steps.get_tag.outputs.tag }}" - echo "Using Docker tag: $tag" - - docker run --rm \ - -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ - -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ - -w /OpenROAD-flow-scripts \ - openroad/orfs:$tag \ - bash -c "cd /OpenROAD-flow-scripts/UCSC_ML_suite && make DESIGN_CONFIG=./designs/nangate45/gcd/config.mk" - - # - name: Run ORFS Docker container - # run: | - # tag="${{ steps.get_tag.outputs.tag }}" - # echo "Using Docker tag: $tag" - - # docker run --rm \ - # -v ${{ github.workspace }}/OpenROAD-flow-scripts:/OpenROAD-flow-scripts/flow \ - # -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ - # -w /OpenROAD-flow-scripts/UCSC_ML_suite \ - # openroad/orfs:$tag \ - # bash -c "\ - # ln -s /OpenROAD-flow-scripts/flow/util . && \ - # ln -s /OpenROAD-flow-scripts/flow/scripts . && \ - # ln -s /OpenROAD-flow-scripts/flow/platforms . && \ - # ln -s /OpenROAD-flow-scripts/flow/Makefile . && \ - # ln -s /OpenROAD-flow-scripts/flow/utils /OpenROAD-flow-scripts/utils && \ - # ls -la && \ - # make DESIGN_CONFIG=./designs/nangate45/gcd/config.mk" - \ No newline at end of file From b2838f6cc7b60a7706cd7bdb8a90253b97ff26ac Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:29:36 -0700 Subject: [PATCH 05/45] link ORFS files --- .github/workflows/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 53573b1..59ddb4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - submodules: recursive + submodules: recursive + + - name: link ORFS files + run: | + ln -s OpenROAD-flow-scripts/flow/util . + ln -s OpenROAD-flow-scripts/flow/scripts . + ln -s OpenROAD-flow-scripts/flow/platforms . + ln -s OpenROAD-flow-scripts/flow/Makefile . - name: Run ls run: ls -la \ No newline at end of file From a4f52afdd9cb3fd17d3c2ad8bb645e40fcde1064 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:34:23 -0700 Subject: [PATCH 06/45] test run scripts --- .github/workflows/main.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59ddb4a..f00b789 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,12 +12,18 @@ jobs: with: submodules: recursive - - name: link ORFS files - run: | - ln -s OpenROAD-flow-scripts/flow/util . - ln -s OpenROAD-flow-scripts/flow/scripts . - ln -s OpenROAD-flow-scripts/flow/platforms . - ln -s OpenROAD-flow-scripts/flow/Makefile . + # - name: link ORFS files + # run: | + # ln -s OpenROAD-flow-scripts/flow/util . + # ln -s OpenROAD-flow-scripts/flow/scripts . + # ln -s OpenROAD-flow-scripts/flow/platforms . + # ln -s OpenROAD-flow-scripts/flow/Makefile . + + - name: Setup + run: ./setup.sh - name: Run ls - run: ls -la \ No newline at end of file + run: ls -la + + - name: Run orfs + run: ./runorfs.sh \ No newline at end of file From d296c74b0724e26f8a1d1fe340a6ade113e31e36 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:37:25 -0700 Subject: [PATCH 07/45] test without checkout submodules --- .github/workflows/main.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f00b789..0b2f9e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,21 +9,13 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - submodules: recursive - - # - name: link ORFS files - # run: | - # ln -s OpenROAD-flow-scripts/flow/util . - # ln -s OpenROAD-flow-scripts/flow/scripts . - # ln -s OpenROAD-flow-scripts/flow/platforms . - # ln -s OpenROAD-flow-scripts/flow/Makefile . + # with: + # submodules: recursive + - name: Run ls + run: ls -la - - name: Setup + - name: Run setup script run: ./setup.sh - name: Run ls - run: ls -la - - - name: Run orfs - run: ./runorfs.sh \ No newline at end of file + run: ls -la \ No newline at end of file From 9e87ef19a4136cefc0de1a5d19ff737ea0e75928 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:44:05 -0700 Subject: [PATCH 08/45] test run docker --- .github/workflows/main.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b2f9e8..aef263c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,11 +11,29 @@ jobs: uses: actions/checkout@v4 # with: # submodules: recursive - - name: Run ls - run: ls -la - name: Run setup script - run: ./setup.sh + run: ./setup.sh + + - name: Run setup script + run: ./setup.sh - - name: Run ls - run: ls -la \ No newline at end of file + - name: Determine ORFS tag + id: get_tag + run: | + cd OpenROAD-flow-scripts + tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") + echo "Using ORFS Docker tag: $tag" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + + - name: Run ORFS Docker container + run: | + tag="${{ steps.get_tag.outputs.tag }}" + echo "Using Docker tag: $tag" + + docker run --rm \ + -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ + -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ + -w /OpenROAD-flow-scripts \ + openroad/orfs:$tag \ + bash -c "cd /OpenROAD-flow-scripts/UCSC_ML_suite && make DESIGN_CONFIG=./designs/nangate45/gcd/config.mk" \ No newline at end of file From 809c18cef1b38d4c759e04335288088a1452b0fe Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:46:42 -0700 Subject: [PATCH 09/45] remove duplicate step --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aef263c..418e59d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,9 +12,6 @@ jobs: # with: # submodules: recursive - - name: Run setup script - run: ./setup.sh - - name: Run setup script run: ./setup.sh From 03dc8f2a36d2878c0514dfc4890e0b3bf542d6d4 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:54:04 -0700 Subject: [PATCH 10/45] test docker --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 418e59d..f600864 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,8 +9,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - # with: - # submodules: recursive - name: Run setup script run: ./setup.sh @@ -20,7 +18,6 @@ jobs: run: | cd OpenROAD-flow-scripts tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") - echo "Using ORFS Docker tag: $tag" echo "tag=$tag" >> "$GITHUB_OUTPUT" - name: Run ORFS Docker container @@ -33,4 +30,7 @@ jobs: -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ -w /OpenROAD-flow-scripts \ openroad/orfs:$tag \ - bash -c "cd /OpenROAD-flow-scripts/UCSC_ML_suite && make DESIGN_CONFIG=./designs/nangate45/gcd/config.mk" \ No newline at end of file + bash -c "cd /OpenROAD-flow-scripts/UCSC_ML_suite && ls -la" + + - name: Run ls + run: ls -la \ No newline at end of file From 524fa976b78a8e6c61348f6528e6bcdc8da03446 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 12:56:45 -0700 Subject: [PATCH 11/45] test docker persistance --- .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 f600864..1c77c65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ -w /OpenROAD-flow-scripts \ openroad/orfs:$tag \ - bash -c "cd /OpenROAD-flow-scripts/UCSC_ML_suite && ls -la" + bash -c "ls -la" - name: Run ls run: ls -la \ No newline at end of file From cd5c14626cac1542dc2d526a3381a7037adfc975 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 13:05:34 -0700 Subject: [PATCH 12/45] action runs flow on every design every push --- .github/workflows/main.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c77c65..5dd72e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,18 +19,19 @@ jobs: cd OpenROAD-flow-scripts tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") echo "tag=$tag" >> "$GITHUB_OUTPUT" - - - name: Run ORFS Docker container + + - name: Run ORFS for all designs run: | - tag="${{ steps.get_tag.outputs.tag }}" - echo "Using Docker tag: $tag" - - docker run --rm \ - -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ - -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ - -w /OpenROAD-flow-scripts \ - openroad/orfs:$tag \ - bash -c "ls -la" - - - name: Run ls - run: ls -la \ No newline at end of file + tag="${{ steps.get_tag.outputs.tag }}" + docker run --rm \ + -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ + -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ + -w /OpenROAD-flow-scripts \ + openroad/orfs:$tag \ + bash -c ' + cd UCSC_ML_suite + for config in ./designs/nangate45/*/config.mk ./designs/asap7/*/config.mk ./designs/sky130hd/*/config.mk; do + echo "Running design: $config" + make DESIGN_CONFIG="$config" + done + ' \ No newline at end of file From 73d7b52c936bdf70fae929f80469eff18cb9cb46 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 13:21:56 -0700 Subject: [PATCH 13/45] list designs --- .github/workflows/main.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5dd72e3..b9f31c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,14 +24,20 @@ jobs: run: | tag="${{ steps.get_tag.outputs.tag }}" docker run --rm \ - -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ - -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ - -w /OpenROAD-flow-scripts \ - openroad/orfs:$tag \ - bash -c ' + -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ + -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ + -w /OpenROAD-flow-scripts \ + openroad/orfs:$tag \ + bash -c ' cd UCSC_ML_suite - for config in ./designs/nangate45/*/config.mk ./designs/asap7/*/config.mk ./designs/sky130hd/*/config.mk; do - echo "Running design: $config" - make DESIGN_CONFIG="$config" + + configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) + echo "Found the following design config files:" + echo "$configs" + echo "" + + for config in $configs; do + echo "Running design: $config" + make DESIGN_CONFIG="$config" done - ' \ No newline at end of file + ' From 111a0dd83d05f9a15511dc4dd7ffec8600e3428b Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 13:36:28 -0700 Subject: [PATCH 14/45] print list at end --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9f31c0..3126928 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,12 +32,11 @@ jobs: cd UCSC_ML_suite configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) - echo "Found the following design config files:" - echo "$configs" - echo "" for config in $configs; do echo "Running design: $config" make DESIGN_CONFIG="$config" done + + echo "$configs" ' From cb4f8e24bf6f4a684376f381900470666e1d3e92 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Mon, 30 Jun 2025 15:14:02 -0700 Subject: [PATCH 15/45] remove print --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3126928..c5fb5fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,4 @@ jobs: echo "Running design: $config" make DESIGN_CONFIG="$config" done - - echo "$configs" ' From b5245dd18c503e85ea9f8188cf51c3b8fc9261fe Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 18:05:18 -0700 Subject: [PATCH 16/45] mark repo safe to fix dubious ownership error --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c5fb5fb..6e36685 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,10 @@ jobs: uses: actions/checkout@v4 - name: Run setup script - run: ./setup.sh + run: ./setup.sh + + - name: Mark repo as safe + run: git config --global --add safe.directory /OpenROAD-flow-scripts/UCSC_ML_suite - name: Determine ORFS tag id: get_tag From d2c585460cbdf3021ca1a27a1665d1c0c1fedbef Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 18:09:28 -0700 Subject: [PATCH 17/45] change safe repo line --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e36685..aa1dc69 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,10 +11,7 @@ jobs: uses: actions/checkout@v4 - name: Run setup script - run: ./setup.sh - - - name: Mark repo as safe - run: git config --global --add safe.directory /OpenROAD-flow-scripts/UCSC_ML_suite + run: ./setup.sh - name: Determine ORFS tag id: get_tag @@ -32,6 +29,7 @@ jobs: -w /OpenROAD-flow-scripts \ openroad/orfs:$tag \ bash -c ' + git config --global --add safe.directory /OpenROAD-flow-scripts/UCSC_ML_suite cd UCSC_ML_suite configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) From fb177df8a70574c8f1d38cf3d38d2954c48ebd81 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 18:48:02 -0700 Subject: [PATCH 18/45] only run one design for testing --- .github/workflows/main.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa1dc69..6aa06e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,10 +32,16 @@ jobs: git config --global --add safe.directory /OpenROAD-flow-scripts/UCSC_ML_suite cd UCSC_ML_suite + # Only run a single design for testing + make DESIGN_CONFIG=./designs/nangate45/lfsr_top/config.mk + configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) for config in $configs; do echo "Running design: $config" - make DESIGN_CONFIG="$config" + + # Uncomment the line below to actually run the designs + # make DESIGN_CONFIG="$config" + done ' From d0b93cc4348bde2d05fd917c40728689b4497d86 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 20:07:41 -0700 Subject: [PATCH 19/45] all paths safe --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6aa06e8..f6c6a6e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,11 +29,11 @@ jobs: -w /OpenROAD-flow-scripts \ openroad/orfs:$tag \ bash -c ' - git config --global --add safe.directory /OpenROAD-flow-scripts/UCSC_ML_suite + git config --global --add safe.directory "*" cd UCSC_ML_suite # Only run a single design for testing - make DESIGN_CONFIG=./designs/nangate45/lfsr_top/config.mk + # make DESIGN_CONFIG=./designs/nangate45/lfsr_top/config.mk configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) @@ -41,7 +41,7 @@ jobs: echo "Running design: $config" # Uncomment the line below to actually run the designs - # make DESIGN_CONFIG="$config" + make DESIGN_CONFIG="$config" done ' From 74b6bf4c4440e2b90ec30bf070a71da0c107d14f Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 20:33:36 -0700 Subject: [PATCH 20/45] script to extract results and create table in readme --- .github/workflows/main.yml | 53 +++++++++++- extract_results.py | 166 +++++++++++++++++++++++++++++++++++++ 2 files changed, 216 insertions(+), 3 deletions(-) create mode 100755 extract_results.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6c6a6e..65cc4ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,12 @@ jobs: uses: actions/checkout@v4 - name: Run setup script - run: ./setup.sh + run: ./setup.sh + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' - name: Determine ORFS tag id: get_tag @@ -33,7 +38,7 @@ jobs: cd UCSC_ML_suite # Only run a single design for testing - # make DESIGN_CONFIG=./designs/nangate45/lfsr_top/config.mk + make DESIGN_CONFIG=./designs/nangate45/lfsr_top/config.mk configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) @@ -41,7 +46,49 @@ jobs: echo "Running design: $config" # Uncomment the line below to actually run the designs - make DESIGN_CONFIG="$config" + # make DESIGN_CONFIG="$config" done ' + + - name: Extract and update results + run: | + echo "Extracting results from OpenROAD runs..." + + # Check if the script exists + if [ ! -f "extract_results.py" ]; then + echo "Error: extract_results.py not found" + exit 1 + fi + + # Run the extraction script + python3 extract_results.py --base-dir . --readme README.md + + # Show a preview of the results + echo "Generated results table preview:" + if grep -A 10 "OpenROAD Flow Results" README.md; then + echo "✅ Results table successfully updated" + else + echo "⚠️ No results table found in README.md" + fi + + # Show summary statistics + if [ -d "logs" ]; then + total_reports=$(find logs -name "6_report.json" | wc -l) + echo "📊 Found $total_reports completed design runs" + fi + + - name: Commit and push results + if: github.ref == 'refs/heads/main' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + # Check if there are any changes to commit + if git diff --quiet; then + echo "No changes to commit" + else + git add README.md + git commit -m "Update OpenROAD flow results [skip ci]" || echo "No changes to commit" + git push + fi diff --git a/extract_results.py b/extract_results.py new file mode 100755 index 0000000..5bb6321 --- /dev/null +++ b/extract_results.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 + +import json +import os +import sys +from pathlib import Path +from datetime import datetime +import argparse + + +def extract_key_metrics(report_path): + """Extract key metrics from a report json file.""" + try: + with open(report_path, 'r') as f: + data = json.load(f) + + metrics = { + 'design_name': '', + 'platform': '', + 'total_area': data.get('finish__design__core__area', 'N/A'), + 'utilization': f"{data.get('finish__design__instance__utilization', 0) * 100:.1f}%" if data.get('finish__design__instance__utilization') else 'N/A', + 'instance_count': data.get('finish__design__instance__count', 'N/A'), + 'setup_tns': data.get('finish__timing__setup__tns', 'N/A'), + 'setup_wns': data.get('finish__timing__setup__ws', 'N/A'), + 'hold_tns': data.get('finish__timing__hold__tns', 'N/A'), + 'hold_wns': data.get('finish__timing__hold__ws', 'N/A'), + 'total_power': f"{data.get('finish__power__total', 0) * 1000:.3f} mW" if data.get('finish__power__total') else 'N/A', + 'clock_skew': data.get('finish__clock__skew__setup', 'N/A'), + 'warnings': data.get('finish__flow__warnings__count', 'N/A'), + 'errors': data.get('finish__flow__errors__count', 'N/A'), + 'status': 'Pass' if data.get('finish__flow__errors__count', 1) == 0 else 'Fail' + } + + return metrics + except (FileNotFoundError, json.JSONDecodeError, KeyError) as e: + print(f"Error reading {report_path}: {e}") + return None + + +def find_report_files(base_dir): + """Find all 6_report.json files in the results directory structure.""" + report_files = [] + base_path = Path(base_dir) + + for report_file in base_path.rglob("logs/**/6_report.json"): + parts = report_file.parts + if len(parts) >= 4: + # Extract platform and design from path + logs_idx = next(i for i, part in enumerate( + parts) if part == 'logs') + if logs_idx + 3 < len(parts): + platform = parts[logs_idx + 1] + design = parts[logs_idx + 2] + report_files.append({ + 'path': report_file, + 'platform': platform, + 'design': design + }) + + return report_files + + +def generate_markdown_table(results): + """Generate a markdown table from the results.""" + if not results: + return "No results found.\n" + + # Table header + table = """ +## OpenROAD Flow Results + +Last updated: {} + +| Design | Platform | Status | Area (μm²) | Utilization | Instances | Setup TNS | Setup WNS | Hold TNS | Hold WNS | Power | Clock Skew | Warnings | Errors | +|--------|----------|--------|------------|-------------|-----------|-----------|-----------|----------|----------|-------|------------|----------|--------| +""".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S UTC")) + + # Sort results by platform, then design name + sorted_results = sorted(results, key=lambda x: ( + x['platform'], x['design_name'])) + + # Table rows + for result in sorted_results: + table += f"| {result['design_name']} | {result['platform']} | {result['status']} | {result['total_area']} | {result['utilization']} | {result['instance_count']} | {result['setup_tns']} | {result['setup_wns']} | {result['hold_tns']} | {result['hold_wns']} | {result['total_power']} | {result['clock_skew']} | {result['warnings']} | {result['errors']} |\n" + + table += "\n" + return table + + +def update_readme(readme_path, results_table): + """Update the README.md file with the results table.""" + try: + with open(readme_path, 'r') as f: + content = f.read() + + # Find the marker or add one + start_marker = "" + end_marker = "" + + if start_marker in content and end_marker in content: + # Replace existing table + start_idx = content.find(start_marker) + end_idx = content.find(end_marker) + len(end_marker) + new_content = (content[:start_idx] + + start_marker + "\n" + + results_table + + end_marker + + content[end_idx:]) + else: + # Add table at the end + new_content = content + "\n" + start_marker + \ + "\n" + results_table + end_marker + "\n" + + with open(readme_path, 'w') as f: + f.write(new_content) + + print(f"Updated {readme_path} with results table") + + except Exception as e: + print(f"Error updating README: {e}") + + +def main(): + parser = argparse.ArgumentParser( + description='Extract OpenROAD metrics and update README') + parser.add_argument('--base-dir', default='.', + help='Base directory to search for results (default: current directory)') + parser.add_argument('--readme', default='README.md', + help='Path to README.md file to update (default: README.md)') + parser.add_argument('--output', default=None, + help='Output file for results table (default: update README)') + + args = parser.parse_args() + + # Find all report files + report_files = find_report_files(args.base_dir) + print(f"Found {len(report_files)} report files") + + # Extract metrics from each report + results = [] + for report_info in report_files: + print( + f"Processing {report_info['platform']}/{report_info['design']}...") + metrics = extract_key_metrics(report_info['path']) + if metrics: + metrics['design_name'] = report_info['design'] + metrics['platform'] = report_info['platform'] + results.append(metrics) + + # Generate markdown table + table = generate_markdown_table(results) + + if args.output: + # Write to specified output file + with open(args.output, 'w') as f: + f.write(table) + print(f"Results written to {args.output}") + else: + # Update README + update_readme(args.readme, table) + + print(f"Processed {len(results)} designs successfully") + + +if __name__ == "__main__": + main() From 98ee3dbd72f83163369493fa068fae482dd4ca6f Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 20:59:20 -0700 Subject: [PATCH 21/45] more logging for push step --- .github/workflows/main.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65cc4ea..e3e21b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,28 +67,35 @@ jobs: # Show a preview of the results echo "Generated results table preview:" if grep -A 10 "OpenROAD Flow Results" README.md; then - echo "✅ Results table successfully updated" + echo "Results table successfully updated" else - echo "⚠️ No results table found in README.md" + echo "No results table found in README.md" fi # Show summary statistics if [ -d "logs" ]; then total_reports=$(find logs -name "6_report.json" | wc -l) - echo "📊 Found $total_reports completed design runs" + echo "Found $total_reports completed design runs" fi - name: Commit and push results - if: github.ref == 'refs/heads/main' run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + echo "Current ref: ${{ github.ref }}" + echo "Branch: ${{ github.ref_name }}" - # Check if there are any changes to commit - if git diff --quiet; then - echo "No changes to commit" + if [ "${{ github.ref }}" = "refs/heads/main" ]; then + echo "Running on main branch - will commit results" + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + # Check if there are any changes to commit + if git diff --quiet; then + echo "No changes to commit" + else + git add README.md + git commit -m "Update OpenROAD flow results [skip ci]" || echo "No changes to commit" + git push + fi else - git add README.md - git commit -m "Update OpenROAD flow results [skip ci]" || echo "No changes to commit" - git push + echo "Skipping commit - not on main branch (current: ${{ github.ref }})" fi From d241d62226470c77bad84afd64334b1796cb6a2d Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 21:32:54 -0700 Subject: [PATCH 22/45] made action resilient to failed designs --- .github/workflows/main.yml | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3e21b2..ae1feaf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,21 +34,45 @@ jobs: -w /OpenROAD-flow-scripts \ openroad/orfs:$tag \ bash -c ' + set +e git config --global --add safe.directory "*" cd UCSC_ML_suite - # Only run a single design for testing - make DESIGN_CONFIG=./designs/nangate45/lfsr_top/config.mk + # Initialize counters + success_count=0 + failure_count=0 + total_count=0 configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) for config in $configs; do - echo "Running design: $config" - - # Uncomment the line below to actually run the designs - # make DESIGN_CONFIG="$config" - + echo "" + echo "====================" + echo "Running design: $config" + echo "====================" + + ((total_count++)) + + if make DESIGN_CONFIG="$config"; then + echo "Design $config completed successfully" + ((success_count++)) + else + exit_code=$? + echo "Design $config failed (exit code: $exit_code)" + ((failure_count++)) + echo "Continuing with remaining designs..." + fi done + + echo "" + echo "====================" + echo "SUMMARY:" + echo "Total designs: $total_count" + echo "Successful: $success_count" + echo "Failed: $failure_count" + echo "====================" + + exit 0 ' - name: Extract and update results From 0c82f63d30bca9fafc49c50a10f5241c0d7b53c7 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 23 Jul 2025 21:39:52 -0700 Subject: [PATCH 23/45] continue on error in script --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae1feaf..987bf2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,12 @@ jobs: fi # Run the extraction script - python3 extract_results.py --base-dir . --readme README.md + if python3 extract_results.py --base-dir . --readme README.md; then + echo "Results extraction completed successfully" + else + echo "Results extraction failed, but continuing with workflow" + echo "This may happen if no designs completed or there were format issues" + fi # Show a preview of the results echo "Generated results table preview:" From f981fef262886ae49e9329e8ebf12bf0e85bd115 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Fri, 25 Jul 2025 19:34:57 -0700 Subject: [PATCH 24/45] save results to QOR.md --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 987bf2b..57cad51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,7 @@ jobs: fi # Run the extraction script - if python3 extract_results.py --base-dir . --readme README.md; then + if python3 extract_results.py --base-dir . --output QOR.md; then echo "Results extraction completed successfully" else echo "Results extraction failed, but continuing with workflow" @@ -95,10 +95,10 @@ jobs: # Show a preview of the results echo "Generated results table preview:" - if grep -A 10 "OpenROAD Flow Results" README.md; then + if grep -A 10 "OpenROAD Flow Results" QOR.md; then echo "Results table successfully updated" else - echo "No results table found in README.md" + echo "No results table found in QOR.md" fi # Show summary statistics @@ -121,7 +121,7 @@ jobs: if git diff --quiet; then echo "No changes to commit" else - git add README.md + git add QOR.md git commit -m "Update OpenROAD flow results [skip ci]" || echo "No changes to commit" git push fi From 7cfc7c3f4db9464e7e2e043738ea0157f3c1d536 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 30 Jul 2025 23:51:21 +0200 Subject: [PATCH 25/45] action to run a single design --- .github/workflows/test-single-design.yml | 115 +++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/test-single-design.yml diff --git a/.github/workflows/test-single-design.yml b/.github/workflows/test-single-design.yml new file mode 100644 index 0000000..00ab39e --- /dev/null +++ b/.github/workflows/test-single-design.yml @@ -0,0 +1,115 @@ +name: Test Single Design + +on: + workflow_dispatch: + inputs: + design_config: + description: 'Design config file to run (e.g., designs/nangate45/lfsr_top/config.mk)' + required: true + type: string + +jobs: + test-design: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run setup script + run: ./setup.sh + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Determine ORFS tag + id: get_tag + run: | + cd OpenROAD-flow-scripts + tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") + echo "tag=$tag" >> "$GITHUB_OUTPUT" + + - name: Validate design config + run: | + design_config="${{ github.event.inputs.design_config }}" + echo "Validating design config: $design_config" + + if [ ! -f "$design_config" ]; then + echo "Error: Design config file '$design_config' not found" + echo "Available design configs:" + find designs -name "config.mk" | sort + exit 1 + fi + + echo "Design config exists: $design_config" + + - name: Run single design + run: | + tag="${{ steps.get_tag.outputs.tag }}" + design_config="${{ github.event.inputs.design_config }}" + + echo "Running single design: $design_config" + echo "Using Docker image: openroad/orfs:$tag" + + docker run --rm \ + -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ + -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ + -w /OpenROAD-flow-scripts \ + openroad/orfs:$tag \ + bash -c " + set +e + git config --global --add safe.directory '*' + cd UCSC_ML_suite + + echo '====================' + echo 'Running design: $design_config' + echo '====================' + + start_time=\$(date +%s) + + if make DESIGN_CONFIG='$design_config'; then + end_time=\$(date +%s) + duration=\$((end_time - start_time)) + echo '' + echo '====================' + echo 'SUCCESS: Design completed successfully' + echo \"Duration: \${duration} seconds\" + echo '====================' + exit 0 + else + exit_code=\$? + end_time=\$(date +%s) + duration=\$((end_time - start_time)) + echo '' + echo '====================' + echo \"FAILURE: Design failed (exit code: \$exit_code)\" + echo \"Duration: \${duration} seconds\" + echo '====================' + exit \$exit_code + fi + " + + - name: Extract results + if: success() + run: | + echo "Extracting results for design: ${{ github.event.inputs.design_config }}" + + # Check if the script exists + if [ ! -f "extract_results.py" ]; then + echo "Warning: extract_results.py not found, skipping results extraction" + exit 0 + fi + + # Run the extraction script + if python3 extract_results.py --base-dir . --output QOR-test.md; then + echo "Results extraction completed successfully" + + # Show a preview of the results + echo "Generated results preview:" + if [ -f "QOR-test.md" ]; then + cat QOR-test.md + fi + else + echo "Results extraction failed, but test was successful" + fi \ No newline at end of file From 124c8bb4f3d3ba48afa5f79c2957eade3291904d Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Thu, 31 Jul 2025 18:14:19 +0200 Subject: [PATCH 26/45] save logs --- .github/workflows/test-single-design.yml | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-single-design.yml b/.github/workflows/test-single-design.yml index 00ab39e..50e6ca7 100644 --- a/.github/workflows/test-single-design.yml +++ b/.github/workflows/test-single-design.yml @@ -112,4 +112,28 @@ jobs: fi else echo "Results extraction failed, but test was successful" - fi \ No newline at end of file + fi + + # Show summary of what was generated + if [ -d "logs" ]; then + echo "Generated log files:" + find logs -name "*.log" -newer /tmp -type f 2>/dev/null | head -10 || echo "No recent log files found" + fi + + if [ -d "reports" ]; then + echo "Generated report files:" + find reports -name "*.json" -newer /tmp -type f 2>/dev/null | head -10 || echo "No recent report files found" + fi + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: design-test-results-${{ github.run_number }} + path: | + logs/ + reports/ + results/ + objects/ + QOR-test.md + retention-days: 7 \ No newline at end of file From fe6fe529e0418b4789f46222a15f379c3369682d Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Thu, 31 Jul 2025 18:16:36 +0200 Subject: [PATCH 27/45] testing file format --- .github/workflows/test-single-design.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/test-single-design.yml b/.github/workflows/test-single-design.yml index 50e6ca7..049e37a 100644 --- a/.github/workflows/test-single-design.yml +++ b/.github/workflows/test-single-design.yml @@ -113,27 +113,3 @@ jobs: else echo "Results extraction failed, but test was successful" fi - - # Show summary of what was generated - if [ -d "logs" ]; then - echo "Generated log files:" - find logs -name "*.log" -newer /tmp -type f 2>/dev/null | head -10 || echo "No recent log files found" - fi - - if [ -d "reports" ]; then - echo "Generated report files:" - find reports -name "*.json" -newer /tmp -type f 2>/dev/null | head -10 || echo "No recent report files found" - fi - - - name: Upload artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - name: design-test-results-${{ github.run_number }} - path: | - logs/ - reports/ - results/ - objects/ - QOR-test.md - retention-days: 7 \ No newline at end of file From 4e463104135915f61713ee435c78dedfd2fea6fe Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Thu, 31 Jul 2025 18:22:12 +0200 Subject: [PATCH 28/45] test workflow --- .github/workflows/manual-test.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/manual-test.yml diff --git a/.github/workflows/manual-test.yml b/.github/workflows/manual-test.yml new file mode 100644 index 0000000..d1a1bb5 --- /dev/null +++ b/.github/workflows/manual-test.yml @@ -0,0 +1,17 @@ +name: Example Manual Trigger + +on: + workflow_dispatch: + inputs: + example_input: + description: 'Example input' + required: false + default: 'default-value' + +jobs: + example_job: + runs-on: ubuntu-latest + steps: + - name: Print input + run: | + echo "Input: ${{ github.event.inputs.example_input }}" From 672007d2c1c1e4eefcc89c925fb68e989e018547 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Thu, 31 Jul 2025 18:23:30 +0200 Subject: [PATCH 29/45] test --- .github/workflows/manual-test.yml | 135 +++++++++++++++++++++++++++--- 1 file changed, 124 insertions(+), 11 deletions(-) diff --git a/.github/workflows/manual-test.yml b/.github/workflows/manual-test.yml index d1a1bb5..57cad51 100644 --- a/.github/workflows/manual-test.yml +++ b/.github/workflows/manual-test.yml @@ -1,17 +1,130 @@ -name: Example Manual Trigger +name: Push Workflow on: - workflow_dispatch: - inputs: - example_input: - description: 'Example input' - required: false - default: 'default-value' + push: jobs: - example_job: + build: runs-on: ubuntu-latest steps: - - name: Print input - run: | - echo "Input: ${{ github.event.inputs.example_input }}" + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run setup script + run: ./setup.sh + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Determine ORFS tag + id: get_tag + run: | + cd OpenROAD-flow-scripts + tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") + echo "tag=$tag" >> "$GITHUB_OUTPUT" + + - name: Run ORFS for all designs + run: | + tag="${{ steps.get_tag.outputs.tag }}" + docker run --rm \ + -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ + -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ + -w /OpenROAD-flow-scripts \ + openroad/orfs:$tag \ + bash -c ' + set +e + git config --global --add safe.directory "*" + cd UCSC_ML_suite + + # Initialize counters + success_count=0 + failure_count=0 + total_count=0 + + configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) + + for config in $configs; do + echo "" + echo "====================" + echo "Running design: $config" + echo "====================" + + ((total_count++)) + + if make DESIGN_CONFIG="$config"; then + echo "Design $config completed successfully" + ((success_count++)) + else + exit_code=$? + echo "Design $config failed (exit code: $exit_code)" + ((failure_count++)) + echo "Continuing with remaining designs..." + fi + done + + echo "" + echo "====================" + echo "SUMMARY:" + echo "Total designs: $total_count" + echo "Successful: $success_count" + echo "Failed: $failure_count" + echo "====================" + + exit 0 + ' + + - name: Extract and update results + run: | + echo "Extracting results from OpenROAD runs..." + + # Check if the script exists + if [ ! -f "extract_results.py" ]; then + echo "Error: extract_results.py not found" + exit 1 + fi + + # Run the extraction script + if python3 extract_results.py --base-dir . --output QOR.md; then + echo "Results extraction completed successfully" + else + echo "Results extraction failed, but continuing with workflow" + echo "This may happen if no designs completed or there were format issues" + fi + + # Show a preview of the results + echo "Generated results table preview:" + if grep -A 10 "OpenROAD Flow Results" QOR.md; then + echo "Results table successfully updated" + else + echo "No results table found in QOR.md" + fi + + # Show summary statistics + if [ -d "logs" ]; then + total_reports=$(find logs -name "6_report.json" | wc -l) + echo "Found $total_reports completed design runs" + fi + + - name: Commit and push results + run: | + echo "Current ref: ${{ github.ref }}" + echo "Branch: ${{ github.ref_name }}" + + if [ "${{ github.ref }}" = "refs/heads/main" ]; then + echo "Running on main branch - will commit results" + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + # Check if there are any changes to commit + if git diff --quiet; then + echo "No changes to commit" + else + git add QOR.md + git commit -m "Update OpenROAD flow results [skip ci]" || echo "No changes to commit" + git push + fi + else + echo "Skipping commit - not on main branch (current: ${{ github.ref }})" + fi From b4ba5bdb24b35ed4231e134b26079b1c625871bc Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Thu, 31 Jul 2025 18:27:07 +0200 Subject: [PATCH 30/45] remove test workflow --- .github/workflows/manual-test.yml | 130 ------------------------------ 1 file changed, 130 deletions(-) delete mode 100644 .github/workflows/manual-test.yml diff --git a/.github/workflows/manual-test.yml b/.github/workflows/manual-test.yml deleted file mode 100644 index 57cad51..0000000 --- a/.github/workflows/manual-test.yml +++ /dev/null @@ -1,130 +0,0 @@ -name: Push Workflow - -on: - push: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Run setup script - run: ./setup.sh - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Determine ORFS tag - id: get_tag - run: | - cd OpenROAD-flow-scripts - tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") - echo "tag=$tag" >> "$GITHUB_OUTPUT" - - - name: Run ORFS for all designs - run: | - tag="${{ steps.get_tag.outputs.tag }}" - docker run --rm \ - -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ - -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ - -w /OpenROAD-flow-scripts \ - openroad/orfs:$tag \ - bash -c ' - set +e - git config --global --add safe.directory "*" - cd UCSC_ML_suite - - # Initialize counters - success_count=0 - failure_count=0 - total_count=0 - - configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) - - for config in $configs; do - echo "" - echo "====================" - echo "Running design: $config" - echo "====================" - - ((total_count++)) - - if make DESIGN_CONFIG="$config"; then - echo "Design $config completed successfully" - ((success_count++)) - else - exit_code=$? - echo "Design $config failed (exit code: $exit_code)" - ((failure_count++)) - echo "Continuing with remaining designs..." - fi - done - - echo "" - echo "====================" - echo "SUMMARY:" - echo "Total designs: $total_count" - echo "Successful: $success_count" - echo "Failed: $failure_count" - echo "====================" - - exit 0 - ' - - - name: Extract and update results - run: | - echo "Extracting results from OpenROAD runs..." - - # Check if the script exists - if [ ! -f "extract_results.py" ]; then - echo "Error: extract_results.py not found" - exit 1 - fi - - # Run the extraction script - if python3 extract_results.py --base-dir . --output QOR.md; then - echo "Results extraction completed successfully" - else - echo "Results extraction failed, but continuing with workflow" - echo "This may happen if no designs completed or there were format issues" - fi - - # Show a preview of the results - echo "Generated results table preview:" - if grep -A 10 "OpenROAD Flow Results" QOR.md; then - echo "Results table successfully updated" - else - echo "No results table found in QOR.md" - fi - - # Show summary statistics - if [ -d "logs" ]; then - total_reports=$(find logs -name "6_report.json" | wc -l) - echo "Found $total_reports completed design runs" - fi - - - name: Commit and push results - run: | - echo "Current ref: ${{ github.ref }}" - echo "Branch: ${{ github.ref_name }}" - - if [ "${{ github.ref }}" = "refs/heads/main" ]; then - echo "Running on main branch - will commit results" - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - - # Check if there are any changes to commit - if git diff --quiet; then - echo "No changes to commit" - else - git add QOR.md - git commit -m "Update OpenROAD flow results [skip ci]" || echo "No changes to commit" - git push - fi - else - echo "Skipping commit - not on main branch (current: ${{ github.ref }})" - fi From 9aa7c56a541b347ff44fbe1d521f3984281e7364 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 10:59:33 -0700 Subject: [PATCH 31/45] new step to list designs --- .github/workflows/main.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57cad51..18c290d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,26 @@ jobs: tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") echo "tag=$tag" >> "$GITHUB_OUTPUT" + - name: Find and list all designs + run: | + echo "Finding all design configurations..." + configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) + + echo "" + echo "====================" + echo "DESIGNS TO BE RUN:" + echo "====================" + + count=0 + for config in $configs; do + ((count++)) + echo "$count. $config" + done + + echo "" + echo "Total designs found: $count" + echo "====================" + - name: Run ORFS for all designs run: | tag="${{ steps.get_tag.outputs.tag }}" From f8ae50e40ce6aa4cf861f42816135b765b4dd716 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 11:02:23 -0700 Subject: [PATCH 32/45] try to run designs in parallel --- .github/workflows/main.yml | 112 ++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 57 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18c290d..f150ddf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,28 @@ on: push: jobs: + find-designs: + runs-on: ubuntu-latest + outputs: + designs: ${{ steps.set-matrix.outputs.designs }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Find design configurations + id: set-matrix + run: | + configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort | jq -R -s -c 'split("\n")[:-1]') + echo "designs=$configs" >> "$GITHUB_OUTPUT" + echo "Found designs: $configs" + build: + needs: find-designs runs-on: ubuntu-latest + strategy: + matrix: + design: ${{ fromJson(needs.find-designs.outputs.designs) }} + fail-fast: false steps: - name: Checkout repository uses: actions/checkout@v4 @@ -25,75 +45,53 @@ jobs: tag=$(git describe --tags --abbrev=8 2>/dev/null || echo "latest") echo "tag=$tag" >> "$GITHUB_OUTPUT" - - name: Find and list all designs - run: | - echo "Finding all design configurations..." - configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) - - echo "" - echo "====================" - echo "DESIGNS TO BE RUN:" - echo "====================" - - count=0 - for config in $configs; do - ((count++)) - echo "$count. $config" - done - - echo "" - echo "Total designs found: $count" - echo "====================" - - - name: Run ORFS for all designs + - name: Run ORFS for design run: | tag="${{ steps.get_tag.outputs.tag }}" + design="${{ matrix.design }}" + echo "Running design: $design" + docker run --rm \ -v ${{ github.workspace }}/OpenROAD-flow-scripts/flow:/OpenROAD-flow-scripts/flow \ -v ${{ github.workspace }}:/OpenROAD-flow-scripts/UCSC_ML_suite \ -w /OpenROAD-flow-scripts \ openroad/orfs:$tag \ - bash -c ' - set +e - git config --global --add safe.directory "*" + bash -c " + set -e + git config --global --add safe.directory '*' cd UCSC_ML_suite + echo 'Running design: $design' + make DESIGN_CONFIG='$design' + " - # Initialize counters - success_count=0 - failure_count=0 - total_count=0 + - name: Upload design artifacts + uses: actions/upload-artifact@v4 + with: + name: design-results-${{ matrix.design }} + path: | + logs/ + reports/ + results/ + retention-days: 30 - configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort) + collect-results: + needs: [find-designs, build] + runs-on: ubuntu-latest + if: always() + steps: + - name: Checkout repository + uses: actions/checkout@v4 - for config in $configs; do - echo "" - echo "====================" - echo "Running design: $config" - echo "====================" - - ((total_count++)) - - if make DESIGN_CONFIG="$config"; then - echo "Design $config completed successfully" - ((success_count++)) - else - exit_code=$? - echo "Design $config failed (exit code: $exit_code)" - ((failure_count++)) - echo "Continuing with remaining designs..." - fi - done + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' - echo "" - echo "====================" - echo "SUMMARY:" - echo "Total designs: $total_count" - echo "Successful: $success_count" - echo "Failed: $failure_count" - echo "====================" - - exit 0 - ' + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + pattern: design-results-* + merge-multiple: true - name: Extract and update results run: | From 4906abf2b09ccd4e436d68c17dbd755e16590b7c Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 11:12:23 -0700 Subject: [PATCH 33/45] change artifact naming --- .github/workflows/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f150ddf..60369f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,10 +64,19 @@ jobs: make DESIGN_CONFIG='$design' " + - name: Sanitize design name for artifact + id: sanitize + run: | + design="${{ matrix.design }}" + # Replace forward slashes with dashes and remove config.mk + sanitized=$(echo "$design" | sed 's|/|-|g' | sed 's|-config\.mk$||') + echo "sanitized_name=$sanitized" >> "$GITHUB_OUTPUT" + echo "Sanitized artifact name: $sanitized" + - name: Upload design artifacts uses: actions/upload-artifact@v4 with: - name: design-results-${{ matrix.design }} + name: design-results-${{ steps.sanitize.outputs.sanitized_name }} path: | logs/ reports/ From 02df111f9cc27b608e1fcac6e47331745ca25c9b Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 12:08:08 -0700 Subject: [PATCH 34/45] save image as artifact, link in markdown --- .github/workflows/main.yml | 18 +++++++++++++++--- extract_results.py | 32 +++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60369f6..5501f3e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,7 +81,15 @@ jobs: logs/ reports/ results/ - retention-days: 30 + retention-days: 90 + + - name: Upload design image + uses: actions/upload-artifact@v4 + with: + name: design-image-${{ steps.sanitize.outputs.sanitized_name }} + path: reports/**/final_all.webp + retention-days: 90 + if: success() || failure() collect-results: needs: [find-designs, build] @@ -112,8 +120,12 @@ jobs: exit 1 fi - # Run the extraction script - if python3 extract_results.py --base-dir . --output QOR.md; then + # Run the extraction script with GitHub context + if python3 extract_results.py \ + --base-dir . \ + --output QOR.md \ + --github-repo "${{ github.repository }}" \ + --github-run-id "${{ github.run_id }}"; then echo "Results extraction completed successfully" else echo "Results extraction failed, but continuing with workflow" diff --git a/extract_results.py b/extract_results.py index 5bb6321..a6257db 100755 --- a/extract_results.py +++ b/extract_results.py @@ -60,13 +60,23 @@ def find_report_files(base_dir): return report_files -def generate_markdown_table(results): +def generate_markdown_table(results, github_repo=None, github_run_id=None): """Generate a markdown table from the results.""" if not results: return "No results found.\n" - # Table header - table = """ + # Table header - add Image column if GitHub info is provided + if github_repo and github_run_id: + table = """ +## OpenROAD Flow Results + +Last updated: {} + +| Design | Platform | Status | Area (μm²) | Utilization | Instances | Setup TNS | Setup WNS | Hold TNS | Hold WNS | Power | Clock Skew | Warnings | Errors | Image | +|--------|----------|--------|------------|-------------|-----------|-----------|-----------|----------|----------|-------|------------|----------|--------|-------| +""".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S UTC")) + else: + table = """ ## OpenROAD Flow Results Last updated: {} @@ -81,7 +91,15 @@ def generate_markdown_table(results): # Table rows for result in sorted_results: - table += f"| {result['design_name']} | {result['platform']} | {result['status']} | {result['total_area']} | {result['utilization']} | {result['instance_count']} | {result['setup_tns']} | {result['setup_wns']} | {result['hold_tns']} | {result['hold_wns']} | {result['total_power']} | {result['clock_skew']} | {result['warnings']} | {result['errors']} |\n" + if github_repo and github_run_id: + # Generate artifact name for this design's image + artifact_name = f"designs-{result['platform']}-{result['design_name']}" + artifact_url = f"https://github.com/{github_repo}/actions/runs/{github_run_id}/artifacts" + image_link = f"[�️ Image]({artifact_url})" + + table += f"| {result['design_name']} | {result['platform']} | {result['status']} | {result['total_area']} | {result['utilization']} | {result['instance_count']} | {result['setup_tns']} | {result['setup_wns']} | {result['hold_tns']} | {result['hold_wns']} | {result['total_power']} | {result['clock_skew']} | {result['warnings']} | {result['errors']} | {image_link} |\n" + else: + table += f"| {result['design_name']} | {result['platform']} | {result['status']} | {result['total_area']} | {result['utilization']} | {result['instance_count']} | {result['setup_tns']} | {result['setup_wns']} | {result['hold_tns']} | {result['hold_wns']} | {result['total_power']} | {result['clock_skew']} | {result['warnings']} | {result['errors']} |\n" table += "\n" return table @@ -129,6 +147,10 @@ def main(): help='Path to README.md file to update (default: README.md)') parser.add_argument('--output', default=None, help='Output file for results table (default: update README)') + parser.add_argument('--github-repo', default=None, + help='GitHub repository (owner/repo) for artifact links') + parser.add_argument('--github-run-id', default=None, + help='GitHub Actions run ID for artifact links') args = parser.parse_args() @@ -148,7 +170,7 @@ def main(): results.append(metrics) # Generate markdown table - table = generate_markdown_table(results) + table = generate_markdown_table(results, args.github_repo, args.github_run_id) if args.output: # Write to specified output file From 3105d48d3c59bc7bac9d68fa45868771d960538c Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 12:12:10 -0700 Subject: [PATCH 35/45] only run lfsr designs for testing --- .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 5501f3e..fd45a0a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - name: Find design configurations id: set-matrix run: | - configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | sort | jq -R -s -c 'split("\n")[:-1]') + configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | grep lfsr | sort | jq -R -s -c 'split("\n")[:-1]') echo "designs=$configs" >> "$GITHUB_OUTPUT" echo "Found designs: $configs" From f33fa8873c25082fd0d24a5f81d611e46e345d5b Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 12:15:18 -0700 Subject: [PATCH 36/45] create designs to run file --- .github/workflows/main.yml | 13 ++++++++++++- designs_to_run.txt | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 designs_to_run.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd45a0a..5717cdf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,9 +15,20 @@ jobs: - name: Find design configurations id: set-matrix run: | - configs=$(find designs/nangate45 designs/asap7 designs/sky130hd -name config.mk | grep lfsr | sort | jq -R -s -c 'split("\n")[:-1]') + # Read designs from the configuration file, filtering out comments and empty lines + configs=$(grep -v '^#' designs_to_run.txt | grep -v '^$' | sort | jq -R -s -c 'split("\n")[:-1]') echo "designs=$configs" >> "$GITHUB_OUTPUT" echo "Found designs: $configs" + + # Also validate that the config files exist + echo "Validating design configurations..." + grep -v '^#' designs_to_run.txt | grep -v '^$' | while read config; do + if [ -f "$config" ]; then + echo "✓ Found: $config" + else + echo "✗ Missing: $config" + fi + done build: needs: find-designs diff --git a/designs_to_run.txt b/designs_to_run.txt new file mode 100644 index 0000000..736360a --- /dev/null +++ b/designs_to_run.txt @@ -0,0 +1,22 @@ +# List of designs to run in CI +# One design config path per line +# Lines starting with # are comments and will be ignored + +# LFSR designs +designs/nangate45/lfsr_top/config.mk +designs/asap7/lfsr_top/config.mk +designs/sky130hd/lfsr_top/config.mk + +# Minimax designs +# designs/nangate45/minimax/config.mk +# designs/asap7/minimax/config.mk +# designs/sky130hd/minimax/config.mk + +# LiteEth designs +# designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk +# designs/nangate45/liteeth/liteeth_mac_wb_mii/config.mk +# designs/sky130hd/liteeth/liteeth_mac_axi_mii/config.mk +# designs/sky130hd/liteeth/liteeth_mac_wb_mii/config.mk + +# NyuziProcessor design +# designs/nangate45/NyuziProcessor/config.mk From 04897db1746cef1fc463c10b28825a59ef0f5871 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 12:35:15 -0700 Subject: [PATCH 37/45] only save image artifact --- .github/workflows/main.yml | 23 +++++++++++++---------- designs_to_run.txt | 4 ---- extract_results.py | 7 +++---- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5717cdf..3c83899 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,21 +84,24 @@ jobs: echo "sanitized_name=$sanitized" >> "$GITHUB_OUTPUT" echo "Sanitized artifact name: $sanitized" - - name: Upload design artifacts - uses: actions/upload-artifact@v4 - with: - name: design-results-${{ steps.sanitize.outputs.sanitized_name }} - path: | - logs/ - reports/ - results/ - retention-days: 90 + - name: Prepare image for upload + run: | + # Find and copy the final_all.webp image to a flat location + mkdir -p image_output + image_file=$(find reports -name "final_all.webp" | head -1) + if [ -n "$image_file" ]; then + cp "$image_file" "image_output/final_all.webp" + echo "Image found and copied: $image_file" + else + echo "No final_all.webp image found" + fi + if: success() || failure() - name: Upload design image uses: actions/upload-artifact@v4 with: name: design-image-${{ steps.sanitize.outputs.sanitized_name }} - path: reports/**/final_all.webp + path: image_output/final_all.webp retention-days: 90 if: success() || failure() diff --git a/designs_to_run.txt b/designs_to_run.txt index 736360a..763f972 100644 --- a/designs_to_run.txt +++ b/designs_to_run.txt @@ -1,7 +1,3 @@ -# List of designs to run in CI -# One design config path per line -# Lines starting with # are comments and will be ignored - # LFSR designs designs/nangate45/lfsr_top/config.mk designs/asap7/lfsr_top/config.mk diff --git a/extract_results.py b/extract_results.py index a6257db..6379c90 100755 --- a/extract_results.py +++ b/extract_results.py @@ -93,10 +93,9 @@ def generate_markdown_table(results, github_repo=None, github_run_id=None): for result in sorted_results: if github_repo and github_run_id: # Generate artifact name for this design's image - artifact_name = f"designs-{result['platform']}-{result['design_name']}" - artifact_url = f"https://github.com/{github_repo}/actions/runs/{github_run_id}/artifacts" - image_link = f"[�️ Image]({artifact_url})" - + artifact_url = f"https://github.com/{github_repo}/actions/runs/{github_run_id}" + image_link = f"[Download]({artifact_url})" + table += f"| {result['design_name']} | {result['platform']} | {result['status']} | {result['total_area']} | {result['utilization']} | {result['instance_count']} | {result['setup_tns']} | {result['setup_wns']} | {result['hold_tns']} | {result['hold_wns']} | {result['total_power']} | {result['clock_skew']} | {result['warnings']} | {result['errors']} | {image_link} |\n" else: table += f"| {result['design_name']} | {result['platform']} | {result['status']} | {result['total_area']} | {result['utilization']} | {result['instance_count']} | {result['setup_tns']} | {result['setup_wns']} | {result['hold_tns']} | {result['hold_wns']} | {result['total_power']} | {result['clock_skew']} | {result['warnings']} | {result['errors']} |\n" From 13309bd34a6414f6abf9947f5d1a043dac695f1c Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 12:42:43 -0700 Subject: [PATCH 38/45] fix broken artifact --- .github/workflows/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c83899..3902bf4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,6 +84,14 @@ jobs: echo "sanitized_name=$sanitized" >> "$GITHUB_OUTPUT" echo "Sanitized artifact name: $sanitized" + - name: Upload design logs for results + uses: actions/upload-artifact@v4 + with: + name: design-logs-${{ steps.sanitize.outputs.sanitized_name }} + path: logs/ + retention-days: 30 + if: success() || failure() + - name: Prepare image for upload run: | # Find and copy the final_all.webp image to a flat location @@ -121,7 +129,7 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 with: - pattern: design-results-* + pattern: design-logs-* merge-multiple: true - name: Extract and update results From 2f42657c805a3c4ecd867b929c74a330fdaf31d4 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 12:49:27 -0700 Subject: [PATCH 39/45] try to pass artifact id between jobs --- .github/workflows/main.yml | 43 +++++++++++++++++++++++++++++++++++++- extract_results.py | 34 +++++++++++++++++++++++++----- 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3902bf4..1d31cb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -106,6 +106,7 @@ jobs: if: success() || failure() - name: Upload design image + id: upload-image uses: actions/upload-artifact@v4 with: name: design-image-${{ steps.sanitize.outputs.sanitized_name }} @@ -113,6 +114,28 @@ jobs: retention-days: 90 if: success() || failure() + - name: Save artifact info + run: | + # Create artifact info file with the design and artifact details + mkdir -p artifact_info + cat > artifact_info/${{ steps.sanitize.outputs.sanitized_name }}.json << EOF + { + "design": "${{ matrix.design }}", + "sanitized_name": "${{ steps.sanitize.outputs.sanitized_name }}", + "run_id": "${{ github.run_id }}", + "repo": "${{ github.repository }}" + } + EOF + if: success() || failure() + + - name: Upload artifact info + uses: actions/upload-artifact@v4 + with: + name: artifact-info-${{ steps.sanitize.outputs.sanitized_name }} + path: artifact_info/ + retention-days: 30 + if: success() || failure() + collect-results: needs: [find-designs, build] runs-on: ubuntu-latest @@ -132,6 +155,23 @@ jobs: pattern: design-logs-* merge-multiple: true + - name: Download artifact info + uses: actions/download-artifact@v4 + with: + pattern: artifact-info-* + merge-multiple: true + + - name: Get artifact IDs and generate URLs + run: | + echo "Getting artifact IDs for image download URLs..." + + # Use GitHub API to get artifacts for this run + artifacts_response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts") + + echo "$artifacts_response" > artifacts.json + echo "Artifacts saved to artifacts.json for results script" + - name: Extract and update results run: | echo "Extracting results from OpenROAD runs..." @@ -147,7 +187,8 @@ jobs: --base-dir . \ --output QOR.md \ --github-repo "${{ github.repository }}" \ - --github-run-id "${{ github.run_id }}"; then + --github-run-id "${{ github.run_id }}" \ + --artifacts-file artifacts.json; then echo "Results extraction completed successfully" else echo "Results extraction failed, but continuing with workflow" diff --git a/extract_results.py b/extract_results.py index 6379c90..792bb98 100755 --- a/extract_results.py +++ b/extract_results.py @@ -60,11 +60,23 @@ def find_report_files(base_dir): return report_files -def generate_markdown_table(results, github_repo=None, github_run_id=None): +def generate_markdown_table(results, github_repo=None, github_run_id=None, artifacts_file=None): """Generate a markdown table from the results.""" if not results: return "No results found.\n" + # Load artifact information if available + artifact_map = {} + if artifacts_file and os.path.exists(artifacts_file): + try: + with open(artifacts_file, 'r') as f: + artifacts_data = json.load(f) + # Create mapping of artifact name to ID + for artifact in artifacts_data.get('artifacts', []): + artifact_map[artifact['name']] = artifact['id'] + except Exception as e: + print(f"Warning: Could not load artifacts file: {e}") + # Table header - add Image column if GitHub info is provided if github_repo and github_run_id: table = """ @@ -92,9 +104,19 @@ def generate_markdown_table(results, github_repo=None, github_run_id=None): # Table rows for result in sorted_results: if github_repo and github_run_id: - # Generate artifact name for this design's image - artifact_url = f"https://github.com/{github_repo}/actions/runs/{github_run_id}" - image_link = f"[Download]({artifact_url})" + # Generate artifact name for this design's image (matching workflow naming) + sanitized_name = f"designs-{result['platform']}-{result['design_name']}" + artifact_name = f"design-image-{sanitized_name}" + + # Try to get the specific artifact ID for direct download + if artifact_name in artifact_map: + artifact_id = artifact_map[artifact_name] + artifact_url = f"https://github.com/{github_repo}/actions/runs/{github_run_id}/artifacts/{artifact_id}" + image_link = f"[Download Image]({artifact_url})" + else: + # Fallback to run page if artifact ID not found + artifact_url = f"https://github.com/{github_repo}/actions/runs/{github_run_id}" + image_link = f"[View Run]({artifact_url})" table += f"| {result['design_name']} | {result['platform']} | {result['status']} | {result['total_area']} | {result['utilization']} | {result['instance_count']} | {result['setup_tns']} | {result['setup_wns']} | {result['hold_tns']} | {result['hold_wns']} | {result['total_power']} | {result['clock_skew']} | {result['warnings']} | {result['errors']} | {image_link} |\n" else: @@ -150,6 +172,8 @@ def main(): help='GitHub repository (owner/repo) for artifact links') parser.add_argument('--github-run-id', default=None, help='GitHub Actions run ID for artifact links') + parser.add_argument('--artifacts-file', default=None, + help='JSON file containing GitHub artifacts information') args = parser.parse_args() @@ -169,7 +193,7 @@ def main(): results.append(metrics) # Generate markdown table - table = generate_markdown_table(results, args.github_repo, args.github_run_id) + table = generate_markdown_table(results, args.github_repo, args.github_run_id, args.artifacts_file) if args.output: # Write to specified output file From bd3a3680833aea5375ad73fa999ac7943c150df7 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Tue, 12 Aug 2025 12:57:19 -0700 Subject: [PATCH 40/45] include reports and results dirs --- .github/workflows/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d31cb9..2960393 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,10 @@ jobs: uses: actions/upload-artifact@v4 with: name: design-logs-${{ steps.sanitize.outputs.sanitized_name }} - path: logs/ + path: | + logs/ + reports/ + results/ retention-days: 30 if: success() || failure() @@ -149,7 +152,7 @@ jobs: with: python-version: '3.x' - - name: Download all artifacts + - name: Download logs uses: actions/download-artifact@v4 with: pattern: design-logs-* From f1c919f89863f922206d73846d5f8c86c757adba Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 20 Aug 2025 21:15:23 -0700 Subject: [PATCH 41/45] test minimax designs on github action --- designs_to_run.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designs_to_run.txt b/designs_to_run.txt index 763f972..65c3741 100644 --- a/designs_to_run.txt +++ b/designs_to_run.txt @@ -4,9 +4,9 @@ designs/asap7/lfsr_top/config.mk designs/sky130hd/lfsr_top/config.mk # Minimax designs -# designs/nangate45/minimax/config.mk -# designs/asap7/minimax/config.mk -# designs/sky130hd/minimax/config.mk +designs/nangate45/minimax/config.mk +designs/asap7/minimax/config.mk +designs/sky130hd/minimax/config.mk # LiteEth designs # designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk From 91873124ed776dea1ed375d6908b7f582a56318f Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 20 Aug 2025 21:15:59 -0700 Subject: [PATCH 42/45] test liteeth designs on github action --- designs_to_run.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designs_to_run.txt b/designs_to_run.txt index 65c3741..40a114b 100644 --- a/designs_to_run.txt +++ b/designs_to_run.txt @@ -4,15 +4,15 @@ designs/asap7/lfsr_top/config.mk designs/sky130hd/lfsr_top/config.mk # Minimax designs -designs/nangate45/minimax/config.mk -designs/asap7/minimax/config.mk -designs/sky130hd/minimax/config.mk +# designs/nangate45/minimax/config.mk +# designs/asap7/minimax/config.mk +# designs/sky130hd/minimax/config.mk # LiteEth designs -# designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk -# designs/nangate45/liteeth/liteeth_mac_wb_mii/config.mk -# designs/sky130hd/liteeth/liteeth_mac_axi_mii/config.mk -# designs/sky130hd/liteeth/liteeth_mac_wb_mii/config.mk +designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk +designs/nangate45/liteeth/liteeth_mac_wb_mii/config.mk +designs/sky130hd/liteeth/liteeth_mac_axi_mii/config.mk +designs/sky130hd/liteeth/liteeth_mac_wb_mii/config.mk # NyuziProcessor design # designs/nangate45/NyuziProcessor/config.mk From 216eaa2a66ed6371f76f08937f6af0a5faabc07f Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 20 Aug 2025 21:16:12 -0700 Subject: [PATCH 43/45] test NyuziProcessor on github action --- designs_to_run.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designs_to_run.txt b/designs_to_run.txt index 40a114b..27a2ffa 100644 --- a/designs_to_run.txt +++ b/designs_to_run.txt @@ -9,10 +9,10 @@ designs/sky130hd/lfsr_top/config.mk # designs/sky130hd/minimax/config.mk # LiteEth designs -designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk -designs/nangate45/liteeth/liteeth_mac_wb_mii/config.mk -designs/sky130hd/liteeth/liteeth_mac_axi_mii/config.mk -designs/sky130hd/liteeth/liteeth_mac_wb_mii/config.mk +# designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk +# designs/nangate45/liteeth/liteeth_mac_wb_mii/config.mk +# designs/sky130hd/liteeth/liteeth_mac_axi_mii/config.mk +# designs/sky130hd/liteeth/liteeth_mac_wb_mii/config.mk # NyuziProcessor design -# designs/nangate45/NyuziProcessor/config.mk +designs/nangate45/NyuziProcessor/config.mk From 8d991aac903f37023a468a832fa04c398ef97588 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 20 Aug 2025 21:28:17 -0700 Subject: [PATCH 44/45] add sv2v to container --- .github/workflows/main.yml | 4 ++++ designs_to_run.txt | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2960393..dbcede5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,6 +69,10 @@ jobs: openroad/orfs:$tag \ bash -c " set -e + apt-get update && apt-get install -y wget + wget https://github.com/zachjs/sv2v/releases/download/v0.0.11/sv2v-linux-amd64 + chmod +x sv2v-linux-amd64 + mv sv2v-linux-amd64 /usr/bin/sv2v git config --global --add safe.directory '*' cd UCSC_ML_suite echo 'Running design: $design' diff --git a/designs_to_run.txt b/designs_to_run.txt index 27a2ffa..5520365 100644 --- a/designs_to_run.txt +++ b/designs_to_run.txt @@ -4,15 +4,15 @@ designs/asap7/lfsr_top/config.mk designs/sky130hd/lfsr_top/config.mk # Minimax designs -# designs/nangate45/minimax/config.mk -# designs/asap7/minimax/config.mk -# designs/sky130hd/minimax/config.mk +designs/nangate45/minimax/config.mk +designs/asap7/minimax/config.mk +designs/sky130hd/minimax/config.mk # LiteEth designs -# designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk -# designs/nangate45/liteeth/liteeth_mac_wb_mii/config.mk -# designs/sky130hd/liteeth/liteeth_mac_axi_mii/config.mk -# designs/sky130hd/liteeth/liteeth_mac_wb_mii/config.mk +designs/nangate45/liteeth/liteeth_mac_axi_mii/config.mk +designs/nangate45/liteeth/liteeth_mac_wb_mii/config.mk +designs/sky130hd/liteeth/liteeth_mac_axi_mii/config.mk +designs/sky130hd/liteeth/liteeth_mac_wb_mii/config.mk # NyuziProcessor design -designs/nangate45/NyuziProcessor/config.mk +# designs/nangate45/NyuziProcessor/config.mk From d4bcbe63122f589c358ba6ea2c2682d84e9a38a4 Mon Sep 17 00:00:00 2001 From: Eric Chuang Date: Wed, 20 Aug 2025 21:57:46 -0700 Subject: [PATCH 45/45] fix sv2v --- .github/workflows/main.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dbcede5..a8a01cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,12 +69,18 @@ jobs: openroad/orfs:$tag \ bash -c " set -e - apt-get update && apt-get install -y wget - wget https://github.com/zachjs/sv2v/releases/download/v0.0.11/sv2v-linux-amd64 - chmod +x sv2v-linux-amd64 - mv sv2v-linux-amd64 /usr/bin/sv2v git config --global --add safe.directory '*' - cd UCSC_ML_suite + + echo 'Installing sv2v...' + apt-get update && apt-get install -y wget + wget -q https://github.com/zachjs/sv2v/releases/download/v0.0.13/sv2v-Linux.zip -O /tmp/sv2v.zip + cd /tmp && unzip -q sv2v.zip + chmod +x sv2v + mv sv2v /usr/local/bin/ + echo 'sv2v installed successfully' + sv2v --version + + cd /OpenROAD-flow-scripts/UCSC_ML_suite echo 'Running design: $design' make DESIGN_CONFIG='$design' "