diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index aa51a06..f8b75cb 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -88,8 +88,9 @@ jobs: - name: Verify pass (non nxroute-poc) if: matrix.router != 'nxroute-poc' run: | + set -x # Allow CheckPhysNetlist to fail if no remote access to Vivado - grep -H PASS *.check || ${{ secrets.REPORT_ROUTE_STATUS_URL == '' }} + grep -H PASS *.check || (grep -H FAIL *.check && ${{ secrets.REPORT_ROUTE_STATUS_URL == '' }}) grep -H -e "# of nets with routing errors[. :]\+0" *.check.log || ${{ secrets.REPORT_ROUTE_STATUS_URL == '' }} # But CheckPhysNetlist must have no differences grep "INFO: No differences found between routed and unrouted netlists" *.check.log @@ -101,14 +102,15 @@ jobs: - name: Verify fail (nxroute-poc) if: matrix.router == 'nxroute-poc' run: | + set -x grep -H FAIL *.check # Only expect report_route_status output if URL given grep -H -e "# of nets with routing errors[. :]\+[1-9]" -e "# of unrouted nets[. :]\+[1-9]" *.check.log || ${{ secrets.REPORT_ROUTE_STATUS_URL == '' }} # But CheckPhysNetlist must have no differences (except koios because out-of-memory) grep "INFO: No differences found between routed and unrouted netlists" *.check.log || ${{ matrix.benchmark == 'koios_dla_like_large' }} - # Check no multiple sources, but expect stubs (except koios because out-of-memory) + # Check no multiple sources, but expect possibility of stubs since nxroute is unlikely to fully route the design grep "UserWarning: Found [0-9]\+ sources" *.wirelength && exit 1 - grep "UserWarning: Found [0-9]\+ stubs" *.wirelength || ${{ matrix.benchmark == 'koios_dla_like_large' }} + grep "UserWarning: Found [0-9]\+ stubs" *.wirelength || true # Allow wirelength computation to fail since nxroute may not have routed anything or wirelength_analyzer was not run grep "^Wirelength: [1-9][0-9]*" *.wirelength || true - uses: actions/upload-artifact@v3 diff --git a/Makefile b/Makefile index 97e563e..802585c 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,11 @@ $(if $(HTTPSHOST),-Dhttps.proxyHost=$(HTTPSHOST) -Dhttps.proxyPort=$(HTTPSPORT), # (other supported values: nxroute-poc) ROUTER ?= rwroute -# Make /usr/bin/time only print out wall-clock time in seconds -export TIME=Wall-clock time (sec): %e +# Make /usr/bin/time only print out wall-clock and user time in seconds +TIME = Wall-clock time (sec): %e +# Note that User-CPU time is for information purposes only (not used for scoring) +TIME += \nUser-CPU time (sec): %U +export TIME # Existence of the VERBOSE environment variable indicates whether router/ # checker outputs will be displayed on screen @@ -63,6 +66,11 @@ export RAPIDWRIGHT_PATH = $(abspath RapidWright) .PHONY: run-$(ROUTER) run-$(ROUTER): score-$(ROUTER) +JAVA_CLASSPATH_TXT = java-classpath.txt +.INTERMEDIATE: $(JAVA_CLASSPATH_TXT) +$(JAVA_CLASSPATH_TXT): compile-java + echo "$$(./gradlew -quiet --offline runtimeClasspath):build/classes/java/main" > $@ + # Use Gradle to compile Java source code in this repository as well as the RapidWright repository. # Also download/generate all device files necessary for the xcvu3p device .PHONY: compile-java @@ -92,8 +100,8 @@ fpga-interchange-schema/interchange/capnp/java.capnp: # Gradle is used to invoke the CheckPhysNetlist class' main method with arguments # $^ (%.netlist and %_rwroute.phys), and display/redirect all output to $@.log (%_rwroute.check.log). # The exit code of Gradle determines if 'PASS' or 'FAIL' is written to $@ (%_rwroute.check) -%_$(ROUTER).check: %.netlist %_$(ROUTER).phys %_unrouted.phys | compile-java - if ./gradlew --offline -DjvmArgs="$(JVM_HEAP)" -Dmain=com.xilinx.fpga24_routing_contest.CheckPhysNetlist :run --args='$^' $(call log_and_or_display,$@.log); then \ +%_$(ROUTER).check: %.netlist %_$(ROUTER).phys %_unrouted.phys | $(JAVA_CLASSPATH_TXT) + if java -cp $$(cat $(JAVA_CLASSPATH_TXT)) $(JVM_HEAP) com.xilinx.fpga24_routing_contest.CheckPhysNetlist $^ $(call log_and_or_display,$@.log); then \ echo "PASS" > $@; \ else \ echo "FAIL" > $@; \ @@ -135,8 +143,9 @@ distclean: clean # /usr/bin/time is used to measure the wall clock time # Gradle is used to invoke the PartialRouterPhysNetlist class' main method with arguments # $< (%_unrouted.phys) and $@ (%_rwroute.phys), and display/redirect all output into %_rwroute.phys.log -%_rwroute.phys: %_unrouted.phys | compile-java - (/usr/bin/time ./gradlew --offline -DjvmArgs="$(JVM_HEAP)" -Dmain=com.xilinx.fpga24_routing_contest.PartialRouterPhysNetlist :run --args='$< $@') $(call log_and_or_display,$@.log) +%_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) + ## NXROUTE-POC %_nxroute-poc.phys: %_unrouted.phys xcvu3p.device | install-python-deps fpga-interchange-schema/interchange/capnp/java.capnp diff --git a/build.gradle b/build.gradle index 1899c12..005549d 100644 --- a/build.gradle +++ b/build.gradle @@ -37,3 +37,8 @@ task run(type: JavaExec) { } } +task runtimeClasspath { + doLast { + println configurations.runtimeClasspath.asPath + } +} diff --git a/compute-score.py b/compute-score.py index b2bb438..045081c 100644 --- a/compute-score.py +++ b/compute-score.py @@ -35,7 +35,7 @@ def runtime_result(physlogfile): """ reWallClockSeconds = re.compile(r'Wall-clock time \(sec\): ([0-9.]+)') with open(physlogfile) as fp: - last = fp.readlines()[-1].rstrip() + last = fp.readlines()[-2].rstrip() m = reWallClockSeconds.match(last) if not m: return float('inf')