diff --git a/.github/kokoro/continuous-db-artix7.cfg b/.github/kokoro/continuous-db-artix7.cfg new file mode 100644 index 00000000..6870b866 --- /dev/null +++ b/.github/kokoro/continuous-db-artix7.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "symbiflow-prjxray-continuous-db-artix7/.github/kokoro/db-full.sh" + +timeout_mins: 4320 + +action { + define_artifacts { + # File types + regex: "**/diff.html" + regex: "**/diff.json" + regex: "**/*result*.xml" + regex: "**/*sponge_log.xml" + # Whole directories + # regex: "**/build/**" - Currently kokoro dies on number of artifacts. + regex: "**/build/*.log" + regex: "**/logs/**" + # The database + regex: "**/database/artix7/**" + strip_prefix: "github/symbiflow-prjxray-continuous-db-artix7/" + } +} + +env_vars { + key: "KOKORO_TYPE" + value: "continuous" +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-continuous-db-artix7" +} + +env_vars { + key: "XRAY_SETTINGS" + value: "artix7" +} + +env_vars { + key: "XRAY_BUILD_TYPE" + value: "full" +} diff --git a/.github/kokoro/continuous-db-kintex7.cfg b/.github/kokoro/continuous-db-kintex7.cfg new file mode 100644 index 00000000..cad4fc27 --- /dev/null +++ b/.github/kokoro/continuous-db-kintex7.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "symbiflow-prjxray-continuous-db-kintex7/.github/kokoro/db-full.sh" + +timeout_mins: 4320 + +action { + define_artifacts { + # File types + regex: "**/diff.html" + regex: "**/diff.json" + regex: "**/*result*.xml" + regex: "**/*sponge_log.xml" + # Whole directories + # regex: "**/build/**" - Currently kokoro dies on number of artifacts. + regex: "**/build/*.log" + regex: "**/logs/**" + # The database + regex: "**/database/kintex7/**" + strip_prefix: "github/symbiflow-prjxray-continuous-db-kintex7/" + } +} + +env_vars { + key: "KOKORO_TYPE" + value: "continuous" +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-continuous-db-kintex7" +} + +env_vars { + key: "XRAY_SETTINGS" + value: "kintex7" +} + +env_vars { + key: "XRAY_BUILD_TYPE" + value: "full" +} diff --git a/.github/kokoro/continuous-db-zynq7.cfg b/.github/kokoro/continuous-db-zynq7.cfg new file mode 100644 index 00000000..ba23dabd --- /dev/null +++ b/.github/kokoro/continuous-db-zynq7.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "symbiflow-prjxray-continuous-db-zynq7/.github/kokoro/db-full.sh" + +timeout_mins: 4320 + +action { + define_artifacts { + # File types + regex: "**/diff.html" + regex: "**/diff.json" + regex: "**/*result*.xml" + regex: "**/*sponge_log.xml" + # Whole directories + # regex: "**/build/**" - Currently kokoro dies on number of artifacts. + regex: "**/build/*.log" + regex: "**/logs/**" + # The database + regex: "**/database/zynq7/**" + strip_prefix: "github/symbiflow-prjxray-continuous-db-zynq7/" + } +} + +env_vars { + key: "KOKORO_TYPE" + value: "continuous" +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-continuous-db-zynq7" +} + +env_vars { + key: "XRAY_SETTINGS" + value: "zynq7" +} + +env_vars { + key: "XRAY_BUILD_TYPE" + value: "full" +} diff --git a/.github/kokoro/ctest2junit.xsl b/.github/kokoro/ctest2junit.xsl new file mode 100644 index 00000000..3ea29e50 --- /dev/null +++ b/.github/kokoro/ctest2junit.xsl @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BuildName: + BuildStamp: + Name: + Generator: + CompilerName: + OSName: + Hostname: + OSRelease: + OSVersion: + OSPlatform: + Is64Bits: + VendorString: + VendorID: + FamilyID: + ModelID: + ProcessorCacheSize: + NumberOfLogicalCPU: + NumberOfPhysicalCPU: + TotalVirtualMemory: + TotalPhysicalMemory: + LogicalProcessorsPerPhysical: + ProcessorClockFrequency: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.github/kokoro/database.cfg b/.github/kokoro/database.cfg new file mode 100644 index 00000000..c904160c --- /dev/null +++ b/.github/kokoro/database.cfg @@ -0,0 +1,14 @@ +build_file: "symbiflow-prjxray-db/.github/kokoro/database.sh" + +timeout_mins: 10 + +action { + define_artifacts { + regex: "**/*result*.xml" + regex: "**/build/*.log" + regex: "**/build/**" + regex: "**/diff.*" + regex: "**/database/**" + strip_prefix: "github/symbiflow-prjxray-db/" + } +} diff --git a/.github/kokoro/db-full.sh b/.github/kokoro/db-full.sh new file mode 100755 index 00000000..a2ee522d --- /dev/null +++ b/.github/kokoro/db-full.sh @@ -0,0 +1,130 @@ +#!/bin/bash + +set -e + +cd github/$KOKORO_DIR/ + +source ./.github/kokoro/steps/hostsetup.sh +source ./.github/kokoro/steps/hostinfo.sh +source ./.github/kokoro/steps/git.sh + +source ./.github/kokoro/steps/xilinx.sh + +source ./.github/kokoro/steps/prjxray-env.sh + +echo +echo "========================================" +echo "Downloading current database" +echo "----------------------------------------" +( + script --return --flush --command "./download-latest-db.sh" - +) +echo "----------------------------------------" + +source settings/$XRAY_SETTINGS.sh + +echo +echo "========================================" +echo "Cleaning out current database" +echo "----------------------------------------" +( + cd database + make clean-${XRAY_SETTINGS}-db +) +echo "----------------------------------------" + +echo +echo "========================================" +echo "Running Database build" +echo "----------------------------------------" +( + cd fuzzers + + # Output which fuzzers we are going to run + echo "make --dry-run" + make --dry-run + echo "----------------------------------------" + + # Run the fuzzers + export MAX_VIVADO_PROCESS=$CORES + set -x + script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$CORES" - + set +x + echo "----------------------------------------" + + # Check there is nothing to do after running... + echo + if [ $(make --dry-run | grep -v 'Nothing to be done' | wc -l) -gt 0 ]; then + echo "The following targets need to still run!" + make --dry-run + echo "----------------------------------------" + echo "Debug output on why they still need to run" + make --dry-run --debug + echo "----------------------------------------" + exit 1 + else + echo "All good, nothing more to do!" + fi +) +echo "----------------------------------------" + +# Check the database +#make checkdb-${XRAY_SETTINGS} || true +# Format the database +make formatdb-${XRAY_SETTINGS} + +# Output if the database has differences +echo +echo "========================================" +echo " Database Differences" +echo "----------------------------------------" +( + cd database + echo "----------------------------------------" + echo " Database Status" + echo "----------------------------------------" + git status + git add * + echo "----------------------------------------" + echo + echo "----------------------------------------" + echo " Database Diff Summary" + echo "----------------------------------------" + git diff --stat --irreversible-delete --find-renames --find-copies --ignore-all-space + echo + echo "----------------------------------------" + echo " Database Diff" + echo "----------------------------------------" + git diff --color --irreversible-delete --find-renames --find-copies --ignore-all-space + echo + echo "----------------------------------------" + echo " Generating pretty diff" + echo "----------------------------------------" + diff2html --summary=open --file diff.html --format html \ + -- \ + --irreversible-delete --find-renames --find-copies --ignore-all-space \ + || true + diff2html --file diff.json --format json \ + -- \ + --irreversible-delete --find-renames --find-copies --ignore-all-space \ + || true +) +echo "----------------------------------------" + +# Check the database and fail if it is broken. +#make checkdb-${XRAY_SETTINGS} + +# If we get here, then all the fuzzers completed fine. Hence we are +# going to assume we don't want to keep all the build / logs / etc (as +# they are quite large). Thus do a clean to get rid of them. +echo +echo "========================================" +echo " Cleaning up after success" +echo "----------------------------------------" +( + cd fuzzers + echo + echo "Cleaning up so CI doesn't save all the excess data." + make clean +) +echo "----------------------------------------" diff --git a/.github/kokoro/db-quick.sh b/.github/kokoro/db-quick.sh new file mode 100755 index 00000000..35c2aa42 --- /dev/null +++ b/.github/kokoro/db-quick.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e + +cd github/$KOKORO_DIR/ + +source ./.github/kokoro/steps/hostsetup.sh +source ./.github/kokoro/steps/hostinfo.sh +source ./.github/kokoro/steps/git.sh + +source ./.github/kokoro/steps/xilinx.sh + +source ./.github/kokoro/steps/prjxray-env.sh + +echo +echo "========================================" +echo "Downloading current database" +echo "----------------------------------------" +( + ./download-latest-db.sh +) +echo "----------------------------------------" + +source settings/$XRAY_SETTINGS.sh + +echo +echo "========================================" +echo "Running quick fuzzer sanity check" +echo "----------------------------------------" +( + cd fuzzers + echo "make --dry-run" + make --dry-run + echo "----------------------------------------" + export MAX_VIVADO_PROCESS=$CORES + set -x + script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$CORES QUICK=y" - + set +x +) +echo "----------------------------------------" diff --git a/.github/kokoro/kokoro-cfg.py b/.github/kokoro/kokoro-cfg.py new file mode 100755 index 00000000..aa8a1a7e --- /dev/null +++ b/.github/kokoro/kokoro-cfg.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +db_full = """\ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "symbiflow-prjxray-%(kokoro_type)s-db-%(part)s/.github/kokoro/db-full.sh" + +timeout_mins: 4320 + +action { + define_artifacts { + # File types + regex: "**/diff.html" + regex: "**/diff.json" + regex: "**/*result*.xml" + regex: "**/*sponge_log.xml" + # Whole directories + # regex: "**/build/**" - Currently kokoro dies on number of artifacts. + regex: "**/build/*.log" + regex: "**/logs/**" + # The database + regex: "**/database/%(part)s/**" + strip_prefix: "github/symbiflow-prjxray-%(kokoro_type)s-db-%(part)s/" + } +} + +env_vars { + key: "KOKORO_TYPE" + value: "%(kokoro_type)s" +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-%(kokoro_type)s-db-%(part)s" +} + +env_vars { + key: "XRAY_SETTINGS" + value: "%(part)s" +} + +env_vars { + key: "XRAY_BUILD_TYPE" + value: "full" +} +""" + +for part in ['artix7', 'kintex7', 'zynq7']: + with open("continuous-db-%s.cfg" % part, "w") as f: + f.write(db_full % { + 'part': part, + 'kokoro_type': 'continuous', + }) + + with open("presubmit-db-%s.cfg" % part, "w") as f: + f.write(db_full % { + 'part': part, + 'kokoro_type': 'presubmit', + }) diff --git a/.github/kokoro/presubmit-db-artix7.cfg b/.github/kokoro/presubmit-db-artix7.cfg new file mode 100644 index 00000000..acbb99ef --- /dev/null +++ b/.github/kokoro/presubmit-db-artix7.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "symbiflow-prjxray-presubmit-db-artix7/.github/kokoro/db-full.sh" + +timeout_mins: 4320 + +action { + define_artifacts { + # File types + regex: "**/diff.html" + regex: "**/diff.json" + regex: "**/*result*.xml" + regex: "**/*sponge_log.xml" + # Whole directories + # regex: "**/build/**" - Currently kokoro dies on number of artifacts. + regex: "**/build/*.log" + regex: "**/logs/**" + # The database + regex: "**/database/artix7/**" + strip_prefix: "github/symbiflow-prjxray-presubmit-db-artix7/" + } +} + +env_vars { + key: "KOKORO_TYPE" + value: "presubmit" +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-presubmit-db-artix7" +} + +env_vars { + key: "XRAY_SETTINGS" + value: "artix7" +} + +env_vars { + key: "XRAY_BUILD_TYPE" + value: "full" +} diff --git a/.github/kokoro/presubmit-db-kintex7.cfg b/.github/kokoro/presubmit-db-kintex7.cfg new file mode 100644 index 00000000..21b6b471 --- /dev/null +++ b/.github/kokoro/presubmit-db-kintex7.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "symbiflow-prjxray-presubmit-db-kintex7/.github/kokoro/db-full.sh" + +timeout_mins: 4320 + +action { + define_artifacts { + # File types + regex: "**/diff.html" + regex: "**/diff.json" + regex: "**/*result*.xml" + regex: "**/*sponge_log.xml" + # Whole directories + # regex: "**/build/**" - Currently kokoro dies on number of artifacts. + regex: "**/build/*.log" + regex: "**/logs/**" + # The database + regex: "**/database/kintex7/**" + strip_prefix: "github/symbiflow-prjxray-presubmit-db-kintex7/" + } +} + +env_vars { + key: "KOKORO_TYPE" + value: "presubmit" +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-presubmit-db-kintex7" +} + +env_vars { + key: "XRAY_SETTINGS" + value: "kintex7" +} + +env_vars { + key: "XRAY_BUILD_TYPE" + value: "full" +} diff --git a/.github/kokoro/presubmit-db-zynq7.cfg b/.github/kokoro/presubmit-db-zynq7.cfg new file mode 100644 index 00000000..1413a966 --- /dev/null +++ b/.github/kokoro/presubmit-db-zynq7.cfg @@ -0,0 +1,42 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "symbiflow-prjxray-presubmit-db-zynq7/.github/kokoro/db-full.sh" + +timeout_mins: 4320 + +action { + define_artifacts { + # File types + regex: "**/diff.html" + regex: "**/diff.json" + regex: "**/*result*.xml" + regex: "**/*sponge_log.xml" + # Whole directories + # regex: "**/build/**" - Currently kokoro dies on number of artifacts. + regex: "**/build/*.log" + regex: "**/logs/**" + # The database + regex: "**/database/zynq7/**" + strip_prefix: "github/symbiflow-prjxray-presubmit-db-zynq7/" + } +} + +env_vars { + key: "KOKORO_TYPE" + value: "presubmit" +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-presubmit-db-zynq7" +} + +env_vars { + key: "XRAY_SETTINGS" + value: "zynq7" +} + +env_vars { + key: "XRAY_BUILD_TYPE" + value: "full" +} diff --git a/.github/kokoro/steps/git.sh b/.github/kokoro/steps/git.sh new file mode 100755 index 00000000..1837389c --- /dev/null +++ b/.github/kokoro/steps/git.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +echo +echo "========================================" +echo "Git log" +echo "----------------------------------------" +echo "----------------------------------------" + +echo +echo "========================================" +echo "Git fetching tags" +echo "----------------------------------------" +git fetch --tags || true +echo "----------------------------------------" + +echo +echo "========================================" +echo "Git version info" +echo "----------------------------------------" +git log -n1 +echo "----------------------------------------" +git describe --tags || true +echo "----------------------------------------" +git describe --tags --always || true +echo "----------------------------------------" diff --git a/.github/kokoro/steps/hostinfo.sh b/.github/kokoro/steps/hostinfo.sh new file mode 100755 index 00000000..6a00c37f --- /dev/null +++ b/.github/kokoro/steps/hostinfo.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +echo +echo "========================================" +echo "Host Environment" +echo "----------------------------------------" +export +echo "----------------------------------------" + +echo +echo "========================================" +echo "Host CPU" +echo "----------------------------------------" +export CORES=$(nproc --all) +echo "Cores: $CORES" +echo +echo "Memory" +echo "----------------------------------------" +cat /proc/meminfo +echo "----------------------------------------" + +echo +echo "========================================" +echo "Host files" +echo "----------------------------------------" +echo $PWD +echo "----------------------------------------" +find . | sort +echo "----------------------------------------" diff --git a/.github/kokoro/steps/hostsetup.sh b/.github/kokoro/steps/hostsetup.sh new file mode 100755 index 00000000..35395950 --- /dev/null +++ b/.github/kokoro/steps/hostsetup.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +set -e + +echo +echo "========================================" +echo "Host updating packages" +echo "----------------------------------------" +sudo apt-get update +echo "----------------------------------------" + +echo +echo "========================================" +echo "Host remove packages" +echo "----------------------------------------" +sudo apt-get remove -y \ + python-pytest \ + +echo "----------------------------------------" +echo +echo "========================================" +echo "Host install packages" +echo "----------------------------------------" +sudo apt-get install -y \ + bison \ + build-essential \ + ca-certificates \ + clang-format \ + cmake \ + curl \ + flex \ + fontconfig \ + git \ + jq \ + nodejs \ + psmisc \ + python \ + python3 \ + python3-dev \ + python3-virtualenv \ + python3-yaml \ + virtualenv \ + +echo "----------------------------------------" + +( + cd /tmp + # Upgrade pstree to support the -T flag. + wget https://storage.googleapis.com/prjxray-deps-debs/psmisc_23.2-1_amd64.deb + sudo dpkg --install psmisc_23.2-1_amd64.deb + which pstree + pstree --help || true +) + +echo "----------------------------------------" + +echo +echo "========================================" +echo "Getting diff2html to produce pretty database diffs" +echo "----------------------------------------" +( + sudo npm install -g diff2html-cli +) diff --git a/.github/kokoro/steps/prjxray-env.sh b/.github/kokoro/steps/prjxray-env.sh new file mode 100755 index 00000000..42a54f9d --- /dev/null +++ b/.github/kokoro/steps/prjxray-env.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +echo +echo "========================================" +echo "Build the C++ tools" +echo "----------------------------------------" +make build --output-sync=target --warn-undefined-variables -j $CORES +echo "----------------------------------------" + +echo +echo "========================================" +echo "Setup the Python environment" +echo "----------------------------------------" +make env --output-sync=target --warn-undefined-variables diff --git a/.github/kokoro/steps/xilinx.sh b/.github/kokoro/steps/xilinx.sh new file mode 100755 index 00000000..d874c37f --- /dev/null +++ b/.github/kokoro/steps/xilinx.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Fix up things related to Xilinx tool chain. + +ls -l ~/.Xilinx +sudo chown -R $USER ~/.Xilinx + +export XILINX_LOCAL_USER_DATA=no diff --git a/.github/kokoro/tests.cfg b/.github/kokoro/tests.cfg new file mode 100644 index 00000000..93b85287 --- /dev/null +++ b/.github/kokoro/tests.cfg @@ -0,0 +1,19 @@ +build_file: "symbiflow-prjxray-tests/.github/kokoro/tests.sh" + +timeout_mins: 10 + +action { + define_artifacts { + regex: "**/*.log" + regex: "**/*sponge_log.xml" + regex: "**/build/**/*.xml" + regex: "**/build/*.xml" + regex: "*result*.xml" + strip_prefix: "github/symbiflow-prjxray-tests/" + } +} + +env_vars { + key: "KOKORO_DIR" + value: "symbiflow-prjxray-tests" +} diff --git a/.github/kokoro/tests.sh b/.github/kokoro/tests.sh new file mode 100755 index 00000000..91eb01e5 --- /dev/null +++ b/.github/kokoro/tests.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e + +cd github/$KOKORO_DIR/ + +source ./.github/kokoro/steps/hostsetup.sh +source ./.github/kokoro/steps/hostinfo.sh +source ./.github/kokoro/steps/git.sh + +source ./.github/kokoro/steps/prjxray-env.sh + +echo +echo "========================================" +echo "Running tests" +echo "----------------------------------------" +( + make test --output-sync=target --warn-undefined-variables +) +echo "----------------------------------------" + +echo +echo "========================================" +echo "Copying tests logs" +echo "----------------------------------------" +( + cat build/*test_results.xml + mkdir build/py + cp build/py_test_results.xml build/py/sponge_log.xml + mkdir build/cpp + cp build/cpp_test_results.xml build/cpp/sponge_log.xml +) +echo "----------------------------------------" diff --git a/.travis.yml b/.travis.yml index db1a2588..75ba367a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ addons: packages: - clang-format-5.0 - g++-6 + - xsltproc install: - export CC=gcc-6 diff --git a/Makefile b/Makefile index 9c49b52f..875132ab 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ ALL_EXCLUDE = third_party .git env build # Tools + Environment IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi; env: - virtualenv --python=python3 --system-site-packages env + virtualenv --python=python3 env # Install prjxray ln -sf $(PWD)/prjxray env/lib/python3.*/site-packages/ $(IN_ENV) python -c "import prjxray" @@ -34,13 +34,14 @@ test: test-py test-cpp @true test-py: - $(IN_ENV) PYTHONPATH="$(PWD):$(PWD)/third_party/fasm:$PYTHONPATH" py.test $(TEST_EXCLUDE) --doctest-modules --junitxml=build/py_test_results.xml + $(IN_ENV) which py.test; py.test $(TEST_EXCLUDE) --doctest-modules --junitxml=build/py_test_results.xml test-cpp: mkdir -p build cd build && cmake -DPRJXRAY_BUILD_TESTING=ON .. cd build && $(MAKE) -s cd build && ctest --no-compress-output -T Test -C RelWithDebInfo --output-on-failure + xsltproc .github/kokoro/ctest2junit.xsl build/Testing/*/Test.xml > build/cpp_test_results.xml .PHONY: test test-py test-cpp @@ -69,28 +70,49 @@ format: format-cpp format-docs format-py format-tcl .PHONY: format format-cpp format-py format-tcl -# Project X-Ray database +# Targets related to Project X-Ray databases # ------------------------ +DATABASES=artix7 kintex7 zynq7 + +define database + +# $(1) - Database name + +checkdb-$(1): + @echo + @echo "Checking $(1) database" + @echo "============================" + @$(IN_ENV) python3 utils/checkdb.py --db-root database/$(1) + +formatdb-$(1): + @echo + @echo "Formatting $(1) database" + @echo "============================" + @$(IN_ENV) cd database/$(1); python3 ../../utils/sort_db.py + @if [ -e database/Info.md ]; then $(IN_ENV) ./utils/info_md.py --keep; fi + +.PHONY: checkdb-$(1) formatdb-$(1) +.NOTPARALLEL: checkdb-$(1) formatdb-$(1) + +checkdb: checkdb-$(1) +formatdb: formatdb-$(1) + +endef + +$(foreach DB,$(DATABASES),$(eval $(call database,$(DB)))) + checkdb: - @for DB in database/*; do if [ -d $$DB ]; then \ - echo ; \ - echo "Checking $$DB"; \ - echo "============================"; \ - $(IN_ENV) python3 utils/checkdb.py --db-root $$DB; \ - fi; done + @true formatdb: - @for DB in database/*; do if [ -d $$DB ]; then \ - echo ; \ - echo "Formatting $$DB"; \ - echo "============================"; \ - ($(IN_ENV) cd $$DB; python3 ../../utils/sort_db.py || exit 1) || exit 1; \ - fi; done - @make checkdb - $(IN_ENV) ./utils/info_md.py --keep + @true + +.PHONY: checkdb formatdb clean: $(MAKE) -C database clean $(MAKE) -C fuzzers clean rm -rf build + +.PHONY: clean diff --git a/download-latest-db.sh b/download-latest-db.sh index a01c44d1..8d0ce8aa 100755 --- a/download-latest-db.sh +++ b/download-latest-db.sh @@ -4,11 +4,5 @@ GITHUB_PROTO=${1:-https} GITHUB_URL=$GITHUB_PROTO://github.com/SymbiFlow/prjxray-db.git rm -rf database git clone $GITHUB_URL database -# Causes confusion if you try to commit in DB dir -# But doesn't effect most people, probably leave as is -# rm -rf database/.git -# travis, .gitignore, etc -rm -f database/* 2>/dev/null -rm -f database/.* 2>/dev/null -# Restore settings files so fuzzers run correctly +# Update files in the database from our version so fuzzers run correctly. git checkout HEAD database diff --git a/fuzzers/Makefile b/fuzzers/Makefile index 20754216..78dd8a1c 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -87,7 +87,7 @@ $(eval $(call fuzzer,073-get_counts,)) $(eval $(call fuzzer,074-dump_all,005-tilegrid 072-ordered_wires)) endif endif -$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid)) +#$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid)) quick: $(MAKE) QUICK=Y diff --git a/utils/info_md.py b/utils/info_md.py index aac36360..cd9d292e 100755 --- a/utils/info_md.py +++ b/utils/info_md.py @@ -70,7 +70,7 @@ Keep the existing commit information. args = parser.parse_args() info_md_filename = os.path.join('database', 'Info.md') - assert os.path.exists(info_md_filename) + assert os.path.exists(info_md_filename), info_md_filename info_md = []