Merge pull request #849 from antmicro/prjxray_stabilization_053_pip_ctrlin

053-pip-ctrlin: Fall back to todos bigger than specified number of lines
This commit is contained in:
litghost 2019-06-04 09:35:53 -07:00 committed by GitHub
commit 71970f9b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

View File

@ -21,8 +21,37 @@ route_design
# write_checkpoint -force design.dcp
# This function checks the input todo file to ensure there is enough stimulus.
# By default if the input todo file is bigger than the specified number of lines then
# it is used in the subsequent stages of the script.
# However, when the input todo is smaller then a todo file from a previous iteration,
# which meets the minimum lines requirement, gets chosen.
# This helps with increasing the stimuli without increasing the
# global number of specimen used in every iteration.
proc get_todo {{min_lines 0}} {
if {[info exists ::env(ITER)]} {
set current_iter $::env(ITER)
} else {
set current_iter 1
}
set todo_file "../../todo/${current_iter}_all.txt"
lassign [exec wc -l $todo_file] line_count file_name
if {$min_lines == 0} {
return $file_name
}
if {$current_iter == 1 && $line_count < $min_lines} {
error "ERROR: Initial TODO is too small"
}
while {$line_count < $min_lines} {
incr current_iter -1
set todo_file "../../todo/${current_iter}_all.txt"
lassign [exec wc -l $todo_file] line_count file_name
}
return $file_name
}
set fp [open "../../todo.txt" r]
set fp [open [get_todo 10] r]
set todo_lines {}
for {gets $fp line} {$line != ""} {gets $fp line} {
lappend todo_lines [split $line .]

View File

@ -22,6 +22,7 @@ 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)
export ITER
all: database