Merge pull request #612 from litghost/refactor_int_fuzzers

Refactor INT fuzzers.
This commit is contained in:
litghost 2019-02-05 09:53:03 -08:00 committed by GitHub
commit f7c6f76bb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 51 additions and 190 deletions

View File

@ -16,6 +16,10 @@ print("Loading tags from design.txt.")
with open("design.txt", "r") as f:
for line in f:
tile, pip, src, dst, pnum, pdir = line.split()
if not tile.startswith('INT_'):
continue
_, pip = pip.split(".")
_, src = src.split("/")
_, dst = dst.split("/")

View File

@ -34,29 +34,5 @@ route_design
write_checkpoint -force design.dcp
proc write_txtdata {filename} {
puts "FUZ([pwd]): Writing $filename."
set fp [open $filename w]
set all_pips [lsort -unique [get_pips -of_objects [get_nets -hierarchical]]]
# 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
if {($tilei % 10) == 0 } {
puts "FUZ([pwd]): 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]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
close $fp
}
write_bitstream -force design.bit
write_txtdata design.txt
write_pip_txtdata design.txt

View File

@ -1,9 +0,0 @@
#!/bin/bash
source ${XRAY_GENHEADER}
${XRAY_VIVADO} -mode batch -source ../generate.tcl
${XRAY_BITREAD} -F $XRAY_ROI_FRAMES -o design.bits -z -y design.bit
python3 ../generate.py

View File

@ -141,25 +141,6 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} {
}
}
proc write_txtdata {filename tiles} {
puts "Writing $filename."
set fp [open $filename w]
set all_pips [lsort -unique [get_pips -of_objects [get_nets -hierarchical]]]
if {$all_pips != {}} {
puts "Dumping pips."
foreach tile $tiles {
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]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
}
close $fp
}
route_design
write_checkpoint -force design.dcp
write_bitstream -force design.bit
@ -172,4 +153,4 @@ if {[info exists ::env(QUICK) ] && "$::env(QUICK)" == "Y"} {
set tiles [get_tiles [regsub -all {CLBL[LM]} [get_tiles -of_objects [get_sites -of_objects [get_pblocks roi]]] INT]]
}
write_txtdata design.txt $tiles
write_pip_txtdata design.txt

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import os, re
import re
from prjxray.segmaker import Segmaker
@ -14,6 +14,10 @@ print("Loading tags from design.txt.")
with open("design.txt", "r") as f:
for line in f:
tile, pip, src, dst, pnum, pdir = line.split()
if not tile.startswith('INT_'):
continue
_, pip = pip.split(".")
_, src = src.split("/")
_, dst = dst.split("/")

View File

@ -1,9 +0,0 @@
#!/bin/bash
source ${XRAY_GENHEADER}
${XRAY_VIVADO} -mode batch -source ../generate.tcl
${XRAY_BITREAD} -F $XRAY_ROI_FRAMES -o design.bits -z -y design.bit
python3 ../generate.py

View File

@ -96,26 +96,7 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} {
}
}
proc write_txtdata {filename} {
puts "Writing $filename."
set fp [open $filename w]
set all_pips [lsort -unique [get_pips -of_objects [get_nets -hierarchical]]]
if {$all_pips != {}} {
puts "Dumping pips."
foreach tile [get_tiles [regsub -all {CLBL[LM]} [get_tiles -of_objects [get_sites -of_objects [get_pblocks roi]]] INT]] {
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]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
}
close $fp
}
route_design
write_checkpoint -force design.dcp
write_bitstream -force design.bit
write_txtdata design.txt
write_pip_txtdata design.txt

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import os, re
import re
from prjxray.segmaker import Segmaker
@ -14,6 +14,10 @@ print("Loading tags from design.txt.")
with open("design.txt", "r") as f:
for line in f:
tile, pip, src, dst, pnum, pdir = line.split()
if not tile.startswith('INT_'):
continue
_, pip = pip.split(".")
_, src = src.split("/")
_, dst = dst.split("/")

View File

@ -1,9 +0,0 @@
#!/bin/bash
source ${XRAY_GENHEADER}
${XRAY_VIVADO} -mode batch -source ../generate.tcl
${XRAY_BITREAD} -F $XRAY_ROI_FRAMES -o design.bits -z -y design.bit
python3 ../generate.py

View File

@ -61,26 +61,7 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} {
route_via $mynet "$tile/$src_wire $tile/$dst_wire"
}
proc write_txtdata {filename} {
puts "Writing $filename."
set fp [open $filename w]
set all_pips [lsort -unique [get_pips -of_objects [get_nets -hierarchical]]]
if {$all_pips != {}} {
puts "Dumping pips."
foreach tile [get_tiles [regsub -all {CLBL[LM]} [get_tiles -of_objects [get_sites -of_objects [get_pblocks roi]]] INT]] {
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]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
}
close $fp
}
route_design
write_checkpoint -force design.dcp
write_bitstream -force design.bit
write_txtdata design.txt
write_pip_txtdata design.txt

View File

@ -16,6 +16,10 @@ print("Loading tags from design.txt.")
with open("design.txt", "r") as f:
for line in f:
tile, pip, src, dst, pnum, pdir = line.split()
if not tile.startswith('INT_'):
continue
_, pip = pip.split(".")
_, src = src.split("/")
_, dst = dst.split("/")

View File

@ -62,26 +62,7 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} {
route_via $mynet "$tile/$src_wire $tile/$dst_wire"
}
proc write_txtdata {filename} {
puts "Writing $filename."
set fp [open $filename w]
set all_pips [lsort -unique [get_pips -of_objects [get_nets -hierarchical]]]
if {$all_pips != {}} {
puts "Dumping pips."
foreach tile [get_tiles [regsub -all {CLBL[LM]} [get_tiles -of_objects [get_sites -of_objects [get_pblocks roi]]] INT]] {
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]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
}
close $fp
}
route_design
write_checkpoint -force design.dcp
write_bitstream -force design.bit
write_txtdata design.txt
write_pip_txtdata design.txt

View File

@ -1,10 +0,0 @@
#!/bin/bash
FUZDIR=$PWD
source ${XRAY_GENHEADER}
${XRAY_VIVADO} -mode batch -source $FUZDIR/generate.tcl
${XRAY_BITREAD} -F $XRAY_ROI_FRAMES -o design.bits -z -y design.bit
python3 $FUZDIR/generate.py

View File

@ -105,25 +105,6 @@ proc route_todo {} {
}
}
proc write_txtdata {filename} {
puts "Writing $filename."
set fp [open $filename w]
set all_pips [lsort -unique [get_pips -of_objects [get_nets -hierarchical]]]
if {$all_pips != {}} {
puts "Dumping pips."
foreach tile [get_tiles [regsub -all {CLBL[LM]} [get_tiles -of_objects [get_sites -of_objects [get_pblocks roi]]] INT]] {
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]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
}
close $fp
}
proc run {} {
build_basic
route_todo
@ -131,7 +112,7 @@ proc run {} {
write_checkpoint -force design.dcp
write_bitstream -force design.bit
write_txtdata design.txt
write_pip_txtdata design.txt
}
run

View File

@ -1,5 +1,4 @@
MAKETODO_FLAGS=--re ".*"
TODO_N=5
export FUZDIR=$(shell pwd)
PIPLIST_TCL=$(FUZDIR)/bipiplist.tcl
PIP_TYPE?=bipips_int

View File

@ -1,11 +0,0 @@
#!/bin/bash
source ${XRAY_GENHEADER}
while ! ${XRAY_VIVADO} -mode batch -source ../generate.tcl; do
rm -rf design*
done
${XRAY_BITREAD} -F $XRAY_ROI_FRAMES -o design.bits -z -y design.bit
python3 ../generate.py

View File

@ -1,14 +0,0 @@
#!/bin/bash
set -ex
FUZDIR=$PWD
source ${XRAY_GENHEADER}
echo '`define SEED 32'"'h$(echo $1 | md5sum | cut -c1-8)" > setseed.vh
${XRAY_VIVADO} -mode batch -source $FUZDIR/generate.tcl | tee vivado_stdout.log | grep "FUZ[^:]\+:"
${XRAY_BITREAD} -F $XRAY_ROI_FRAMES -o design.bits -z -y design.bit
python3 $FUZDIR/generate.py

View File

@ -41,6 +41,10 @@ print("Loading tags from %s." % args.design)
with open(args.design, "r") as f:
for line in f:
tile, pip, src, dst, pnum, pdir = line.split()
if not tile.startswith('INT_'):
continue
_, pip = pip.split(".")
_, src = src.split("/")
_, dst = dst.split("/")

View File

@ -108,3 +108,26 @@ proc lintersect {lst1 lst2} {
proc putl {lst} {
foreach line $lst {puts $line}
}
proc write_pip_txtdata {filename} {
puts "FUZ([pwd]): Writing $filename."
set fp [open $filename w]
set nets [get_nets -hierarchical]
set nnets [llength $nets]
set neti 0
foreach net $nets {
incr neti
if {($neti % 100) == 0 } {
puts "FUZ([pwd]): Dumping pips from net $net ($neti / $nnets)"
}
foreach pip [get_pips -of_objects $net] {
set tile [get_tiles -of_objects $pip]
set src_wire [get_wires -uphill -of_objects $pip]
set dst_wire [get_wires -downhill -of_objects $pip]
set num_pips [llength [get_nodes -uphill -of_objects [get_nodes -of_objects $dst_wire]]]
set dir_prop [get_property IS_DIRECTIONAL $pip]
puts $fp "$tile $pip $src_wire $dst_wire $num_pips $dir_prop"
}
}
close $fp
}