mirror of https://github.com/openXC7/prjxray.git
clb.mk and fuzzer.mk: rerun the fuzzer in case of failure
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
parent
8b66865106
commit
13e5fbdf99
|
|
@ -4,6 +4,14 @@ CLB_DBFIXUP ?=
|
||||||
# ie set to N if only for SLICEM
|
# ie set to N if only for SLICEM
|
||||||
SLICEL ?= Y
|
SLICEL ?= Y
|
||||||
|
|
||||||
|
# This set of variables are used to store the increment
|
||||||
|
# in the number of CLBs in case they are not enough and
|
||||||
|
# the generated database is inconsistent
|
||||||
|
CLBN ?= 0
|
||||||
|
INC ?= 50
|
||||||
|
VAR ?= "CLBN=$$(($(CLBN) + $(INC)))"
|
||||||
|
ENV_VAR ?= "CLBN=$(CLBN)"
|
||||||
|
|
||||||
include ../fuzzer.mk
|
include ../fuzzer.mk
|
||||||
|
|
||||||
database: build/segbits_clbx.db
|
database: build/segbits_clbx.db
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,27 @@
|
||||||
N ?= 1
|
N ?= 1
|
||||||
SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N)))
|
SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N)))
|
||||||
SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS))
|
SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS))
|
||||||
|
ENV_VAR ?=
|
||||||
|
VAR ?=
|
||||||
|
ITER ?= 0
|
||||||
|
MAX_ITER ?= 10
|
||||||
|
|
||||||
all: database
|
all: database
|
||||||
|
|
||||||
$(SPECIMENS_OK):
|
$(SPECIMENS_OK):
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
bash ${XRAY_DIR}/utils/top_generate.sh $(subst /OK,,$@)
|
if [ -f `pwd`/generate.sh ]; then export $(ENV_VAR); bash `pwd`/generate.sh $(subst /OK,,$@); else bash ${XRAY_DIR}/utils/top_generate.sh $(subst /OK,,$@); fi
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
# If the database presents errors or is incomplete, the fuzzer is rerun.
|
||||||
|
# When it reaches the maximum number of iterations it fails.
|
||||||
|
@if [ $(ITER) -gt $(MAX_ITER) ]; then \
|
||||||
|
echo "Max Iterations reached. Fuzzer unsolvable."; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
$(MAKE) database
|
$(MAKE) database
|
||||||
$(MAKE) pushdb
|
$(MAKE) pushdb || $(MAKE) $(VAR) ITER=$$(($(ITER) + 1)) run
|
||||||
touch run.ok
|
touch run.ok
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue