forked from The-OpenROAD-Project/OpenROAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
368 changed files
with
220,837 additions
and
369,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.github/workflows/github-actions-cron-sync-fork-from-upstream-PII.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Automatically sync branch from upstream. | ||
|
||
on: | ||
schedule: | ||
- cron: "0 14 * * *" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
force: | ||
description: Use GitHub --force push. | ||
default: | ||
|
||
repository_dispatch: | ||
|
||
|
||
jobs: | ||
Sync-Branch-From-Upstream: | ||
name: Automatic sync 'master' from The-OpenROAD-Project/OpenROAD | ||
runs-on: ubuntu-latest | ||
|
||
# Only allow one action to run at a time. | ||
concurrency: sync-branch-from-upstream | ||
|
||
# Action needs no permissions, as push is granted via adding a deploy key | ||
# with write access to the $DEPLOY_KEY secret. | ||
permissions: | ||
contents: read | ||
|
||
# Don't run on the upstream repository and only run on the right branch. | ||
if: ${{ github.repository_owner == 'Precision-Innovations' && endsWith(github.ref, '/master') }} | ||
|
||
steps: | ||
|
||
- uses: The-OpenROAD-Project/actions/upstream_sync@main | ||
env: | ||
HAS_DEPLOY_KEY: ${{ !!(secrets.DEPLOY_KEY) }} | ||
if: ${{ env.HAS_DEPLOY_KEY == 'true' }} | ||
with: | ||
upstreamRepo: The-OpenROAD-Project/OpenROAD | ||
upstreamBranch: master | ||
# To always overwrite master branch, set UPSTREAM_SYNC to the exact | ||
# string 'always overwrite master branch'. | ||
# You can also manually trigger a workflow dispatch with the force | ||
# value equal to 'true'. | ||
force: ${{ github.event.inputs.force || (secrets.UPSTREAM_SYNC == 'always overwrite master branch') }} | ||
deployKey: ${{ secrets.DEPLOY_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
|
||
def swap_prefix(file, old, new): | ||
with open(file, 'r') as f: | ||
lines = f.read() | ||
lines = lines.replace(old, new) | ||
with open(file, 'wt') as f: | ||
f.write(lines) | ||
|
||
# modify ../include/ord/OpenROAD.hh | ||
swap_prefix('../include/ord/OpenRoad.hh', 'namespace dft {\nclass Dft;\n}', | ||
'namespace dft {\nclass Dft;\n}\n\nnamespace tool{\nclass Tool;\n}') | ||
|
||
swap_prefix('../include/ord/OpenRoad.hh', 'dft::Dft* getDft() { return dft_; }', | ||
'dft::Dft* getDft() { return dft_; }\n tool::Tool* getTool() { return tool_; }') | ||
|
||
swap_prefix('../include/ord/OpenRoad.hh', 'dft::Dft* dft_ = nullptr;', | ||
'dft::Dft* dft_ = nullptr;\n tool::Tool* tool_ = nullptr;') | ||
|
||
# modify ../src/CMakeLists.txt | ||
swap_prefix('../src/CMakeLists.txt', 'add_subdirectory(dft)', | ||
'add_subdirectory(dft)\nadd_subdirectory(tool)') | ||
|
||
swap_prefix('../src/CMakeLists.txt', 'pdn\n dft', 'pdn\n dft\n tool') | ||
|
||
# modify ../src/OpenROAD.cc | ||
swap_prefix('../src/OpenRoad.cc', '#include "utl/MakeLogger.h"', | ||
'#include "utl/MakeLogger.h"\n#include "tool/MakeTool.hh"') | ||
|
||
swap_prefix('../src/OpenRoad.cc', 'dft_ = dft::makeDft();', | ||
'dft_ = dft::makeDft();\n tool_ = makeTool();') | ||
|
||
swap_prefix('../src/OpenRoad.cc', 'dft::deleteDft(dft_);', | ||
'dft::deleteDft(dft_);\n deleteTool(tool_);') | ||
|
||
swap_prefix('../src/OpenRoad.cc', 'dft::initDft(this);', | ||
'dft::initDft(this);\n initTool(this);') | ||
|
||
# create a patch file | ||
_ = os.popen('git add ../include/ord/OpenRoad.hh').read() | ||
_ = os.popen('git add ../src/CMakeLists.txt').read() | ||
_ = os.popen('git add ../src/OpenRoad.cc').read() | ||
_ = os.popen('git diff --cached > misc/AddTool.patch').read() | ||
|
||
# restore all changes except patch | ||
_ = os.popen('git reset ../include/ord/OpenRoad.hh').read() | ||
_ = os.popen('git reset ../src/CMakeLists.txt').read() | ||
_ = os.popen('git reset ../src/OpenRoad.cc').read() | ||
_ = os.popen('git restore ../include/ord/OpenRoad.hh').read() | ||
_ = os.popen('git restore ../src/CMakeLists.txt').read() | ||
_ = os.popen('git restore ../src/OpenRoad.cc').read() | ||
|
Oops, something went wrong.