Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ae1f77d
github action
ericbreh Jun 25, 2025
d8c1d12
Merge branch 'VLSIDA:main' into ci
ericbreh Jun 26, 2025
b3a747d
test action
ericbreh Jun 30, 2025
d46a7d0
test push
ericbreh Jun 30, 2025
a3de29c
ls
ericbreh Jun 30, 2025
b2838f6
link ORFS files
ericbreh Jun 30, 2025
a4f52af
test run scripts
ericbreh Jun 30, 2025
d296c74
test without checkout submodules
ericbreh Jun 30, 2025
9e87ef1
test run docker
ericbreh Jun 30, 2025
809c18c
remove duplicate step
ericbreh Jun 30, 2025
03dc8f2
test docker
ericbreh Jun 30, 2025
524fa97
test docker persistance
ericbreh Jun 30, 2025
cd5c146
action runs flow on every design every push
ericbreh Jun 30, 2025
c2c9b99
Merge branch 'VLSIDA:main' into ci
ericbreh Jun 30, 2025
73d7b52
list designs
ericbreh Jun 30, 2025
111a0dd
print list at end
ericbreh Jun 30, 2025
cb4f8e2
remove print
ericbreh Jun 30, 2025
ab47938
Merge branch 'VLSIDA:main' into ci
ericbreh Jul 24, 2025
b5245dd
mark repo safe to fix dubious ownership error
ericbreh Jul 24, 2025
d2c5854
change safe repo line
ericbreh Jul 24, 2025
fb177df
only run one design for testing
ericbreh Jul 24, 2025
d0b93cc
all paths safe
ericbreh Jul 24, 2025
74b6bf4
script to extract results and create table in readme
ericbreh Jul 24, 2025
98ee3db
more logging for push step
ericbreh Jul 24, 2025
d241d62
made action resilient to failed designs
ericbreh Jul 24, 2025
0c82f63
continue on error in script
ericbreh Jul 24, 2025
ee6bf9e
Merge branch 'VLSIDA:main' into ci
ericbreh Jul 26, 2025
f981fef
save results to QOR.md
ericbreh Jul 26, 2025
7cfc7c3
action to run a single design
ericbreh Jul 30, 2025
381f87d
Merge branch 'VLSIDA:main' into ci
ericbreh Jul 31, 2025
124c8bb
save logs
ericbreh Jul 31, 2025
7f718f4
Merge branch 'ci' of github.com:ericbreh/UCSC_ML_suite into ci
ericbreh Jul 31, 2025
fe6fe52
testing file format
ericbreh Jul 31, 2025
4e46310
test workflow
ericbreh Jul 31, 2025
672007d
test
ericbreh Jul 31, 2025
b4ba5bd
remove test workflow
ericbreh Jul 31, 2025
9aa7c56
new step to list designs
ericbreh Aug 12, 2025
f8ae50e
try to run designs in parallel
ericbreh Aug 12, 2025
4906abf
change artifact naming
ericbreh Aug 12, 2025
02df111
save image as artifact, link in markdown
ericbreh Aug 12, 2025
3105d48
only run lfsr designs for testing
ericbreh Aug 12, 2025
f33fa88
create designs to run file
ericbreh Aug 12, 2025
04897db
only save image artifact
ericbreh Aug 12, 2025
13309bd
fix broken artifact
ericbreh Aug 12, 2025
2f42657
try to pass artifact id between jobs
ericbreh Aug 12, 2025
bd3a368
include reports and results dirs
ericbreh Aug 12, 2025
f1c919f
test minimax designs on github action
ericbreh Aug 21, 2025
9187312
test liteeth designs on github action
ericbreh Aug 21, 2025
216eaa2
test NyuziProcessor on github action
ericbreh Aug 21, 2025
8d991aa
add sv2v to container
ericbreh Aug 21, 2025
d4bcbe6
fix sv2v
ericbreh Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 245 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
name: Push Workflow

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: |
# 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
runs-on: ubuntu-latest
strategy:
matrix:
design: ${{ fromJson(needs.find-designs.outputs.designs) }}
fail-fast: false
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 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 '*'

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'
"

- 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 logs for results
uses: actions/upload-artifact@v4
with:
name: design-logs-${{ steps.sanitize.outputs.sanitized_name }}
path: |
logs/
reports/
results/
retention-days: 30
if: success() || failure()

- 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
id: upload-image
uses: actions/upload-artifact@v4
with:
name: design-image-${{ steps.sanitize.outputs.sanitized_name }}
path: image_output/final_all.webp
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
if: always()
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Download logs
uses: actions/download-artifact@v4
with:
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..."

# 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 with GitHub context
if python3 extract_results.py \
--base-dir . \
--output QOR.md \
--github-repo "${{ github.repository }}" \
--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"
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 "[email protected]"
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
115 changes: 115 additions & 0 deletions .github/workflows/test-single-design.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions designs_to_run.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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
Loading