Skip to content

Commit

Permalink
[Branch] 4th Place -- Team Cuckoo (Peking University) (#93)
Browse files Browse the repository at this point in the history
* Add OpenPARF submodule

Signed-off-by: Eddie Hung <[email protected]>

* Update Makefile and add new cuckoo_container.def

Signed-off-by: Eddie Hung <[email protected]>

* Tidy

Signed-off-by: Eddie Hung <[email protected]>

* Fix CI

Signed-off-by: Eddie Hung <[email protected]>

* Package xcvu3p.device in submission

Signed-off-by: Eddie Hung <[email protected]>

* Update README.md

---------

Signed-off-by: Eddie Hung <[email protected]>
  • Loading branch information
eddieh-xlnx authored May 21, 2024
1 parent 707f0da commit a735b65
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 17 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
fail-fast: false
matrix:
router:
- rwroute
- nxroute-poc
- cuckoo
lutpinswapping:
- false
- true
Expand All @@ -40,14 +39,18 @@ jobs:
- ispd16_example2
exclude:
# Insufficient memory on GitHub Actions
- router: rwroute
- router: cuckoo
benchmark: mlcad_d181_lefttwo3rds
- router: rwroute
- router: cuckoo
benchmark: koios_dla_like_large
- router: rwroute
- router: cuckoo
benchmark: boom_soc
- router: rwroute
- router: cuckoo
benchmark: ispd16_example2
- router: cuckoo
lutpinswapping: true
- router: cuckoo
lutroutethru: true
# NXRoute does not support LUT pin swapping
- router: nxroute-poc
lutpinswapping: true
Expand All @@ -69,10 +72,26 @@ jobs:
python-version: '3.12'
check-latest: true
cache: 'pip'
- name: Download xcvu3p.device (nxroute-poc only)
if: matrix.router == 'nxroute-poc'
- name: Download xcvu3p.device
if: matrix.router == 'nxroute-poc' || matrix.router == 'cuckoo'
run:
wget -q https://github.com/Xilinx/fpga24_routing_contest/releases/latest/download/xcvu3p.device
- name: Build capnp-0.10.2
run: |
curl -O https://capnproto.org/capnproto-c++-0.10.2.tar.gz
tar zxf capnproto-c++-0.10.2.tar.gz
cd capnproto-c++-0.10.2
./configure
make
sudo make install
- name: Build OpenPARF/fpga24contest
run: |
sudo apt-get -y install cmake libopenblas-dev libboost-filesystem-dev libboost-program-options-dev
cd OpenPARF/fpga24contest
mkdir build
cd build
cmake ../src -DCMAKE_BUILD_TYPE=Release
make
- env:
REPORT_ROUTE_STATUS_URL: ${{ secrets.REPORT_ROUTE_STATUS_URL }}
REPORT_ROUTE_STATUS_AUTH: ${{ secrets.REPORT_ROUTE_STATUS_AUTH }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/package_and_test-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
with:
submodules: 'recursive'
- run: |
wget -q https://github.com/Xilinx/fpga24_routing_contest/releases/latest/download/xcvu3p.device
make distclean-and-package-submission
- uses: actions/upload-artifact@v4
with:
name: rwroute_submission.tar.gz
name: cuckoo_submission.tar.gz
compression-level: 0
path: |
rwroute_submission*.tar.gz
cuckoo_submission*.tar.gz
test-container:
runs-on: ubuntu-latest
Expand All @@ -38,17 +39,17 @@ jobs:
sudo apt-get -f install
- uses: actions/download-artifact@v4
with:
name: rwroute_submission.tar.gz
name: cuckoo_submission.tar.gz
- name: make test-container
run: |
mkdir rwroute
cd rwroute
tar xvzf ../rwroute_submission*.tar.gz
mkdir cuckoo
cd cuckoo
tar xvzf ../cuckoo_submission*.tar.gz
make test-container
- uses: actions/upload-artifact@v4
with:
name: rwroute_container.sif
name: cuckoo_container.sif
compression-level: 0
path: |
rwroute/*.sif
cuckoo/*.sif
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "fpga-interchange-schema"]
path = fpga-interchange-schema
url = https://github.com/chipsalliance/fpga-interchange-schema
[submodule "OpenPARF"]
path = OpenPARF
url = https://github.com/PKU-IDEA/OpenPARF
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $(if $(HTTPSHOST),-Dhttps.proxyHost=$(HTTPSHOST) -Dhttps.proxyPort=$(HTTPSPORT),

# Choice of router (default to rwroute)
# (other supported values: nxroute-poc)
ROUTER ?= rwroute
ROUTER ?= cuckoo

# Make /usr/bin/time only print out wall-clock and user time in seconds
TIME = Wall-clock time (sec): %e
Expand Down Expand Up @@ -156,6 +156,10 @@ distclean: clean
%_rwroute.phys: %_unrouted.phys | $(JAVA_CLASSPATH_TXT)
(/usr/bin/time java -cp $$(cat $(JAVA_CLASSPATH_TXT)) $(JVM_HEAP) com.xilinx.fpga24_routing_contest.PartialRouterPhysNetlist $< $@) $(call log_and_or_display,$@.log)

## TEAM CUCKOO
%_cuckoo.phys: %_unrouted.phys xcvu3p.device
(/usr/bin/time OpenPARF/fpga24contest/build/fpgarouter -device xcvu3p.device -phys $< -ifout $@) $(call log_and_or_display,$@.log)


## NXROUTE-POC
%_nxroute-poc.phys: %_unrouted.phys xcvu3p.device | install-python-deps fpga-interchange-schema/interchange/capnp/java.capnp
Expand Down Expand Up @@ -198,6 +202,9 @@ APPTAINER_RUN_ARGS_NO_NETWORK += --network none --env APPTAINER_NETWORK=none
%_container.sif: final_submission/%_container.def
apptainer build $@ $<

cuckoo_container.sif: final_submission/cuckoo_container.def
apptainer build --bind $(abspath OpenPARF):/OpenPARF $@ $<

.PHONY: workdir
workdir:
# Clear out the per-session workdir subdirectory
Expand Down
1 change: 1 addition & 0 deletions OpenPARF
Submodule OpenPARF added at 2d95bd
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
> [!IMPORTANT]
> This is the branch integrating the open-source solution from [4th place Team Cuckoo](https://xilinx.github.io/fpga24_routing_contest/results.html#team-cuckoo-peking-university) published at https://github.com/PKU-IDEA/OpenPARF/tree/master/fpga24contest
>
> ℹ️ *NOTE:* GitHub Actions are currently failing since this router requires more than the 7GB of RAM available.
# Runtime-First FPGA Interchange Routing Contest @ FPGA’24

Please see website at https://xilinx.github.io/fpga24_routing_contest.
Expand Down
36 changes: 36 additions & 0 deletions final_submission/cuckoo_container.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
BootStrap: docker
From: eclipse-temurin:17 # Base image with Java VM 17 on Ubuntu

%setup
mkdir $APPTAINER_ROOTFS/OpenPARF

%files
## Example copy of /dir1 into /opt inside container
#/dir1 /opt

%post
# Install remaining system dependencies
apt-get -y update
apt-get -y install git python3 pip pkg-config time libtinfo5

# Install capnp-0.10.2 since that's the exact version used to generate OpenPARF's parsing code
mkdir /capnp
cd /capnp
curl -O https://capnproto.org/capnproto-c++-0.10.2.tar.gz
tar zxf capnproto-c++-0.10.2.tar.gz
cd capnproto-c++-0.10.2
./configure
make install

apt-get -y install cmake libopenblas-dev libboost-filesystem-dev libboost-program-options-dev

cd /OpenPARF/fpga24contest
rm -rf build
mkdir build
cd build
cmake ../src -DCMAKE_BUILD_TYPE=Release
make

%environment
# Add the host Vivado to the path
export PATH=$PATH:/tools/Xilinx/Vivado/2022.2/bin/

0 comments on commit a735b65

Please sign in to comment.