mirror of https://github.com/openXC7/prjxray.git
Merge pull request #543 from antmicro/01x-clb-improvement
01x CLB rerun if pushdb fails
This commit is contained in:
commit
2f1790e637
|
|
@ -1,11 +1,14 @@
|
|||
import random
|
||||
import os, random
|
||||
random.seed(0)
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
from prims import *
|
||||
|
||||
CLBN = 600
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 600 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
f = open("top.txt", "w")
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import random
|
||||
import os, random
|
||||
random.seed(0)
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
CLBN = 40
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 40 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import random
|
||||
import os, random
|
||||
random.seed(0)
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
CLBN = 400
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 400 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
|
|
@ -107,7 +110,7 @@ module clb_NCY0_O5 (input clk, input [7:0] din, output [7:0] dout);
|
|||
always @(*) begin
|
||||
s = din[7:4];
|
||||
s[N] = o6;
|
||||
|
||||
|
||||
di = {din[3:0]};
|
||||
di[N] = o5;
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@ import re
|
|||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
CLBN = 600
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 600 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import random
|
||||
import os, random
|
||||
random.seed(0)
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
CLBN = 400
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 400 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import random
|
||||
import os, random
|
||||
random.seed(0)
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
CLBN = 400
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 400 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@ import re
|
|||
from prjxray import verilog
|
||||
from prjxray import util
|
||||
|
||||
CLBN = 400
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 400 + int(INCREMENT)
|
||||
SLICEX, SLICEY = util.site_xy_minmax([
|
||||
'SLICEL',
|
||||
'SLICEM',
|
||||
|
|
|
|||
|
|
@ -15,12 +15,15 @@ SRLC32E_N
|
|||
Note: LUT6 was added to try to simplify reduction, although it might not be needed
|
||||
'''
|
||||
|
||||
import random
|
||||
import os, random
|
||||
random.seed(0)
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
CLBN = 50
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 50 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import random
|
||||
import os, random
|
||||
random.seed(0)
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
|
||||
CLBN = 50
|
||||
# INCREMENT is the amount of additional CLBN to be instantiated in the design.
|
||||
# This makes the fuzzer compilation more robust against failures.
|
||||
INCREMENT = os.getenv('CLBN', 0)
|
||||
CLBN = 50 + int(INCREMENT)
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,17 @@ CLB_DBFIXUP ?=
|
|||
# ie set to N if only for SLICEM
|
||||
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)"
|
||||
ITER ?= 0
|
||||
MAX_ITER ?= 10
|
||||
FUZDIR = ${PWD}
|
||||
|
||||
include ../fuzzer.mk
|
||||
|
||||
database: build/segbits_clbx.db
|
||||
|
|
@ -26,7 +37,19 @@ else
|
|||
endif
|
||||
${XRAY_MASKMERGE} build/mask_clbx.db $(SEGDATAS)
|
||||
|
||||
pushdb:
|
||||
checkdb:
|
||||
# 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) parsedb || $(MAKE) $(VAR) ITER=$$(($(ITER) + 1)) run
|
||||
|
||||
parsedb:
|
||||
${XRAY_PARSEDB} --strict build/segbits_clbx.db
|
||||
|
||||
pushdb: checkdb
|
||||
ifeq ($(SLICEL),Y)
|
||||
${XRAY_MERGEDB} clbll_l build/segbits_clbx.db
|
||||
${XRAY_MERGEDB} clbll_r build/segbits_clbx.db
|
||||
|
|
@ -38,5 +61,5 @@ endif
|
|||
${XRAY_MERGEDB} mask_clblm_l build/mask_clbx.db
|
||||
${XRAY_MERGEDB} mask_clblm_r build/mask_clbx.db
|
||||
|
||||
.PHONY: database pushdb
|
||||
.PHONY: database pushdb checkdb parsedb
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
N ?= 1
|
||||
SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N)))
|
||||
SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS))
|
||||
ENV_VAR ?=
|
||||
FUZDIR ?= ${PWD}
|
||||
|
||||
all: database
|
||||
|
||||
$(SPECIMENS_OK):
|
||||
echo ${ENV_VAR}
|
||||
mkdir -p build
|
||||
bash ${XRAY_DIR}/utils/top_generate.sh $(subst /OK,,$@)
|
||||
if [ -f $(FUZDIR)/generate.sh ]; then export $(ENV_VAR); bash $(FUZDIR)/generate.sh $(subst /OK,,$@); else bash ${XRAY_DIR}/utils/top_generate.sh $(subst /OK,,$@); fi
|
||||
|
||||
run:
|
||||
$(MAKE) clean
|
||||
|
|
|
|||
Loading…
Reference in New Issue