From 4583a35ed62c78719c69008805c940a9b58eab40 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 15:54:55 -0800 Subject: [PATCH 01/16] rempips todo: remove --strict hack, build-dir arg Signed-off-by: John McMaster --- fuzzers/056-rempips/maketodo.py | 46 ++++++++++++--------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/fuzzers/056-rempips/maketodo.py b/fuzzers/056-rempips/maketodo.py index 59391a8a..95456df3 100644 --- a/fuzzers/056-rempips/maketodo.py +++ b/fuzzers/056-rempips/maketodo.py @@ -4,31 +4,24 @@ import os, re, sys from prjxray import util -def maketodo(pipfile, dbfile, strict=True): +def maketodo(pipfile, dbfile, verbose=False): '''Print name of all pips in pipfile but not dbfile''' todos = set() with open(pipfile, "r") as f: for line in f: line = line.split() todos.add(line[0]) - print('%s: %u entries' % (pipfile, len(todos)), file=sys.stderr) + verbose and print( + '%s: %u entries' % (pipfile, len(todos)), file=sys.stderr) # Support generate without existing DB - if os.path.exists(dbfile) or strict: + if os.path.exists(dbfile): with open(dbfile, "r") as f: for line in f: line = line.split() pip = line[0] - try: - todos.remove(pip) - except KeyError: - # DB (incorrectly) had multiple entries - # Workaround for testing on old DB revision - if strict: - raise - print( - 'WARNING: failed to remove pip %s' % pip, - file=sys.stderr) - print('Remove %s: %u entries' % (dbfile, len(todos)), file=sys.stderr) + todos.remove(pip) + verbose and print( + 'Remove %s: %u entries' % (dbfile, len(todos)), file=sys.stderr) drops = 0 lines = 0 for line in todos: @@ -37,20 +30,16 @@ def maketodo(pipfile, dbfile, strict=True): continue print(line) lines += 1 - print('Print %u entries w/ %u drops' % (lines, drops), file=sys.stderr) + verbose and print( + 'Print %u entries w/ %u drops' % (lines, drops), file=sys.stderr) -def run(strict=True): - maketodo( - "build/pips_int_l.txt", - "%s/%s/segbits_int_l.db" % - (os.getenv("XRAY_DATABASE_DIR"), os.getenv("XRAY_DATABASE")), - strict=strict) - maketodo( - "build/pips_int_r.txt", - "%s/%s/segbits_int_r.db" % - (os.getenv("XRAY_DATABASE_DIR"), os.getenv("XRAY_DATABASE")), - strict=strict) +def run(build_dir): + db_dir = "%s/%s" % ( + os.getenv("XRAY_DATABASE_DIR"), os.getenv("XRAY_DATABASE")) + + maketodo("%s/pips_int_l.txt" % build_dir, "%s/segbits_int_l.db" % db_dir) + maketodo("%s/pips_int_r.txt" % build_dir, "%s/segbits_int_r.db" % db_dir) def main(): @@ -59,11 +48,10 @@ def main(): parser = argparse.ArgumentParser( description="Print list of known but unsolved PIPs") - # util.db_root_arg(parser) - parser.add_argument('--no-strict', action='store_true', help='') + parser.add_argument('--build-dir', default="build", help='') args = parser.parse_args() - run(strict=not args.no_strict) + run(build_dir=args.build_dir) if __name__ == '__main__': From 821c82a8794266b401a3241204b748d4e8e6384b Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:01:55 -0800 Subject: [PATCH 02/16] int_loop_check: --max-iters Signed-off-by: John McMaster --- fuzzers/int_loop_check.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fuzzers/int_loop_check.py b/fuzzers/int_loop_check.py index 25d66f95..33533b69 100644 --- a/fuzzers/int_loop_check.py +++ b/fuzzers/int_loop_check.py @@ -52,6 +52,7 @@ def run( min_iters=None, stable_iters=None, timeout_iters=None, + max_iters=None, zero_entries=None, verbose=False): timeout_fn = "%s/timeout" % todo_dir @@ -82,6 +83,12 @@ def run( print("Incomplete: not enough iters") sys.exit(1) + if max_iters is not None and max_iter >= max_iters: + print( + "Complete: reached max iters (want %u, got %u)" % + (max_iters, max_iter)) + sys.exit(0) + if timeout_iters is not None and max_iter > timeout_iters: print("ERROR: timeout (max %u, got %u)" % (timeout_iters, max_iter)) with open(timeout_fn, "w") as _f: @@ -124,6 +131,10 @@ def main(): '--timeout-iters', default=None, help='Max number of entries before creating todo/timeout') + parser.add_argument( + '--max-iters', + default=None, + help='Max number of entries before declaring success') parser.add_argument( '--zero-entries', action="store_true", @@ -138,6 +149,7 @@ def main(): zint(args.min_iters), zint(args.stable_iters), zint(args.timeout_iters), + zint(args.max_iters), args.zero_entries, verbose=args.verbose) From 2ce60d56a793430cd486b47304d82eceafb4b4d7 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:02:41 -0800 Subject: [PATCH 03/16] piplist: use dedicated .v Signed-off-by: John McMaster --- fuzzers/piplist.tcl | 2 +- fuzzers/piplist.v | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 fuzzers/piplist.v diff --git a/fuzzers/piplist.tcl b/fuzzers/piplist.tcl index 1711bd4f..f31506f6 100644 --- a/fuzzers/piplist.tcl +++ b/fuzzers/piplist.tcl @@ -1,6 +1,6 @@ create_project -force -part $::env(XRAY_PART) piplist piplist -read_verilog $::env(FUZDIR)/top.v +read_verilog $::env(XRAY_DIR)/fuzzers/piplist.v synth_design -top top set_property -dict "PACKAGE_PIN $::env(XRAY_PIN_00) IOSTANDARD LVCMOS33" [get_ports i] diff --git a/fuzzers/piplist.v b/fuzzers/piplist.v new file mode 100644 index 00000000..c0e91c58 --- /dev/null +++ b/fuzzers/piplist.v @@ -0,0 +1,3 @@ +module top (input i, output o); + assign o = i; +endmodule From a46c811be7698e9dc3bbfe10bea12384c115b1d0 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:05:08 -0800 Subject: [PATCH 04/16] intpips: iterative solve Signed-off-by: John McMaster --- fuzzers/050-intpips/.gitignore | 7 +++-- fuzzers/050-intpips/Makefile | 44 ++++++++++++++++++++++---------- fuzzers/050-intpips/generate.sh | 2 ++ fuzzers/050-intpips/generate.tcl | 4 +-- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/fuzzers/050-intpips/.gitignore b/fuzzers/050-intpips/.gitignore index c9065554..a747a2b4 100644 --- a/fuzzers/050-intpips/.gitignore +++ b/fuzzers/050-intpips/.gitignore @@ -1,4 +1,3 @@ -/specimen_[0-9][0-9][0-9]/ -/seg_int_[lr].segbits -/mask_clbl[lm]_[lr].segbits -/run.ok +build +run.ok +todo diff --git a/fuzzers/050-intpips/Makefile b/fuzzers/050-intpips/Makefile index 6e5bc50a..2ae4ca97 100644 --- a/fuzzers/050-intpips/Makefile +++ b/fuzzers/050-intpips/Makefile @@ -1,11 +1,16 @@ -ifeq ($(QUICK),Y) -N := 10 -else -N := 200 -endif - -SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N))) +# Do relatively large batch to keep parallelism high +# LCM between 12 (CPUs on my system) and 16, a common CPU count +# WARNING: N must be relatively high (say 10) or segmatch -m/M will fail +N := 48 +# Driven by int_loop.sh +ITER := 1 +# See int_loop_check.py +# Original did 200 specimins open loop +CHECK_ARGS := --max-iters 6 --stable-iters 3 +SPECIMENS := $(addprefix build/$(ITER)/specimen_,$(shell seq -f '%03.0f' $(N))) SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) +# Individual fuzzer directory, such as ~/prjxray/fuzzers/010-lutinit +export FUZDIR=$(shell pwd) database: $(SPECIMENS_OK) ${XRAY_SEGMATCH} -m 5 -M 15 -o build/segbits_int_l.db $(addsuffix /segdata_int_l.txt,$(SPECIMENS)) @@ -24,19 +29,32 @@ pushdb: ${XRAY_MERGEDB} mask_clblm_l build/mask_clblm_l.db ${XRAY_MERGEDB} mask_clblm_r build/mask_clblm_r.db -$(SPECIMENS_OK): - mkdir -p build +$(SPECIMENS_OK): build/todo.txt + mkdir -p build/$(ITER) bash generate.sh $(subst /OK,,$@) touch $@ +build/pips_int_l.txt: $(XRAY_DIR)/fuzzers/piplist.tcl + mkdir -p build/$(ITER) + cd build/$(ITER) && vivado -mode batch -source $(XRAY_DIR)/fuzzers/piplist.tcl + +build/todo.txt: build/pips_int_l.txt maketodo.py + python3 maketodo.py --build-dir build/$(ITER) >build/todo_all.txt + cat build/todo_all.txt | sort -R > build/todo.txt.tmp + mv build/todo.txt.tmp build/todo.txt + +# XXX: conider moving to script run: $(MAKE) clean - $(MAKE) database - $(MAKE) pushdb + XRAY_DIR=${XRAY_DIR} MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" QUICK=$(QUICK) $(XRAY_DIR)/fuzzers/int_loop.sh --check-args "$(CHECK_ARGS)" touch run.ok clean: - rm -rf build run.ok + rm -rf build run.ok todo -.PHONY: database pushdb run clean +# Remove iteration specific files, but keep piplist.tcl output +cleanprj: + rm -rf build/$(ITER) + +.PHONY: database pushdb run clean cleanprj diff --git a/fuzzers/050-intpips/generate.sh b/fuzzers/050-intpips/generate.sh index a51b54f3..1f6a06d4 100644 --- a/fuzzers/050-intpips/generate.sh +++ b/fuzzers/050-intpips/generate.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -ex + FUZDIR=$PWD source ${XRAY_GENHEADER} diff --git a/fuzzers/050-intpips/generate.tcl b/fuzzers/050-intpips/generate.tcl index 37c2d1d5..cd3e31ca 100644 --- a/fuzzers/050-intpips/generate.tcl +++ b/fuzzers/050-intpips/generate.tcl @@ -1,7 +1,7 @@ create_project -force -part $::env(XRAY_PART) design design -read_verilog ../../top.v -read_verilog ../../picorv32.v +read_verilog $::env(FUZDIR)/top.v +read_verilog $::env(FUZDIR)/picorv32.v synth_design -top top set_property -dict "PACKAGE_PIN $::env(XRAY_PIN_00) IOSTANDARD LVCMOS33" [get_ports clk] From e2149d065f4eb5cbf9ffb606655b9f0ae990435d Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:17:37 -0800 Subject: [PATCH 05/16] int_loop: --merge Signed-off-by: John McMaster --- fuzzers/int_loop.mk | 2 +- fuzzers/int_loop.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fuzzers/int_loop.mk b/fuzzers/int_loop.mk index 5ee8393a..63308e10 100644 --- a/fuzzers/int_loop.mk +++ b/fuzzers/int_loop.mk @@ -37,7 +37,7 @@ build/todo.txt: build/pips_int_l.txt maketodo.py # XXX: conider moving to script run: $(MAKE) clean - XRAY_DIR=${XRAY_DIR} MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" QUICK=$(QUICK) $(XRAY_DIR)/fuzzers/int_loop.sh --check-args "$(CHECK_ARGS)" + XRAY_DIR=${XRAY_DIR} MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" QUICK=$(QUICK) $(XRAY_DIR)/fuzzers/int_loop.sh --check-args "$(CHECK_ARGS)" --pushdb touch run.ok clean: diff --git a/fuzzers/int_loop.sh b/fuzzers/int_loop.sh index d62c0394..2052e039 100755 --- a/fuzzers/int_loop.sh +++ b/fuzzers/int_loop.sh @@ -4,9 +4,13 @@ usage() { echo "Run makefile until termination condition" echo "usage: int_loop.sh [args]" echo "--check-args int_loop_check.py args" + # intpips ingests all segbits files at once and does a push at the end + # other loopers do a push every pass + echo "--pushdb make pushdb after successful make database" } check_args= +pushdb=false while [[ $# -gt 0 ]]; do case "$1" in --check-args) @@ -14,6 +18,10 @@ while [[ $# -gt 0 ]]; do shift shift ;; + --pushdb) + pushdb=true + shift + ;; -h|--help) usage exit 0 @@ -47,7 +55,9 @@ while true; do cp build/todo.txt todo/${i}.txt; cp build/todo_all.txt todo/${i}_all.txt; if ${MAKE} ${MAKEFLAGS} database; then - ${MAKE} ${MAKEFLAGS} pushdb; + if $pushdb ; then + ${MAKE} ${MAKEFLAGS} pushdb; + fi fi; if [ "$QUICK" = "Y" ] ; then break; From c93c3f601a3b373d092cb0fcb8cea28fa364a239 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:18:02 -0800 Subject: [PATCH 06/16] intpips: push uses all iters, not just current Signed-off-by: John McMaster --- fuzzers/050-intpips/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fuzzers/050-intpips/Makefile b/fuzzers/050-intpips/Makefile index 2ae4ca97..32181de7 100644 --- a/fuzzers/050-intpips/Makefile +++ b/fuzzers/050-intpips/Makefile @@ -13,12 +13,12 @@ SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) export FUZDIR=$(shell pwd) database: $(SPECIMENS_OK) - ${XRAY_SEGMATCH} -m 5 -M 15 -o build/segbits_int_l.db $(addsuffix /segdata_int_l.txt,$(SPECIMENS)) - ${XRAY_SEGMATCH} -m 5 -M 15 -o build/segbits_int_r.db $(addsuffix /segdata_int_r.txt,$(SPECIMENS)) - ${XRAY_MASKMERGE} build/mask_clbll_l.db $(addsuffix /segdata_int_l.txt,$(SPECIMENS)) - ${XRAY_MASKMERGE} build/mask_clbll_r.db $(addsuffix /segdata_int_r.txt,$(SPECIMENS)) - ${XRAY_MASKMERGE} build/mask_clblm_l.db $(addsuffix /segdata_int_l.txt,$(SPECIMENS)) - ${XRAY_MASKMERGE} build/mask_clblm_r.db $(addsuffix /segdata_int_r.txt,$(SPECIMENS)) + ${XRAY_SEGMATCH} -m 5 -M 15 -o build/segbits_int_l.db $(shell find build -name segdata_int_l.txt) + ${XRAY_SEGMATCH} -m 5 -M 15 -o build/segbits_int_r.db $(shell find build -name segdata_int_r.txt) + ${XRAY_MASKMERGE} build/mask_clbll_l.db $(shell find build -name segdata_int_l.txt) + ${XRAY_MASKMERGE} build/mask_clbll_r.db $(shell find build -name segdata_int_r.txt) + ${XRAY_MASKMERGE} build/mask_clblm_l.db $(shell find build -name segdata_int_l.txt) + ${XRAY_MASKMERGE} build/mask_clblm_r.db $(shell find build -name segdata_int_r.txt) ${XRAY_DBFIXUP} --db-root build --clb-int pushdb: From ede69d95de0803f1579ace023c6a8417a796d046 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:35:03 -0800 Subject: [PATCH 07/16] int_loop.sh: pass N argument to make Signed-off-by: John McMaster --- fuzzers/int_loop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/int_loop.sh b/fuzzers/int_loop.sh index 2052e039..b20b17bc 100755 --- a/fuzzers/int_loop.sh +++ b/fuzzers/int_loop.sh @@ -54,7 +54,7 @@ while true; do i=$((i+1)); cp build/todo.txt todo/${i}.txt; cp build/todo_all.txt todo/${i}_all.txt; - if ${MAKE} ${MAKEFLAGS} database; then + if ${MAKE} ${MAKEFLAGS} N=$i database; then if $pushdb ; then ${MAKE} ${MAKEFLAGS} pushdb; fi From b384f1f09e671942084f732a5a2560b7bf809a71 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:35:24 -0800 Subject: [PATCH 08/16] intpips: restore QUICK N Signed-off-by: John McMaster --- fuzzers/050-intpips/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fuzzers/050-intpips/Makefile b/fuzzers/050-intpips/Makefile index 32181de7..1fc4622d 100644 --- a/fuzzers/050-intpips/Makefile +++ b/fuzzers/050-intpips/Makefile @@ -1,7 +1,11 @@ +# WARNING: N must be relatively high (say 10) or segmatch -m/M will fail +ifeq ($(QUICK),Y) +N := 10 +else # Do relatively large batch to keep parallelism high # LCM between 12 (CPUs on my system) and 16, a common CPU count -# WARNING: N must be relatively high (say 10) or segmatch -m/M will fail N := 48 +endif # Driven by int_loop.sh ITER := 1 # See int_loop_check.py From 35a473ffed9902e1ba4bf13a953e725472df489b Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:35:39 -0800 Subject: [PATCH 09/16] intpips: maketodo.py Signed-off-by: John McMaster --- fuzzers/050-intpips/maketodo.py | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 fuzzers/050-intpips/maketodo.py diff --git a/fuzzers/050-intpips/maketodo.py b/fuzzers/050-intpips/maketodo.py new file mode 100644 index 00000000..b128c0bf --- /dev/null +++ b/fuzzers/050-intpips/maketodo.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +import os, re, sys +from prjxray import util + + +def maketodo(pipfile, dbfile, verbose=False): + '''Print name of all pips in pipfile but not dbfile''' + todos = set() + with open(pipfile, "r") as f: + for line in f: + line = line.split() + todos.add(line[0]) + verbose and print( + '%s: %u entries' % (pipfile, len(todos)), file=sys.stderr) + # Support generate without existing DB + if os.path.exists(dbfile): + with open(dbfile, "r") as f: + for line in f: + line = line.split() + pip = line[0] + todos.remove(pip) + verbose and print( + 'Remove %s: %u entries' % (dbfile, len(todos)), file=sys.stderr) + drops = 0 + lines = 0 + for line in todos: + if line.endswith(".VCC_WIRE"): + drops += 1 + continue + print(line) + lines += 1 + verbose and print( + 'Print %u entries w/ %u drops' % (lines, drops), file=sys.stderr) + + +def run(build_dir): + maketodo( + "%s/pips_int_l.txt" % build_dir, "%s/segbits_int_l.db" % build_dir) + maketodo( + "%s/pips_int_r.txt" % build_dir, "%s/segbits_int_r.db" % build_dir) + + +def main(): + import argparse + + parser = argparse.ArgumentParser( + description="Print list of known but unsolved PIPs") + + parser.add_argument('--build-dir', default="build", help='') + args = parser.parse_args() + + run(build_dir=args.build_dir) + + +if __name__ == '__main__': + main() From 3d50e89dcda78fdfc62b5f169bc207ca28ecaf94 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 16:46:05 -0800 Subject: [PATCH 10/16] intpips: correct pushdb at end Signed-off-by: John McMaster --- fuzzers/int_loop.mk | 2 +- fuzzers/int_loop.sh | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fuzzers/int_loop.mk b/fuzzers/int_loop.mk index 63308e10..76190a13 100644 --- a/fuzzers/int_loop.mk +++ b/fuzzers/int_loop.mk @@ -37,7 +37,7 @@ build/todo.txt: build/pips_int_l.txt maketodo.py # XXX: conider moving to script run: $(MAKE) clean - XRAY_DIR=${XRAY_DIR} MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" QUICK=$(QUICK) $(XRAY_DIR)/fuzzers/int_loop.sh --check-args "$(CHECK_ARGS)" --pushdb + XRAY_DIR=${XRAY_DIR} MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" QUICK=$(QUICK) $(XRAY_DIR)/fuzzers/int_loop.sh --check-args "$(CHECK_ARGS)" --iter-pushdb touch run.ok clean: diff --git a/fuzzers/int_loop.sh b/fuzzers/int_loop.sh index b20b17bc..a26f324e 100755 --- a/fuzzers/int_loop.sh +++ b/fuzzers/int_loop.sh @@ -6,11 +6,12 @@ usage() { echo "--check-args int_loop_check.py args" # intpips ingests all segbits files at once and does a push at the end # other loopers do a push every pass - echo "--pushdb make pushdb after successful make database" + echo "--iter-pushdb make pushdb after successful make database as opposed to end" } check_args= -pushdb=false +iter_pushdb=false +end_pushdb=true while [[ $# -gt 0 ]]; do case "$1" in --check-args) @@ -18,8 +19,9 @@ while [[ $# -gt 0 ]]; do shift shift ;; - --pushdb) - pushdb=true + --iter-pushdb) + iter_pushdb=true + end_pushdb=false shift ;; -h|--help) @@ -55,13 +57,16 @@ while true; do cp build/todo.txt todo/${i}.txt; cp build/todo_all.txt todo/${i}_all.txt; if ${MAKE} ${MAKEFLAGS} N=$i database; then - if $pushdb ; then - ${MAKE} ${MAKEFLAGS} pushdb; + if $iter_pushdb ; then + ${MAKE} ${MAKEFLAGS} pushdb fi fi; if [ "$QUICK" = "Y" ] ; then break; fi done; +if $end_pushdb ; then + ${MAKE} ${MAKEFLAGS} pushdb +fi exit 0 From 73da6c30ece637b4d88d6ea6e3214270d7e72341 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 17:56:02 -0800 Subject: [PATCH 11/16] intpips: generate print current tile number Signed-off-by: John McMaster --- fuzzers/050-intpips/generate.tcl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fuzzers/050-intpips/generate.tcl b/fuzzers/050-intpips/generate.tcl index cd3e31ca..5abf5ba9 100644 --- a/fuzzers/050-intpips/generate.tcl +++ b/fuzzers/050-intpips/generate.tcl @@ -32,8 +32,13 @@ proc write_txtdata {filename} { puts "Writing $filename." set fp [open $filename w] set all_pips [lsort -unique [get_pips -of_objects [get_nets -hierarchical]]] - foreach tile [get_tiles [regsub -all {CLBL[LM]} [get_tiles -of_objects [get_sites -of_objects [get_pblocks roi]]] INT]] { - puts "Dumping pips from tile $tile" + # FIXME: getting IOB. Don't think this works correctly + set tiles [get_tiles [regsub -all {CLBL[LM]} [get_tiles -of_objects [get_sites -of_objects [get_pblocks roi]]] INT]] + set ntiles [llength $tiles] + set tilei 0 + foreach tile $tiles { + incr tilei + puts "Dumping pips from tile $tile ($tilei / $ntiles)" foreach pip [filter $all_pips "TILE == $tile"] { set src_wire [get_wires -uphill -of_objects $pip] set dst_wire [get_wires -downhill -of_objects $pip] From 8f4f8a32628f5e18bbb84f6b56d1e78064c0d4fa Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 17:56:24 -0800 Subject: [PATCH 12/16] int_loop.sh: bug fixes Signed-off-by: John McMaster --- fuzzers/int_loop.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fuzzers/int_loop.sh b/fuzzers/int_loop.sh index a26f324e..65cc8f44 100755 --- a/fuzzers/int_loop.sh +++ b/fuzzers/int_loop.sh @@ -42,13 +42,14 @@ MAKEFLAGS=${MAKEFLAGS:-} echo "make: ${MAKE} ${MAKEFLAGS}" echo $MAKE mkdir -p todo; +i=0 while true; do ${MAKE} ${MAKEFLAGS} cleanprj; ${MAKE} ${MAKEFLAGS} build/todo.txt || exit 1; if python3 ${XRAY_DIR}/fuzzers/int_loop_check.py $check_args ; then break fi - if [ -f build/timeout ] ; then + if [ -f todo/timeout ] ; then echo "ERROR: timeout" exit 1 fi @@ -56,7 +57,7 @@ while true; do i=$((i+1)); cp build/todo.txt todo/${i}.txt; cp build/todo_all.txt todo/${i}_all.txt; - if ${MAKE} ${MAKEFLAGS} N=$i database; then + if ${MAKE} ${MAKEFLAGS} ITER=$i database; then if $iter_pushdb ; then ${MAKE} ${MAKEFLAGS} pushdb fi From a054602a4fa82d1b8522b0d20773e9e2a01273fb Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 18:29:42 -0800 Subject: [PATCH 13/16] intpips: cleanprj remove iter specific todo.txt Signed-off-by: John McMaster --- fuzzers/050-intpips/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fuzzers/050-intpips/Makefile b/fuzzers/050-intpips/Makefile index 1fc4622d..29767f12 100644 --- a/fuzzers/050-intpips/Makefile +++ b/fuzzers/050-intpips/Makefile @@ -33,6 +33,7 @@ pushdb: ${XRAY_MERGEDB} mask_clblm_l build/mask_clblm_l.db ${XRAY_MERGEDB} mask_clblm_r build/mask_clblm_r.db +# FIXME: move to iter dir $(SPECIMENS_OK): build/todo.txt mkdir -p build/$(ITER) bash generate.sh $(subst /OK,,$@) @@ -58,7 +59,7 @@ clean: # Remove iteration specific files, but keep piplist.tcl output cleanprj: - rm -rf build/$(ITER) + rm -rf build/$(ITER) build/todo.txt .PHONY: database pushdb run clean cleanprj From 539564a24cba8c080795289d0d93a0c4e8623ab7 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 18:30:19 -0800 Subject: [PATCH 14/16] int_loop: remove iter specific files at loop start Signed-off-by: John McMaster --- fuzzers/int_loop.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fuzzers/int_loop.sh b/fuzzers/int_loop.sh index 65cc8f44..ed173648 100755 --- a/fuzzers/int_loop.sh +++ b/fuzzers/int_loop.sh @@ -42,10 +42,10 @@ MAKEFLAGS=${MAKEFLAGS:-} echo "make: ${MAKE} ${MAKEFLAGS}" echo $MAKE mkdir -p todo; -i=0 +i=1 while true; do - ${MAKE} ${MAKEFLAGS} cleanprj; - ${MAKE} ${MAKEFLAGS} build/todo.txt || exit 1; + ${MAKE} ${MAKEFLAGS} ITER=$i cleanprj + ${MAKE} ${MAKEFLAGS} ITER=$i build/todo.txt if python3 ${XRAY_DIR}/fuzzers/int_loop_check.py $check_args ; then break fi @@ -54,7 +54,6 @@ while true; do exit 1 fi - i=$((i+1)); cp build/todo.txt todo/${i}.txt; cp build/todo_all.txt todo/${i}_all.txt; if ${MAKE} ${MAKEFLAGS} ITER=$i database; then @@ -65,6 +64,8 @@ while true; do if [ "$QUICK" = "Y" ] ; then break; fi + + i=$((i+1)); done; if $end_pushdb ; then ${MAKE} ${MAKEFLAGS} pushdb From ec317d566821f316333b936b4b29bace359cb3ea Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 18:33:39 -0800 Subject: [PATCH 15/16] intpips: quick N=1 since better segmatch filtering Signed-off-by: John McMaster --- fuzzers/050-intpips/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fuzzers/050-intpips/Makefile b/fuzzers/050-intpips/Makefile index 29767f12..e699487a 100644 --- a/fuzzers/050-intpips/Makefile +++ b/fuzzers/050-intpips/Makefile @@ -1,6 +1,5 @@ -# WARNING: N must be relatively high (say 10) or segmatch -m/M will fail ifeq ($(QUICK),Y) -N := 10 +N := 1 else # Do relatively large batch to keep parallelism high # LCM between 12 (CPUs on my system) and 16, a common CPU count From 5fbaf1f21ed7ba4325c44fd72d97601c74c453da Mon Sep 17 00:00:00 2001 From: John McMaster Date: Tue, 11 Dec 2018 17:55:38 -0800 Subject: [PATCH 16/16] intpips: increase segmake -m to reduce bad matches Signed-off-by: John McMaster --- fuzzers/050-intpips/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fuzzers/050-intpips/Makefile b/fuzzers/050-intpips/Makefile index e699487a..8ed5292a 100644 --- a/fuzzers/050-intpips/Makefile +++ b/fuzzers/050-intpips/Makefile @@ -15,9 +15,10 @@ SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) # Individual fuzzer directory, such as ~/prjxray/fuzzers/010-lutinit export FUZDIR=$(shell pwd) +# Specimens from current run must complete, but previous iterations may exist database: $(SPECIMENS_OK) - ${XRAY_SEGMATCH} -m 5 -M 15 -o build/segbits_int_l.db $(shell find build -name segdata_int_l.txt) - ${XRAY_SEGMATCH} -m 5 -M 15 -o build/segbits_int_r.db $(shell find build -name segdata_int_r.txt) + ${XRAY_SEGMATCH} -m 15 -M 45 -o build/segbits_int_l.db $(shell find build -name segdata_int_l.txt) + ${XRAY_SEGMATCH} -m 15 -M 45 -o build/segbits_int_r.db $(shell find build -name segdata_int_r.txt) ${XRAY_MASKMERGE} build/mask_clbll_l.db $(shell find build -name segdata_int_l.txt) ${XRAY_MASKMERGE} build/mask_clbll_r.db $(shell find build -name segdata_int_r.txt) ${XRAY_MASKMERGE} build/mask_clblm_l.db $(shell find build -name segdata_int_l.txt)