mirror of https://github.com/openXC7/prjxray.git
bipips: use int_loop
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
parent
24039e1922
commit
e183464f38
|
|
@ -1,14 +1,3 @@
|
|||
/filtered_seg_int_l.segbits
|
||||
/filtered_seg_int_r.segbits
|
||||
/pattern_l.txt
|
||||
/pattern_r.txt
|
||||
/bipiplist.dcp
|
||||
/bipiplist/
|
||||
/bipips_int_l.txt
|
||||
/bipips_int_r.txt
|
||||
/seg_int_l.segbits
|
||||
/seg_int_r.segbits
|
||||
/specimen_[0-9][0-9][0-9]/
|
||||
/todo.txt
|
||||
/vivado*
|
||||
/run.ok
|
||||
build
|
||||
run.ok
|
||||
todo
|
||||
|
|
|
|||
|
|
@ -1,33 +1,7 @@
|
|||
|
||||
N := 10
|
||||
SPECIMENS := $(addprefix specimen_,$(shell seq -f '%03.0f' $(N)))
|
||||
SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS))
|
||||
|
||||
database: $(SPECIMENS_OK)
|
||||
${XRAY_SEGMATCH} -m 5 -M 15 -o segbits_int_l.db $(addsuffix /segdata_int_l.txt,$(SPECIMENS))
|
||||
${XRAY_SEGMATCH} -m 5 -M 15 -o segbits_int_r.db $(addsuffix /segdata_int_r.txt,$(SPECIMENS))
|
||||
|
||||
pushdb:
|
||||
${XRAY_DBFIXUP} --db-root . --clb-int
|
||||
${XRAY_MERGEDB} int_l segbits_int_l.db
|
||||
${XRAY_MERGEDB} int_r segbits_int_r.db
|
||||
|
||||
$(SPECIMENS_OK): todo.txt
|
||||
bash generate.sh $(subst /OK,,$@)
|
||||
touch $@
|
||||
|
||||
todo.txt:
|
||||
vivado -mode batch -source bipiplist.tcl
|
||||
python3 maketodo.py | sort -R | head -n5 > todo.txt
|
||||
|
||||
run:
|
||||
+set -ex; while make clean; make todo.txt; test -s todo.txt; do make database; make pushdb; done; true
|
||||
touch run.ok
|
||||
|
||||
clean:
|
||||
rm -rf .Xil/ .cache/ vivado* todo.txt run.ok
|
||||
rm -rf bipiplist/ bipiplist.dcp bipips_int_[lr].txt
|
||||
rm -rf specimen_[0-9][0-9][0-9]/ segbits_int_[lr].db
|
||||
|
||||
.PHONY: database pushdb run clean
|
||||
MAKETODO_FLAGS=--re ".*"
|
||||
TODO_N=5
|
||||
export FUZDIR=$(shell pwd)
|
||||
PIPLIST_TCL=$(FUZDIR)/bipiplist.tcl
|
||||
PIP_TYPE?=bipips_int
|
||||
include ../int_loop.mk
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
create_project -force -part $::env(XRAY_PART) bipiplist bipiplist
|
||||
|
||||
read_verilog 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]
|
||||
|
|
@ -18,7 +18,7 @@ route_design
|
|||
|
||||
write_checkpoint -force bipiplist.dcp
|
||||
|
||||
source ../../utils/utils.tcl
|
||||
source "$::env(XRAY_DIR)/utils/utils.tcl"
|
||||
|
||||
proc print_tile_pips {tile_type filename} {
|
||||
set tile [lindex [get_tiles -filter "TYPE == $tile_type"] 0]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
create_project -force -part $::env(XRAY_PART) design design
|
||||
|
||||
read_verilog ../top.v
|
||||
read_verilog $::env(FUZDIR)/top.v
|
||||
synth_design -top top
|
||||
|
||||
set_property -dict "PACKAGE_PIN $::env(XRAY_PIN_00) IOSTANDARD LVCMOS33" [get_ports i]
|
||||
|
|
@ -19,9 +19,9 @@ route_design
|
|||
|
||||
# write_checkpoint -force design.dcp
|
||||
|
||||
source ../../../utils/utils.tcl
|
||||
source "$::env(XRAY_DIR)/utils/utils.tcl"
|
||||
|
||||
set fp [open "../todo.txt" r]
|
||||
set fp [open "../../todo.txt" r]
|
||||
set todo_lines {}
|
||||
for {gets $fp line} {$line != ""} {gets $fp line} {
|
||||
lappend todo_lines [split $line .]
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os, re
|
||||
|
||||
|
||||
def maketodo(pipfile, dbfile):
|
||||
todos = set()
|
||||
with open(pipfile, "r") as f:
|
||||
for line in f:
|
||||
line = line.split()
|
||||
todos.add(line[0])
|
||||
with open(dbfile, "r") as f:
|
||||
for line in f:
|
||||
line = line.split()
|
||||
if line[0] in todos:
|
||||
todos.remove(line[0])
|
||||
for line in todos:
|
||||
print(line)
|
||||
|
||||
|
||||
maketodo(
|
||||
"bipips_int_l.txt", "%s/%s/segbits_int_l.db" %
|
||||
(os.getenv("XRAY_DATABASE_DIR"), os.getenv("XRAY_DATABASE")))
|
||||
maketodo(
|
||||
"bipips_int_r.txt", "%s/%s/segbits_int_r.db" %
|
||||
(os.getenv("XRAY_DATABASE_DIR"), os.getenv("XRAY_DATABASE")))
|
||||
|
|
@ -11,6 +11,9 @@ endif
|
|||
# Driven by int_loop.sh
|
||||
ITER ?= 1
|
||||
MAKETODO_RE ?=
|
||||
TODO_N ?= 10
|
||||
PIP_TYPE?=pips_int
|
||||
PIPLIST_TCL?=$(XRAY_DIR)/fuzzers/piplist.tcl
|
||||
|
||||
# See int_loop_check.py
|
||||
# rempips took 35 iters once, so set 50 as a good start point
|
||||
|
|
@ -38,14 +41,14 @@ $(SPECIMENS_OK): build/todo.txt
|
|||
bash ${XRAY_DIR}/utils/top_generate.sh $(subst /OK,,$@)
|
||||
touch $@
|
||||
|
||||
build/pips_int_l.txt: $(XRAY_DIR)/fuzzers/piplist.tcl
|
||||
build/$(PIP_TYPE)_l.txt: $(XRAY_DIR)/fuzzers/piplist.tcl
|
||||
mkdir -p build/$(ITER)
|
||||
cd build && vivado -mode batch -source $(XRAY_DIR)/fuzzers/piplist.tcl
|
||||
cd build && vivado -mode batch -source $(PIPLIST_TCL)
|
||||
|
||||
# Used 1) to see if we are done 2) pips to try in generate.tcl
|
||||
build/todo.txt: build/pips_int_l.txt $(XRAY_DIR)/fuzzers/int_maketodo.py
|
||||
python3 $(XRAY_DIR)/fuzzers/int_maketodo.py $(MAKETODO_FLAGS) >build/todo_all.txt
|
||||
cat build/todo_all.txt | sort -R | head -n10 > build/todo.txt.tmp
|
||||
build/todo.txt: build/$(PIP_TYPE)_l.txt $(XRAY_DIR)/fuzzers/int_maketodo.py
|
||||
python3 $(XRAY_DIR)/fuzzers/int_maketodo.py --pip-type $(PIP_TYPE) $(MAKETODO_FLAGS) >build/todo_all.txt
|
||||
cat build/todo_all.txt | sort -R | head -n$(TODO_N) > build/todo.txt.tmp
|
||||
mv build/todo.txt.tmp build/todo.txt
|
||||
|
||||
# XXX: conider moving to script
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ def maketodo(pipfile, dbfile, intre, not_endswith=None, verbose=False):
|
|||
with open(dbfile, "r") as f:
|
||||
for line in f:
|
||||
line = line.split()
|
||||
todos.remove(line[0])
|
||||
# bipips works on a subset
|
||||
if line[0] in todos:
|
||||
todos.remove(line[0])
|
||||
verbose and print(
|
||||
'Remove %s: %u entries' % (dbfile, len(todos)), file=sys.stderr)
|
||||
drops = 0
|
||||
|
|
@ -33,20 +35,20 @@ def maketodo(pipfile, dbfile, intre, not_endswith=None, verbose=False):
|
|||
'Print %u entries w/ %u drops' % (lines, drops), file=sys.stderr)
|
||||
|
||||
|
||||
def run(build_dir, db_dir, intre, not_endswith=None, verbose=False):
|
||||
def run(build_dir, db_dir, intre, pip_type, not_endswith=None, verbose=False):
|
||||
if db_dir is None:
|
||||
db_dir = "%s/%s" % (
|
||||
os.getenv("XRAY_DATABASE_DIR"), os.getenv("XRAY_DATABASE"))
|
||||
|
||||
assert intre, "RE is required"
|
||||
maketodo(
|
||||
"%s/pips_int_l.txt" % build_dir,
|
||||
"%s/%s_l.txt" % (build_dir, pip_type),
|
||||
"%s/segbits_int_l.db" % db_dir,
|
||||
intre,
|
||||
not_endswith,
|
||||
verbose=verbose)
|
||||
maketodo(
|
||||
"%s/pips_int_r.txt" % build_dir,
|
||||
"%s/%s_r.txt" % (build_dir, pip_type),
|
||||
"%s/segbits_int_r.db" % db_dir,
|
||||
intre,
|
||||
not_endswith,
|
||||
|
|
@ -62,6 +64,7 @@ def main():
|
|||
parser.add_argument('--build-dir', default="build", help='')
|
||||
parser.add_argument('--db-dir', default=None, help='')
|
||||
parser.add_argument('--re', required=True, help='')
|
||||
parser.add_argument('--pip-type', default="pips_int", help='')
|
||||
parser.add_argument(
|
||||
'--not-endswith', help='Drop lines if they end with this')
|
||||
args = parser.parse_args()
|
||||
|
|
@ -70,6 +73,7 @@ def main():
|
|||
build_dir=args.build_dir,
|
||||
db_dir=args.db_dir,
|
||||
intre=args.re,
|
||||
pip_type=args.pip_type,
|
||||
not_endswith=args.not_endswith)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue