From c20d1d46e5720ef70475ff61f70b2443aa0c2ab3 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Fri, 24 Jan 2020 16:35:43 +0100 Subject: [PATCH 01/41] re-enable artix 200T extra-part generation Signed-off-by: Alessandro Comodi --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0bc81806..96948608 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,7 @@ $(foreach DB,$(DATABASES),$(eval $(call database,$(DB)))) # Targets related to Project X-Ray parts # -------------------------------------- -ARTIX_PARTS= +ARTIX_PARTS=artix200t ZYNQ_PARTS=zynq7010 KINTEX_PARTS=kintex70t From 194cc230f1c569afa4cdf2a131f79f0b928e9624 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Tue, 28 Jan 2020 14:46:43 +0100 Subject: [PATCH 02/41] fix possible concurrency issue Signed-off-by: Alessandro Comodi --- fuzzers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/Makefile b/fuzzers/Makefile index cedde639..08e61154 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -147,7 +147,7 @@ ${XRAY_FAMILY_DIR}/${XRAY_PART}/tileconn.json: $(MAKE) -C 073-get_counts run $(MAKE) -C 074-dump_all run -part_only_yaml: $(addprefix ${XRAY_FAMILY_DIR}/${XRAY_PART}/part.,yaml json) +part_only_yaml: ${XRAY_FAMILY_DIR}/${XRAY_PART}/part.yaml part_only_tilegrid: ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json part_only_tileconn: ${XRAY_FAMILY_DIR}/${XRAY_PART}/tileconn.json part_only_pins: ${XRAY_FAMILY_DIR}/${XRAY_PART}/package_pins.csv From ce35c7c37cd17ccf0777932b0d88cd4c91f38b12 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Tue, 4 Feb 2020 14:49:04 +0100 Subject: [PATCH 03/41] 074-dump_all: annotate only speed model index Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/jobtiles.tcl | 85 +++-------------------- fuzzers/074-dump_all/reduce_tile_types.py | 65 ++++++++++------- 2 files changed, 47 insertions(+), 103 deletions(-) diff --git a/fuzzers/074-dump_all/jobtiles.tcl b/fuzzers/074-dump_all/jobtiles.tcl index d4468a2e..d854f979 100644 --- a/fuzzers/074-dump_all/jobtiles.tcl +++ b/fuzzers/074-dump_all/jobtiles.tcl @@ -27,26 +27,6 @@ set not_allowed_tiles [get_tiles -of_objects $not_allowed_sites] set MAGIC 0.6875 set speed_model_index_map [dict create] -set speed_model_name_map [dict create] - -proc lookup_speed_model_index {index} { - upvar speed_model_index_map speed_model_index_map - if { ![dict exists $speed_model_index_map $index] } { - set model [get_speed_models -filter "SPEED_INDEX == $index"] - dict set speed_model_index_map $index $model - } - return [dict get $speed_model_index_map $index] -} - -proc lookup_speed_model_name {name} { - upvar speed_model_name_map speed_model_name_map - if { ![dict exists $speed_model_name_map $name] } { - set model [get_speed_models -filter "NAME == $name"] - dict set speed_model_name_map $name $model - } - - return [dict get $speed_model_name_map $name] -} # For BSW_INT_LONG_MUX, use the model from BSW_INT_HLONG_MUX. # This isn't exactly correct, but it is a better model to use. @@ -112,22 +92,11 @@ for {set j $start } { $j < $stop } { incr j } { # SPEED_INDEX puts $fp "\t\t\t\{" puts $fp "\t\t\t\t\"site_pin\":\"$site_pin\"," - set site_pin_speed_model [lookup_speed_model_index [get_property SPEED_INDEX $site_pin]] + + set site_pin_speed_model_index [get_property SPEED_INDEX $site_pin] + puts $fp "\t\t\t\t\"speed_model_index\":\"$site_pin_speed_model_index\"," + set dir [get_property DIRECTION $site_pin] - - if { $dir == "IN" } { - puts $fp "\t\t\t\t\"cap\": \"[get_property CAP $site_pin_speed_model]\"," - } else { - set site_pin_speed_model [lookup_speed_model_name [get_property DRIVER $site_pin_speed_model]] - puts $fp "\t\t\t\t\"res\": \"[expr $MAGIC * [get_property DRIVE $site_pin_speed_model]]\"," - } - - puts $fp "\t\t\t\t\"delay\": \[" - puts $fp "\t\t\t\t\t\"[get_property FAST_MIN $site_pin_speed_model]\"," - puts $fp "\t\t\t\t\t\"[get_property FAST_MAX $site_pin_speed_model]\"," - puts $fp "\t\t\t\t\t\"[get_property SLOW_MIN $site_pin_speed_model]\"," - puts $fp "\t\t\t\t\t\"[get_property SLOW_MAX $site_pin_speed_model]\"," - puts $fp "\t\t\t\t\]," puts $fp "\t\t\t\t\"direction\":\"$dir\"," set site_pin_node [get_nodes -of_objects $site_pin] if {[llength $site_pin_node] == 0} { @@ -169,45 +138,9 @@ for {set j $start } { $j < $stop } { incr j } { # IS_TEST_PIP NAME SPEED_INDEX TILE puts $fp "\t\t\{" puts $fp "\t\t\t\"pip\":\"$pip\"," - set pip_speed_model [lookup_speed_model_index [get_property SPEED_INDEX $pip]] - set forward_speed_model [lookup_speed_model_name [get_property FORWARD $pip_speed_model]] - set reverse_speed_model [lookup_speed_model_name [get_property REVERSE $pip_speed_model]] - set forward_speed_model_type [get_property TYPE $forward_speed_model] - set reverse_speed_model_type [get_property TYPE $reverse_speed_model] - set is_pass_transistor [expr {"$forward_speed_model_type" == "pass_transistor"}] - puts $fp "\t\t\t\"is_pass_transistor\":$is_pass_transistor," - - if { !$is_pass_transistor } { - puts $fp "\t\t\t\"forward_delay\":\[" - puts $fp "\t\t\t\t\"[get_property FAST_MIN $forward_speed_model]\"," - puts $fp "\t\t\t\t\"[get_property FAST_MAX $forward_speed_model]\"," - puts $fp "\t\t\t\t\"[get_property SLOW_MIN $forward_speed_model]\"," - puts $fp "\t\t\t\t\"[get_property SLOW_MAX $forward_speed_model]\"," - puts $fp "\t\t\t\]," - if {$forward_speed_model_type == "buffer_switch" || $forward_speed_model_type == "buffer"} { - puts $fp "\t\t\t\"forward_res\": \"[expr $MAGIC * [get_property DRIVE $forward_speed_model]]\"," - } - if {$forward_speed_model_type == "buffer_switch"} { - puts $fp "\t\t\t\"forward_in_cap\": \"[get_property IN_CAP $forward_speed_model]\"," - } - - puts $fp "\t\t\t\"reverse_delay\":\[" - puts $fp "\t\t\t\t\"[get_property FAST_MIN $reverse_speed_model]\"," - puts $fp "\t\t\t\t\"[get_property FAST_MAX $reverse_speed_model]\"," - puts $fp "\t\t\t\t\"[get_property SLOW_MIN $reverse_speed_model]\"," - puts $fp "\t\t\t\t\"[get_property SLOW_MAX $reverse_speed_model]\"," - puts $fp "\t\t\t\]," - if {$reverse_speed_model_type == "buffer_switch" || $reverse_speed_model_type == "buffer"} { - puts $fp "\t\t\t\"reverse_res\": \"[expr $MAGIC * [get_property DRIVE $reverse_speed_model]]\"," - } - if {$reverse_speed_model_type == "buffer_switch"} { - puts $fp "\t\t\t\"reverse_in_cap\": \"[get_property IN_CAP $reverse_speed_model]\"," - } - } else { - puts $fp "\t\t\t\"forward_res\": \"[get_property RES $forward_speed_model]\"," - puts $fp "\t\t\t\"reverse_res\": \"[get_property RES $reverse_speed_model]\"," - } + set pip_speed_model_index [get_property SPEED_INDEX $pip] + puts $fp "\t\t\t\"speed_model_index\":\"$pip_speed_model_index\"," puts $fp "\t\t\t\"src_wire\":\"[get_wires -uphill -of_objects $pip]\"," puts $fp "\t\t\t\"dst_wire\":\"[get_wires -downhill -of_objects $pip]\"," puts $fp "\t\t\t\"is_pseudo\":\"[get_property IS_PSEUDO $pip]\"," @@ -224,10 +157,10 @@ for {set j $start } { $j < $stop } { incr j } { # IS_PART_OF_BUS NAME NUM_DOWNHILL_PIPS NUM_INTERSECTS NUM_PIPS # NUM_TILE_PORTS NUM_UPHILL_PIPS SPEED_INDEX TILE_NAME TILE_PATTERN_OFFSET puts $fp "\t\t\{" - set wire_speed_model [lookup_speed_model_index [get_property SPEED_INDEX $wire]] puts $fp "\t\t\t\"wire\":\"$wire\"," - puts $fp "\t\t\t\"res\":\"[get_property WIRE_RES $wire_speed_model]\"," - puts $fp "\t\t\t\"cap\":\"[get_property WIRE_CAP $wire_speed_model]\"," + + set wire_speed_model_index [get_property SPEED_INDEX $wire] + puts $fp "\t\t\t\t\"speed_model_index\":\"$wire_speed_model_index\"," puts $fp "\t\t\}," } puts $fp "\t\]," diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index f8aaec4d..dc643356 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -41,15 +41,9 @@ def flatten_site_pins(tile, site, site_pins, site_pin_node_to_wires): pin_info = { 'wire': wires[0], - 'delay': site_pin['delay'], + 'speed_model_index': site_pin['speed_model_index'], } - if 'cap' in site_pin: - pin_info['cap'] = site_pin['cap'] - - if 'res' in site_pin: - pin_info['res'] = site_pin['res'] - yield ( check_and_strip_prefix(site_pin['site_pin'], site + '/'), pin_info) @@ -114,18 +108,8 @@ def get_pips(tile, pips): pip['is_directional'], 'can_invert': pip['can_invert'], - 'is_pass_transistor': - pip['is_pass_transistor'], - 'src_to_dst': { - 'delay': pip.get('forward_delay', None), - 'in_cap': pip.get('forward_in_cap', None), - 'res': pip.get('forward_res', None), - }, - 'dst_to_src': { - 'delay': pip.get('reverse_delay', None), - 'in_cap': pip.get('reverse_in_cap', None), - 'res': pip.get('reverse_res', None), - }, + 'speed_model_index': + pip['speed_model_index'], } return proto_pips @@ -231,15 +215,9 @@ def read_json5(fname, database_file): for wire in tile['wires']: assert wire['wire'].startswith(tile['tile'] + '/') - if wire['res'] != '0.000' or wire['cap'] != '0.000': - wire_delay_model = { - 'res': wire['res'], - 'cap': wire['cap'], - } - else: - wire_delay_model = None + wire_speed_model_index = wire['speed_model_index'] - yield wire['wire'][len(tile['tile']) + 1:], wire_delay_model + yield wire['wire'][len(tile['tile']) + 1:], wire_speed_model_index wires = {k: v for (k, v) in inner()} wires_from_nodes = set(node_lookup.wires_for_tile(tile['tile'])) @@ -257,6 +235,36 @@ def compare_and_update_wires(wires, new_wires): assert wires[wire] == new_wires[wire] +def get_speed_model_indices(reduced_tile): + """ Extracts the speed model indices for the data structure """ + + speed_model_indices = set() + + for site in reduced_tile['sites']: + for site_pin in site['site_pins'].keys(): + speed_model_indices.add(site['site_pins'][site_pin]['speed_model_index']) + + for pip in reduced_tile['pips'].keys(): + speed_model_indices.add(reduced_tile['pips'][pip]['speed_model_index']) + + for wire in reduced_tile['wires'].keys(): + speed_model_indices.add(reduced_tile['wires'][wire]) + + return speed_model_indices + + +def annotate_speed_model(tile_type, reduced_tile, output_dir): + """ Updates the reduced tile with the correct speed information """ + + speed_model_indices = get_speed_model_indices(reduced_tile) + + tmp_indices_file = os.path.join(output_dir, '{}_speed_index.tmp'.format(tile_type)) + + with open(tmp_indices_file, "w") as f: + for index in speed_model_indices: + print(index, file=f) + + def reduce_tile(pool, site_types, tile_type, tile_instances, database_file): sites = None pips = None @@ -360,6 +368,9 @@ def main(): datetime.datetime.now(), tile_type)) reduced_tile = reduce_tile( pool, site_types, tile_type, tiles[tile_type], database_file) + + annotate_speed_model(tile_type, reduced_tile, args.output_dir) + for site_type in site_types: with open(os.path.join( args.output_dir, 'tile_type_{}_site_type_{}.json'.format( From a3b8e561943098199f32e04002bbf23d8f144cdc Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Tue, 4 Feb 2020 19:18:41 +0100 Subject: [PATCH 04/41] 074-dump_all: added creation of json speed model file for backannotation Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/get_speed_model.tcl | 130 ++++++++++++++++++++++ fuzzers/074-dump_all/reduce_tile_types.py | 20 +++- 2 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 fuzzers/074-dump_all/get_speed_model.tcl diff --git a/fuzzers/074-dump_all/get_speed_model.tcl b/fuzzers/074-dump_all/get_speed_model.tcl new file mode 100644 index 00000000..1c042784 --- /dev/null +++ b/fuzzers/074-dump_all/get_speed_model.tcl @@ -0,0 +1,130 @@ +set filename [lindex $argv 0] + +create_project -force -part $::env(XRAY_PART) -name $filename +set_property design_mode PinPlanning [current_fileset] +open_io_design -name io_1 + +set_param messaging.disableStorage 1 +set fp [open $filename r] +set file_data [read $fp] +close $fp + +set fp [open $filename w] + +set indices [split $file_data "\n"] + +set MAGIC 0.6875 + +proc get_speed_model_name {name} { + return [get_speed_models -filter "NAME == $name"] +} + +puts $fp "\{" + + +foreach index $indices { + if {$index == ""} { + continue + } + + set split_index [split $index ","] + set resource [lindex $split_index 0] + set resource_index [lindex $split_index 1] + + puts $fp "\t\"$resource_index\":" + puts $fp "\t\t\{" + + if {$resource == "site_pin"} { + # Getting all site_pin information + set speed_model [get_speed_models -filter "SPEED_INDEX == $resource_index"] + + puts $fp "\t\t\t\"resource_name\": \"$resource\"," + + set driver_speed_model_name [get_property DRIVER $speed_model] + if {$driver_speed_model_name != ""} { + set driver_speed_model [get_speed_model_name [get_property DRIVER $speed_model]] + set RES [expr $MAGIC * [get_property DRIVE $driver_speed_model]] + + puts $fp "\t\t\t\"cap\":\"null\"," + puts $fp "\t\t\t\"res\":\"$RES\"," + + set FAST_MIN [get_property FAST_MIN $driver_speed_model] + set FAST_MAX [get_property FAST_MAX $driver_speed_model] + set SLOW_MIN [get_property SLOW_MIN $driver_speed_model] + set SLOW_MAX [get_property SLOW_MAX $driver_speed_model] + } else { + set CAP [get_property CAP $speed_model] + puts $fp "\t\t\t\"cap\":\"$CAP\"," + puts $fp "\t\t\t\"res\":\"null\"," + + set FAST_MIN [get_property FAST_MIN $speed_model] + set FAST_MAX [get_property FAST_MAX $speed_model] + set SLOW_MIN [get_property SLOW_MIN $speed_model] + set SLOW_MAX [get_property SLOW_MAX $speed_model] + + } + + puts $fp "\t\t\t\"fast_min\":\"$FAST_MIN\"," + puts $fp "\t\t\t\"fast_max\":\"$FAST_MAX\"," + puts $fp "\t\t\t\"slow_min\":\"$SLOW_MIN\"," + puts $fp "\t\t\t\"slow_max\":\"$SLOW_MAX\"" + } elseif {$resource == "pip"} { + # Getting all site_pin information + set speed_model [get_speed_models -filter "SPEED_INDEX == $resource_index"] + + puts $fp "\t\t\t\"resource_name\": \"$resource\"," + + set forward_speed_model [get_speed_model_name [get_property FORWARD $speed_model]] + set reverse_speed_model [get_speed_model_name [get_property REVERSE $speed_model]] + + set forward_speed_model_type [get_property TYPE $forward_speed_model] + set reverse_speed_model_type [get_property TYPE $reverse_speed_model] + set is_pass_transistor [expr {"$forward_speed_model_type" == "pass_transistor"}] + if { !$is_pass_transistor } { + puts $fp "\t\t\t\"forward_delay\":\[" + puts $fp "\t\t\t\t\"[get_property FAST_MIN $forward_speed_model]\"," + puts $fp "\t\t\t\t\"[get_property FAST_MAX $forward_speed_model]\"," + puts $fp "\t\t\t\t\"[get_property SLOW_MIN $forward_speed_model]\"," + puts $fp "\t\t\t\t\"[get_property SLOW_MAX $forward_speed_model]\"," + puts $fp "\t\t\t\]," + if {$forward_speed_model_type == "buffer_switch" || $forward_speed_model_type == "buffer"} { + puts $fp "\t\t\t\"forward_res\": \"[expr $MAGIC * [get_property DRIVE $forward_speed_model]]\"," + } + if {$forward_speed_model_type == "buffer_switch"} { + puts $fp "\t\t\t\"forward_in_cap\": \"[get_property IN_CAP $forward_speed_model]\"," + } + + puts $fp "\t\t\t\"reverse_delay\":\[" + puts $fp "\t\t\t\t\"[get_property FAST_MIN $reverse_speed_model]\"," + puts $fp "\t\t\t\t\"[get_property FAST_MAX $reverse_speed_model]\"," + puts $fp "\t\t\t\t\"[get_property SLOW_MIN $reverse_speed_model]\"," + puts $fp "\t\t\t\t\"[get_property SLOW_MAX $reverse_speed_model]\"," + puts $fp "\t\t\t\]," + if {$reverse_speed_model_type == "buffer_switch" || $reverse_speed_model_type == "buffer"} { + puts $fp "\t\t\t\"reverse_res\": \"[expr $MAGIC * [get_property DRIVE $reverse_speed_model]]\"," + } + if {$reverse_speed_model_type == "buffer_switch"} { + puts $fp "\t\t\t\"reverse_in_cap\": \"[get_property IN_CAP $reverse_speed_model]\"," + } + } else { + puts $fp "\t\t\t\"forward_res\": \"[get_property RES $forward_speed_model]\"," + puts $fp "\t\t\t\"reverse_res\": \"[get_property RES $reverse_speed_model]\"," + } + } elseif {$resource == "wire"} { + # Getting all wire information + set speed_model [get_speed_models -filter "SPEED_INDEX == $resource_index"] + + puts $fp "\t\t\t\"resource_name\": \"$resource\"," + puts $fp "\t\t\t\"res\":\"[get_property WIRE_RES $speed_model]\"," + puts $fp "\t\t\t\"cap\":\"[get_property WIRE_CAP $speed_model]\"," + } else { + puts "STUFF TO READ $index $resource" + exit 2 + } + + puts $fp "\t\t\}," +} + +puts $fp "\}" + +close $fp diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index dc643356..379879ba 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -11,6 +11,7 @@ import argparse import prjxray.lib import prjxray.node_lookup import datetime +import subprocess import os.path import pyjson5 as json5 import progressbar @@ -242,18 +243,18 @@ def get_speed_model_indices(reduced_tile): for site in reduced_tile['sites']: for site_pin in site['site_pins'].keys(): - speed_model_indices.add(site['site_pins'][site_pin]['speed_model_index']) + speed_model_indices.add('site_pin,{}'.format(site['site_pins'][site_pin]['speed_model_index'])) for pip in reduced_tile['pips'].keys(): - speed_model_indices.add(reduced_tile['pips'][pip]['speed_model_index']) + speed_model_indices.add('pip,{}'.format(reduced_tile['pips'][pip]['speed_model_index'])) for wire in reduced_tile['wires'].keys(): - speed_model_indices.add(reduced_tile['wires'][wire]) + speed_model_indices.add('wire,{}'.format(reduced_tile['wires'][wire])) return speed_model_indices -def annotate_speed_model(tile_type, reduced_tile, output_dir): +def annotate_speed_model(tile_type, reduced_tile, output_dir, root_dir): """ Updates the reduced tile with the correct speed information """ speed_model_indices = get_speed_model_indices(reduced_tile) @@ -264,6 +265,15 @@ def annotate_speed_model(tile_type, reduced_tile, output_dir): for index in speed_model_indices: print(index, file=f) + subprocess.check_call( + "vivado -mode batch -source get_speed_model.tcl -tclargs {}".format(tmp_indices_file), + shell=True, stdout=subprocess.DEVNULL) + + with open(tmp_indices_file, "r") as f: + speed_model_data = json5.load(f) + + with open(tmp_indices_file, "w") as f: + xjson.pprint(f, speed_model_data) def reduce_tile(pool, site_types, tile_type, tile_instances, database_file): sites = None @@ -369,7 +379,7 @@ def main(): reduced_tile = reduce_tile( pool, site_types, tile_type, tiles[tile_type], database_file) - annotate_speed_model(tile_type, reduced_tile, args.output_dir) + annotate_speed_model(tile_type, reduced_tile, args.output_dir, args.root_dir) for site_type in site_types: with open(os.path.join( From c16b1233d5b9aa34b551b723a2880fe5d7f1d1ce Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Tue, 4 Feb 2020 20:22:10 +0100 Subject: [PATCH 05/41] 074-dump_all: back annotation added to tile types Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/get_speed_model.tcl | 12 +-- fuzzers/074-dump_all/reduce_tile_types.py | 92 +++++++++++++++++++++-- 2 files changed, 91 insertions(+), 13 deletions(-) diff --git a/fuzzers/074-dump_all/get_speed_model.tcl b/fuzzers/074-dump_all/get_speed_model.tcl index 1c042784..4d42ef6d 100644 --- a/fuzzers/074-dump_all/get_speed_model.tcl +++ b/fuzzers/074-dump_all/get_speed_model.tcl @@ -61,13 +61,14 @@ foreach index $indices { set FAST_MAX [get_property FAST_MAX $speed_model] set SLOW_MIN [get_property SLOW_MIN $speed_model] set SLOW_MAX [get_property SLOW_MAX $speed_model] - } - puts $fp "\t\t\t\"fast_min\":\"$FAST_MIN\"," - puts $fp "\t\t\t\"fast_max\":\"$FAST_MAX\"," - puts $fp "\t\t\t\"slow_min\":\"$SLOW_MIN\"," - puts $fp "\t\t\t\"slow_max\":\"$SLOW_MAX\"" + puts $fp "\t\t\t\"delay\": \[" + puts $fp "\t\t\t\t\"$FAST_MIN\"," + puts $fp "\t\t\t\t\"$FAST_MAX\"," + puts $fp "\t\t\t\t\"$SLOW_MIN\"," + puts $fp "\t\t\t\t\"$SLOW_MAX\"" + puts $fp "\t\t\t\]," } elseif {$resource == "pip"} { # Getting all site_pin information set speed_model [get_speed_models -filter "SPEED_INDEX == $resource_index"] @@ -80,6 +81,7 @@ foreach index $indices { set forward_speed_model_type [get_property TYPE $forward_speed_model] set reverse_speed_model_type [get_property TYPE $reverse_speed_model] set is_pass_transistor [expr {"$forward_speed_model_type" == "pass_transistor"}] + puts $fp "\t\t\t\"is_pass_transistor\":$is_pass_transistor," if { !$is_pass_transistor } { puts $fp "\t\t\t\"forward_delay\":\[" puts $fp "\t\t\t\t\"[get_property FAST_MIN $forward_speed_model]\"," diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index 379879ba..da392ea7 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -243,10 +243,13 @@ def get_speed_model_indices(reduced_tile): for site in reduced_tile['sites']: for site_pin in site['site_pins'].keys(): - speed_model_indices.add('site_pin,{}'.format(site['site_pins'][site_pin]['speed_model_index'])) + speed_model_indices.add( + 'site_pin,{}'.format( + site['site_pins'][site_pin]['speed_model_index'])) for pip in reduced_tile['pips'].keys(): - speed_model_indices.add('pip,{}'.format(reduced_tile['pips'][pip]['speed_model_index'])) + speed_model_indices.add( + 'pip,{}'.format(reduced_tile['pips'][pip]['speed_model_index'])) for wire in reduced_tile['wires'].keys(): speed_model_indices.add('wire,{}'.format(reduced_tile['wires'][wire])) @@ -254,26 +257,98 @@ def get_speed_model_indices(reduced_tile): return speed_model_indices +def annotate_pips_speed_model(pips, speed_data): + """ Updates the pips with correct timing data """ + + for pip_name, pip_data in pips.items(): + speed_model_index = pip_data['speed_model_index'] + + pip_speed_data = speed_data[speed_model_index] + assert pip_speed_data['resource_name'] == 'pip', ( + pip_speed_data['resource_name'], speed_model_index) + + pips[pip_name]['is_pass_transistor'] = pip_speed_data[ + 'is_pass_transistor'] + pips[pip_name]['src_to_dst'] = { + 'delay': pip_speed_data.get('forward_delay', None), + 'in_cap': pip_speed_data.get('forward_in_cap', None), + 'res': pip_speed_data.get('forward_res', None), + } + pips[pip_name]['dst_to_src'] = { + 'delay': pip_speed_data.get('reverse_delay', None), + 'in_cap': pip_speed_data.get('reverse_in_cap', None), + 'res': pip_speed_data.get('reverse_res', None), + } + + +def annotate_site_pins_speed_model(site_pins, speed_data): + """ Updates the site_pins with correct timing data """ + + for site_pin_name, pin_data in site_pins.items(): + speed_model_index = pin_data['speed_model_index'] + + pin_speed_data = speed_data[speed_model_index] + assert pin_speed_data['resource_name'] == 'site_pin', ( + pin_speed_data['resource_name'], speed_model_index) + + site_pins[site_pin_name]['delay'] = pin_speed_data['delay'], + + cap = pin_speed_data['cap'] + res = pin_speed_data['res'] + if cap != 'null': + site_pins[site_pin_name]['cap'] = cap + if res != 'null': + site_pins[site_pin_name]['res'] = res + + +def annotate_wires_speed_model(wires, speed_data): + """ Updates the wires with correct timing data """ + + for wire_name, wire_data in wires.items(): + speed_model_index = wire_data + + wire_speed_data = speed_data[speed_model_index] + assert wire_speed_data['resource_name'] == 'wire', ( + wire_speed_data['resource_name'], speed_model_index) + + cap = wire_speed_data['cap'] + res = wire_speed_data['res'] + if cap != '0.000' and res != '0.000': + wires[wire_name] = { + 'cap': cap, + 'res': res, + } + else: + wires[wire_name] = None + + def annotate_speed_model(tile_type, reduced_tile, output_dir, root_dir): """ Updates the reduced tile with the correct speed information """ speed_model_indices = get_speed_model_indices(reduced_tile) - tmp_indices_file = os.path.join(output_dir, '{}_speed_index.tmp'.format(tile_type)) + tmp_indices_file = os.path.join( + output_dir, '{}_speed_index.tmp'.format(tile_type)) with open(tmp_indices_file, "w") as f: for index in speed_model_indices: print(index, file=f) subprocess.check_call( - "vivado -mode batch -source get_speed_model.tcl -tclargs {}".format(tmp_indices_file), - shell=True, stdout=subprocess.DEVNULL) + "vivado -mode batch -source get_speed_model.tcl -tclargs {}".format( + tmp_indices_file), + shell=True, + stdout=subprocess.DEVNULL) with open(tmp_indices_file, "r") as f: speed_model_data = json5.load(f) - with open(tmp_indices_file, "w") as f: - xjson.pprint(f, speed_model_data) + for site in reduced_tile['sites']: + annotate_site_pins_speed_model(site['site_pins'], speed_model_data) + + annotate_pips_speed_model(reduced_tile['pips'], speed_model_data) + annotate_wires_speed_model(reduced_tile['wires'], speed_model_data) + def reduce_tile(pool, site_types, tile_type, tile_instances, database_file): sites = None @@ -379,7 +454,8 @@ def main(): reduced_tile = reduce_tile( pool, site_types, tile_type, tiles[tile_type], database_file) - annotate_speed_model(tile_type, reduced_tile, args.output_dir, args.root_dir) + annotate_speed_model( + tile_type, reduced_tile, args.output_dir, args.root_dir) for site_type in site_types: with open(os.path.join( From 986ca05686df1ed62e221a4a5156c5de32e7bdef Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Tue, 4 Feb 2020 20:53:25 +0100 Subject: [PATCH 06/41] 074-dump_all: remove unnecessary lines from jobtiles.tcl Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/get_speed_model.tcl | 1 + fuzzers/074-dump_all/jobtiles.tcl | 23 ----------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/fuzzers/074-dump_all/get_speed_model.tcl b/fuzzers/074-dump_all/get_speed_model.tcl index 4d42ef6d..a877845a 100644 --- a/fuzzers/074-dump_all/get_speed_model.tcl +++ b/fuzzers/074-dump_all/get_speed_model.tcl @@ -13,6 +13,7 @@ set fp [open $filename w] set indices [split $file_data "\n"] +# Convert DRIVE from ??? units to 10^(-3 to -6) Ohms set MAGIC 0.6875 proc get_speed_model_name {name} { diff --git a/fuzzers/074-dump_all/jobtiles.tcl b/fuzzers/074-dump_all/jobtiles.tcl index d854f979..55cdd550 100644 --- a/fuzzers/074-dump_all/jobtiles.tcl +++ b/fuzzers/074-dump_all/jobtiles.tcl @@ -23,29 +23,6 @@ foreach roi "$::env(XRAY_EXCLUDE_ROI_TILEGRID)" { set not_allowed_sites [get_sites -of_objects [get_pblocks exclude_roi]] set not_allowed_tiles [get_tiles -of_objects $not_allowed_sites] -# Convert DRIVE from ??? units to 10^(-3 to -6) Ohms -set MAGIC 0.6875 - -set speed_model_index_map [dict create] - -# For BSW_INT_LONG_MUX, use the model from BSW_INT_HLONG_MUX. -# This isn't exactly correct, but it is a better model to use. -# BSW_INT_LONG_MUX is a tl_buffer (which we don't really understand), and -# BSW_INT_HLONG_MUX is not. This subsitution appears good enough for now. -set int_hlong_mux [lookup_speed_model_name BSW_INT_HLONG_MUX] -set int_long_mux [lookup_speed_model_name BSW_INT_LONG_MUX] - -set long_forward [get_property FORWARD $int_long_mux] -set hlong_forward [get_property FORWARD $int_hlong_mux] -dict set speed_model_name_map $long_forward [lookup_speed_model_name $hlong_forward] - -set long_reverse [get_property REVERSE $int_long_mux] -set hlong_reverse [get_property REVERSE $int_hlong_mux] -dict set speed_model_name_map $long_forward [lookup_speed_model_name $hlong_reverse] - -# Same here! -dict set speed_model_name_map _BSW_LONG_TLREVERSE [lookup_speed_model_name _BSW_LONG_NONTLFORWARD] - for {set j $start } { $j < $stop } { incr j } { set tile [lindex $tiles $j] From 46c28ccb91433734c4917b548a22350516d2a1ea Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Tue, 4 Feb 2020 22:14:51 +0100 Subject: [PATCH 07/41] 074-dump_all: continue if site_pin is NoneType Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/reduce_tile_types.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index da392ea7..d1e4496a 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -243,6 +243,9 @@ def get_speed_model_indices(reduced_tile): for site in reduced_tile['sites']: for site_pin in site['site_pins'].keys(): + if site['site_pins'][site_pin] is None: + continue + speed_model_indices.add( 'site_pin,{}'.format( site['site_pins'][site_pin]['speed_model_index'])) @@ -285,6 +288,9 @@ def annotate_site_pins_speed_model(site_pins, speed_data): """ Updates the site_pins with correct timing data """ for site_pin_name, pin_data in site_pins.items(): + if pin_data is None: + continue + speed_model_index = pin_data['speed_model_index'] pin_speed_data = speed_data[speed_model_index] From 1004ad6633c27a8834908568c9c17e42bcc55e5a Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Tue, 4 Feb 2020 23:33:30 +0100 Subject: [PATCH 08/41] 074-dump_all: get vivado exec path from env variable Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/reduce_tile_types.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index d1e4496a..c5d18d7b 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -340,9 +340,13 @@ def annotate_speed_model(tile_type, reduced_tile, output_dir, root_dir): for index in speed_model_indices: print(index, file=f) + # Get vivado path + vivado = os.getenv('XRAY_VIVADO') + assert vivado is not None + subprocess.check_call( - "vivado -mode batch -source get_speed_model.tcl -tclargs {}".format( - tmp_indices_file), + "{} -mode batch -source get_speed_model.tcl -tclargs {}".format( + vivado, tmp_indices_file), shell=True, stdout=subprocess.DEVNULL) From a2120b529ed8bbc2c4611112e5fb7313f64a36b9 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Wed, 5 Feb 2020 10:55:53 +0100 Subject: [PATCH 09/41] 074-dump_all: direct speed model tmp files to specimen directory Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/reduce_tile_types.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index c5d18d7b..84de0f04 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -328,13 +328,13 @@ def annotate_wires_speed_model(wires, speed_data): wires[wire_name] = None -def annotate_speed_model(tile_type, reduced_tile, output_dir, root_dir): +def annotate_speed_model(tile_type, reduced_tile, root_dir): """ Updates the reduced tile with the correct speed information """ speed_model_indices = get_speed_model_indices(reduced_tile) tmp_indices_file = os.path.join( - output_dir, '{}_speed_index.tmp'.format(tile_type)) + root_dir, '{}_speed_index.tmp'.format(tile_type)) with open(tmp_indices_file, "w") as f: for index in speed_model_indices: @@ -464,8 +464,7 @@ def main(): reduced_tile = reduce_tile( pool, site_types, tile_type, tiles[tile_type], database_file) - annotate_speed_model( - tile_type, reduced_tile, args.output_dir, args.root_dir) + annotate_speed_model(tile_type, reduced_tile, args.root_dir) for site_type in site_types: with open(os.path.join( From b24f5f5ad33d3eda7559a0f17d53a5f81e173a51 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Wed, 5 Feb 2020 11:37:34 +0100 Subject: [PATCH 10/41] fuzzers: clean and do make fuzzer/run.ok when generating part_only This is necessary to have a clean output when building extra-parts Signed-off-by: Alessandro Comodi --- fuzzers/Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fuzzers/Makefile b/fuzzers/Makefile index 08e61154..03f81c76 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -134,18 +134,18 @@ quick: # ----------------- $(addprefix ${XRAY_FAMILY_DIR}/${XRAY_PART}/part.,yaml json): - $(MAKE) -C 001-part-yaml run + $(MAKE) 001-part-yaml/run.ok ${XRAY_FAMILY_DIR}/${XRAY_PART}/package_pins.csv: - $(MAKE) -C 075-pins run + $(MAKE) 075-pins/run.ok ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json: - $(MAKE) -C 005-tilegrid run + $(MAKE) 005-tilegrid/run.ok ${XRAY_FAMILY_DIR}/${XRAY_PART}/tileconn.json: - $(MAKE) -C 072-ordered_wires run - $(MAKE) -C 073-get_counts run - $(MAKE) -C 074-dump_all run + $(MAKE) 072-ordered_wires/run.ok + $(MAKE) 073-get_counts/run.ok + $(MAKE) 074-dump_all/run.ok part_only_yaml: ${XRAY_FAMILY_DIR}/${XRAY_PART}/part.yaml part_only_tilegrid: ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json @@ -154,6 +154,7 @@ part_only_pins: ${XRAY_FAMILY_DIR}/${XRAY_PART}/package_pins.csv # part_only runs the fuzzers required to support additional parts part_only: + +$(MAKE) clean_fuzzers # Create PART-specific directory mkdir -p ${XRAY_FAMILY_DIR}/${XRAY_PART} # Generate YAML From 1257f9f8558dd30fd12fa3e54f15918f980b1a9a Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Wed, 5 Feb 2020 17:05:33 +0100 Subject: [PATCH 11/41] 074-dump_all: remove speed_index from tile_types Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/reduce_tile_types.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index 84de0f04..a12b3ef5 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -283,6 +283,8 @@ def annotate_pips_speed_model(pips, speed_data): 'res': pip_speed_data.get('reverse_res', None), } + del pips[pip_name]['speed_model_index'] + def annotate_site_pins_speed_model(site_pins, speed_data): """ Updates the site_pins with correct timing data """ @@ -306,6 +308,8 @@ def annotate_site_pins_speed_model(site_pins, speed_data): if res != 'null': site_pins[site_pin_name]['res'] = res + del site_pins[site_pin_name]['speed_model_index'] + def annotate_wires_speed_model(wires, speed_data): """ Updates the wires with correct timing data """ From 43699a09acd29272c7a27f1dc069a75103c0ee47 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Thu, 6 Feb 2020 11:24:55 +0100 Subject: [PATCH 12/41] 074-dump_all: fix bug in site pin delay addition Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/reduce_tile_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index a12b3ef5..a152e20f 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -299,7 +299,7 @@ def annotate_site_pins_speed_model(site_pins, speed_data): assert pin_speed_data['resource_name'] == 'site_pin', ( pin_speed_data['resource_name'], speed_model_index) - site_pins[site_pin_name]['delay'] = pin_speed_data['delay'], + site_pins[site_pin_name]['delay'] = pin_speed_data['delay'] cap = pin_speed_data['cap'] res = pin_speed_data['res'] From 3f435ea30beb73b14a1b6314682d43e73fa5da6d Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Fri, 7 Feb 2020 14:54:08 +0100 Subject: [PATCH 13/41] 074-dump_all: fix bug when annotating wires speed model Signed-off-by: Alessandro Comodi --- fuzzers/074-dump_all/reduce_tile_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/074-dump_all/reduce_tile_types.py b/fuzzers/074-dump_all/reduce_tile_types.py index a152e20f..fdaa0f99 100644 --- a/fuzzers/074-dump_all/reduce_tile_types.py +++ b/fuzzers/074-dump_all/reduce_tile_types.py @@ -323,7 +323,7 @@ def annotate_wires_speed_model(wires, speed_data): cap = wire_speed_data['cap'] res = wire_speed_data['res'] - if cap != '0.000' and res != '0.000': + if cap != '0.000' or res != '0.000': wires[wire_name] = { 'cap': cap, 'res': res, From 4691ba3183e52ac2811e229d92d4499890d2eadc Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Mon, 10 Feb 2020 12:23:13 -0800 Subject: [PATCH 14/41] Remove temp files after 074 completes. - Remove unused imports. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/074-dump_all/Makefile | 2 ++ fuzzers/074-dump_all/run_fuzzer.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fuzzers/074-dump_all/Makefile b/fuzzers/074-dump_all/Makefile index c377e69d..b5247934 100644 --- a/fuzzers/074-dump_all/Makefile +++ b/fuzzers/074-dump_all/Makefile @@ -23,6 +23,8 @@ run: $(MAKE) clean $(MAKE) database $(MAKE) pushdb + # Clean up intermediate files after successful pushdb. + find build -name "*.json5" -delete touch run.ok clean: diff --git a/fuzzers/074-dump_all/run_fuzzer.py b/fuzzers/074-dump_all/run_fuzzer.py index 41ced3d1..68a2dccf 100644 --- a/fuzzers/074-dump_all/run_fuzzer.py +++ b/fuzzers/074-dump_all/run_fuzzer.py @@ -1,8 +1,6 @@ -import os import shutil import sys import subprocess -import signal from multiprocessing import Pool from itertools import chain import argparse From 6129df827f4c321cff85ea6aa0d52181320adbb7 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Mon, 10 Feb 2020 12:25:00 -0800 Subject: [PATCH 15/41] Increase vivado processes for extra parts. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .github/kokoro/db-full.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/kokoro/db-full.sh b/.github/kokoro/db-full.sh index 6d6c63f1..23f8b780 100755 --- a/.github/kokoro/db-full.sh +++ b/.github/kokoro/db-full.sh @@ -95,7 +95,10 @@ set -e # Generate extra parts file (tilegrid, tileconn, part yaml, part json and package_pin) set +e -make db-extras-${XRAY_SETTINGS}-parts -j $CORES +( + export MAX_VIVADO_PROCESS=$((CORES/2 < 20 ? CORES/2 : 20)) + make db-extras-${XRAY_SETTINGS}-parts -j $CORES +) EXTRAS_PARTS_RET=$? set -e From 2bc72b5cce1df6d11bad4e814d77b106f8d695e9 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 12 Feb 2020 15:47:36 -0800 Subject: [PATCH 16/41] Increase number of processes allowed to run during final grid reduction. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .github/kokoro/db-full.sh | 4 ++++ .github/kokoro/steps/hostinfo.sh | 6 ++++++ fuzzers/074-dump_all/generate_after_dump.sh | 6 +++++- fuzzers/074-dump_all/generate_grid.py | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/kokoro/db-full.sh b/.github/kokoro/db-full.sh index 23f8b780..696bc5c1 100755 --- a/.github/kokoro/db-full.sh +++ b/.github/kokoro/db-full.sh @@ -97,6 +97,10 @@ set -e set +e ( export MAX_VIVADO_PROCESS=$((CORES/2 < 20 ? CORES/2 : 20)) + + # Use all the memory available on the system for generating the final + # grid and tileconn. + export MAX_GRID_CPU=${MAX_CPU_PER_GRID} make db-extras-${XRAY_SETTINGS}-parts -j $CORES ) EXTRAS_PARTS_RET=$? diff --git a/.github/kokoro/steps/hostinfo.sh b/.github/kokoro/steps/hostinfo.sh index 6a00c37f..b0042f8a 100755 --- a/.github/kokoro/steps/hostinfo.sh +++ b/.github/kokoro/steps/hostinfo.sh @@ -20,6 +20,12 @@ echo "Memory" echo "----------------------------------------" cat /proc/meminfo echo "----------------------------------------" +export MEM_GB=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo)/(1024*1024))) +echo "Total Memory (GB): $MEM_GB" + +# Approx memory per grid process +export MEM_PER_GRID=8 +export MAX_CPU_PER_GRID=$(($MEM_GB/$MEM_PER_RUN)) echo echo "========================================" diff --git a/fuzzers/074-dump_all/generate_after_dump.sh b/fuzzers/074-dump_all/generate_after_dump.sh index c1320779..5c5bc9d9 100755 --- a/fuzzers/074-dump_all/generate_after_dump.sh +++ b/fuzzers/074-dump_all/generate_after_dump.sh @@ -1,5 +1,8 @@ #!/bin/bash -xe +# By default use ~50 GiB for generate_grid.py, but allow override. +export DEFAULT_MAX_GRID_CPU=10 + rm -rf build/output mkdir -p build/output python3 reduce_tile_types.py \ @@ -11,4 +14,5 @@ python3 create_node_tree.py \ --output_dir build/output python3 reduce_site_types.py --output_dir build/output python3 generate_grid.py --root_dir build/specimen_001/ --output_dir build/output \ - --ignored_wires ignored_wires/${XRAY_DATABASE}/${XRAY_PART}_ignored_wires.txt + --ignored_wires ignored_wires/${XRAY_DATABASE}/${XRAY_PART}_ignored_wires.txt \ + --max_cpu=${MAX_GRID_CPU:-${DEFAULT_MAX_GRID_CPU}} diff --git a/fuzzers/074-dump_all/generate_grid.py b/fuzzers/074-dump_all/generate_grid.py index 4743d262..80cb5f20 100644 --- a/fuzzers/074-dump_all/generate_grid.py +++ b/fuzzers/074-dump_all/generate_grid.py @@ -559,12 +559,13 @@ def main(): parser.add_argument('--output_dir', required=True) parser.add_argument('--verify_only', action='store_true') parser.add_argument('--ignored_wires') + parser.add_argument('--max_cpu', type=int, default=10) args = parser.parse_args() tiles, nodes = lib.read_root_csv(args.root_dir) - processes = min(multiprocessing.cpu_count(), 10) + processes = min(multiprocessing.cpu_count(), args.max_cpu) print('{} Running {} processes'.format(datetime.datetime.now(), processes)) pool = multiprocessing.Pool(processes=processes) From 073c9761280f9de59c79000219789d684a66f54c Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Thu, 13 Feb 2020 12:10:58 +0100 Subject: [PATCH 17/41] cleaning fuzzers before running roi_only target commands Signed-off-by: Alessandro Comodi --- fuzzers/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/fuzzers/Makefile b/fuzzers/Makefile index 03f81c76..fb0f29b2 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -169,6 +169,7 @@ part_only: # roi_only runs the fuzzers required for supporting additional parts when building # a roi harness. roi_only: + +$(MAKE) clean_fuzzers # Create PART-specific directory mkdir -p ${XRAY_FAMILY_DIR}/${XRAY_PART} # Generate YAML From 44b79e1e8584b05bdd6413bc51547ca0ff1a718c Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Fri, 14 Feb 2020 09:36:25 -0800 Subject: [PATCH 18/41] Remap some timing models. This is an approximation, but it may work better. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/074-dump_all/get_speed_model.tcl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fuzzers/074-dump_all/get_speed_model.tcl b/fuzzers/074-dump_all/get_speed_model.tcl index a877845a..8b911ae0 100644 --- a/fuzzers/074-dump_all/get_speed_model.tcl +++ b/fuzzers/074-dump_all/get_speed_model.tcl @@ -17,6 +17,19 @@ set indices [split $file_data "\n"] set MAGIC 0.6875 proc get_speed_model_name {name} { + # For BSW_INT_LONG_MUX, use the model from BSW_INT_HLONG_MUX. + # This isn't exactly correct, but it is a better model to use. + # BSW_INT_LONG_MUX is a tl_buffer (which we don't really understand), and + # BSW_INT_HLONG_MUX is not. This subsitution appears good enough for now. + if { $name == "BSW_INT_LONG_MUX" } { + set name "BSW_INT_HLONG_MUX" + } + + # Same here! + if { $name == "_BSW_LONG_TLREVERSE" } { + set name "_BSW_LONG_NONTLFORWARD" + } + return [get_speed_models -filter "NAME == $name"] } From 9f839a7a083234cfa7f3fb627badc6ee855a9df6 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 09:00:34 -0800 Subject: [PATCH 19/41] Attempt to parallelize 074 for additional parts. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .github/kokoro/db-full.sh | 26 +-- .gitignore | 2 + Makefile | 16 +- fuzzers/000-init-db/Makefile | 23 ++- fuzzers/001-part-yaml/Makefile | 24 +-- fuzzers/005-tilegrid/Makefile | 129 ++++++------- fuzzers/005-tilegrid/add_tdb.py | 53 +++--- fuzzers/005-tilegrid/fuzzaddr/common.mk | 13 +- fuzzers/005-tilegrid/fuzzaddr/generate.sh | 2 +- fuzzers/072-ordered_wires/Makefile | 6 +- fuzzers/073-get_counts/Makefile | 9 +- fuzzers/074-dump_all/Makefile | 15 +- fuzzers/074-dump_all/generate_after_dump.sh | 21 ++- fuzzers/075-pins/Makefile | 9 +- fuzzers/Makefile | 199 ++++++++++---------- minitests/roi_harness/Makefile | 18 +- 16 files changed, 284 insertions(+), 281 deletions(-) diff --git a/.github/kokoro/db-full.sh b/.github/kokoro/db-full.sh index 696bc5c1..c3d41152 100755 --- a/.github/kokoro/db-full.sh +++ b/.github/kokoro/db-full.sh @@ -38,11 +38,9 @@ echo "========================================" echo "Running Database build" echo "----------------------------------------" ( - cd fuzzers - # Output which fuzzers we are going to run echo "make --dry-run" - make --dry-run + make --dry-run db-${XRAY_SETTINGS}-all echo "----------------------------------------" # Run the fuzzers @@ -55,7 +53,7 @@ echo "----------------------------------------" export MAX_VIVADO_PROCESS=$((CORES/2 < 20 ? CORES/2 : 20)) set -x +e tmp=`mktemp` - script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$MAX_VIVADO_PROCESS" $tmp + script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$MAX_VIVADO_PROCESS db-${XRAY_SETTINGS}-all" $tmp DATABASE_RET=$? set +x -e @@ -86,26 +84,6 @@ echo "----------------------------------------" ) echo "----------------------------------------" -# Generate extra harness files (additional part yaml's, harness). -set +e -# Attempt to generate extra harnesses here, but don't check until after diff reporting. -make db-extras-${XRAY_SETTINGS}-harness -EXTRAS_HARNESS_RET=$? -set -e - -# Generate extra parts file (tilegrid, tileconn, part yaml, part json and package_pin) -set +e -( - export MAX_VIVADO_PROCESS=$((CORES/2 < 20 ? CORES/2 : 20)) - - # Use all the memory available on the system for generating the final - # grid and tileconn. - export MAX_GRID_CPU=${MAX_CPU_PER_GRID} - make db-extras-${XRAY_SETTINGS}-parts -j $CORES -) -EXTRAS_PARTS_RET=$? -set -e - # Format the database make db-format-${XRAY_SETTINGS} # Update the database/Info.md file diff --git a/.gitignore b/.gitignore index ec469db3..c33ccb73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ env build +build_* logs database .Xil **/specimen_* **/output run.ok +run.*.ok __pycache__ *.pyc *.swp diff --git a/Makefile b/Makefile index 96948608..cdfbba14 100644 --- a/Makefile +++ b/Makefile @@ -114,6 +114,9 @@ define database # $(1) - Database name +db-$(1): + +source settings/$(1).sh && $$(MAKE) -C fuzzers + db-check-$(1): @echo @echo "Checking $(1) database" @@ -127,9 +130,15 @@ db-format-$(1): @$(IN_ENV) cd database/$(1); python3 ../../utils/sort_db.py @if [ -e database/Info.md ]; then $(IN_ENV) ./utils/info_md.py --keep; fi -.PHONY: db-check-$(1) db-format-$(1) +.PHONY: db-$(1) db-check-$(1) db-format-$(1) db-extras-$(1) db-extras-$(1)-parts db-extras-$(1)-harness .NOTPARALLEL: db-check-$(1) db-format-$(1) +db-extras-$(1): db-extras-$(1)-parts db-extras-$(1)-harness + +db-$(1)-all: db-$(1) db-extras-$(1)-parts + # Build harnesses after database is complete + $$(MAKE) db-extras-$(1)-harness + db-check: db-check-$(1) db-format: db-format-$(1) @@ -137,8 +146,6 @@ endef $(foreach DB,$(DATABASES),$(eval $(call database,$(DB)))) -.PHONY: db-extras-artix7 db-extras-kintex7 db-extras-zynq7 - # Targets related to Project X-Ray parts # -------------------------------------- @@ -159,9 +166,12 @@ endef $(foreach PART,$(XRAY_PARTS),$(eval $(call multiple-parts,$(PART)))) + db-extras-artix7-parts: $(addprefix db-part-only-,$(ARTIX_PARTS)) db-extras-artix7-harness: + +XRAY_PIN_00=J13 XRAY_PIN_01=J14 XRAY_PIN_02=K15 XRAY_PIN_03=K16 \ + XRAY_PART=xc7a35tftg256-1 XRAY_EQUIV_PART=xc7a50tfgg484-1 $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/basys3-swbut.sh && $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/arty-uart.sh && $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/basys3-swbut.sh && \ diff --git a/fuzzers/000-init-db/Makefile b/fuzzers/000-init-db/Makefile index 169e8368..849adebd 100644 --- a/fuzzers/000-init-db/Makefile +++ b/fuzzers/000-init-db/Makefile @@ -55,17 +55,19 @@ BLOCK_RAM_EXTRA_DB_FILES=\ DB_FILES=$(sort $(addsuffix .origin_info.db,$(DB_SIMPLE)) $(addsuffix .db,$(DB_SIMPLE)) $(BLOCK_RAM_EXTRA_DB_FILES)) DB_FILES_PATH=$(addprefix $(XRAY_DATABASE_DIR)/$(XRAY_DATABASE)/,$(DB_FILES)) +BUILD_DIR = build_${XRAY_PART} + check: - @mkdir -p build - @rm -f build/existing.txt + @mkdir -p build_ + @rm -f $(BUILD_DIR)/existing.txt @for DB_FILE in $(sort $(notdir $(wildcard $(XRAY_DATABASE_DIR)/$(XRAY_DATABASE)/*.db))); do \ - echo $$DB_FILE >> build/existing.txt; \ + echo $$DB_FILE >> $(BUILD_DIR)/existing.txt; \ done - @rm -f build/tocreate.txt + @rm -f $(BUILD_DIR)/tocreate.txt @for DB_FILE in $(sort $(DB_FILES)); do \ - echo $$DB_FILE >> build/tocreate.txt; \ + echo $$DB_FILE >> $(BUILD_DIR)/tocreate.txt; \ done - diff -u build/existing.txt build/tocreate.txt + diff -u $(BUILD_DIR)/existing.txt $(BUILD_DIR)/tocreate.txt status: @echo $(DB_FILES_PATH) @@ -82,15 +84,18 @@ status: $(DB_FILES_PATH): touch $@ -pushdb: $(DB_FILES_PATH) +${XRAY_FAMILY_DIR}/${XRAY_PART}: + mkdir -p ${XRAY_FAMILY_DIR}/${XRAY_PART} + +pushdb: $(DB_FILES_PATH) ${XRAY_FAMILY_DIR}/${XRAY_PART} @true run: $(MAKE) clean $(MAKE) pushdb - touch run.ok + touch run.${XRAY_PART}.ok clean: - rm -rf build run.ok + rm -rf build_* run.*.ok .PHONY: pushdb clean run diff --git a/fuzzers/001-part-yaml/Makefile b/fuzzers/001-part-yaml/Makefile index efc4320c..2cd79e3c 100644 --- a/fuzzers/001-part-yaml/Makefile +++ b/fuzzers/001-part-yaml/Makefile @@ -1,12 +1,14 @@ N := 1 -SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N))) +SPECIMENS := $(addprefix build_${XRAY_PART}/specimen_,$(shell seq -f '%03.0f' $(N))) + +BUILD_DIR = build_${XRAY_PART} database: $(SPECIMENS) - mkdir -p build - cp build/specimen_001/part.yaml build/part.yaml - python3 -m utils.xyaml build/part.yaml > build/part_no_iobanks.json - python3 add_iobanks.py --part_json build/part_no_iobanks.json --iobanks_info build/specimen_001/iobanks.txt > build/part.json - cp ${XRAY_PART}_required_features.fasm build/ 2>/dev/null || true + mkdir -p $(BUILD_DIR) + cp $(BUILD_DIR)/specimen_001/part.yaml $(BUILD_DIR)/part.yaml + python3 -m utils.xyaml $(BUILD_DIR)/part.yaml > $(BUILD_DIR)/part_no_iobanks.json + python3 add_iobanks.py --part_json $(BUILD_DIR)/part_no_iobanks.json --iobanks_info $(BUILD_DIR)/specimen_001/iobanks.txt > $(BUILD_DIR)/part.json + cp ${XRAY_PART}_required_features.fasm $(BUILD_DIR)/ 2>/dev/null || true $(SPECIMENS): Makefile.specimen mkdir -p $@ @@ -14,17 +16,17 @@ $(SPECIMENS): Makefile.specimen pushdb: mkdir -p ${XRAY_FAMILY_DIR}/${XRAY_PART} - cp build/part.json $(XRAY_FAMILY_DIR)/${XRAY_PART}/part.json - cp build/part.yaml $(XRAY_FAMILY_DIR)/${XRAY_PART}/part.yaml - cp build/${XRAY_PART}_required_features.fasm ${XRAY_FAMILY_DIR}/${XRAY_PART}/required_features.fasm 2>/dev/null || true + cp $(BUILD_DIR)/part.json $(XRAY_FAMILY_DIR)/${XRAY_PART}/part.json + cp $(BUILD_DIR)/part.yaml $(XRAY_FAMILY_DIR)/${XRAY_PART}/part.yaml + cp $(BUILD_DIR)/${XRAY_PART}_required_features.fasm ${XRAY_FAMILY_DIR}/${XRAY_PART}/required_features.fasm 2>/dev/null || true run: $(MAKE) clean $(MAKE) database $(MAKE) pushdb - touch run.ok + touch run.${XRAY_PART}.ok clean: - rm -rf build run.ok + rm -rf build_* run.*.ok .PHONY: database pushdb clean run $(SPECIMENS) diff --git a/fuzzers/005-tilegrid/Makefile b/fuzzers/005-tilegrid/Makefile index 9e9e38a6..81959b4c 100644 --- a/fuzzers/005-tilegrid/Makefile +++ b/fuzzers/005-tilegrid/Makefile @@ -1,144 +1,145 @@ FUZDIR=$(shell pwd) -BUILD_DIR=$(FUZDIR)/build +BUILD_FOLDER=build_${XRAY_PART} +BUILD_DIR=$(FUZDIR)/$(BUILD_FOLDER) TILEGRID_TDB_DEPENDENCIES= -TILEGRID_TDB_DEPENDENCIES += iob/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += iob_int/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += ioi/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += monitor/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += bram/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += bram_block/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += bram_int/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += clb/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += clb_int/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += cfg/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += dsp/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += fifo_int/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += cfg_int/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += monitor_int/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += clk_hrow/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += clk_bufg/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += hclk_cmt/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += pll/build/segbits_tilegrid.tdb -TILEGRID_TDB_DEPENDENCIES += hclk_ioi/build/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += iob/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += iob_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += ioi/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += monitor/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += bram/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += bram_block/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += bram_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += clb/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += clb_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += cfg/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += dsp/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += fifo_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += cfg_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += monitor_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += clk_hrow/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += clk_bufg/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += hclk_cmt/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += pll/$(BUILD_FOLDER)/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += hclk_ioi/$(BUILD_FOLDER)/segbits_tilegrid.tdb GENERATE_FULL_ARGS= ifeq (${XRAY_DATABASE}, zynq7) # Zynq7 only -TILEGRID_TDB_DEPENDENCIES += ps7_int/build/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += ps7_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb else # Artix7/Kintex7 only -TILEGRID_TDB_DEPENDENCIES += mmcm/build/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += mmcm/$(BUILD_FOLDER)/segbits_tilegrid.tdb endif ifeq (${XRAY_DATABASE}, kintex7) -TILEGRID_TDB_DEPENDENCIES += orphan_int_column/build/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += orphan_int_column/$(BUILD_FOLDER)/segbits_tilegrid.tdb else # Disable DSP INT fuzzer on kintex7. It doesn't work, and isn't required. -TILEGRID_TDB_DEPENDENCIES += dsp_int/build/segbits_tilegrid.tdb +TILEGRID_TDB_DEPENDENCIES += dsp_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb endif -BASICDB_TILEGRID=build/basicdb/${XRAY_PART}/tilegrid.json +BASICDB_TILEGRID=$(BUILD_FOLDER)/basicdb/${XRAY_PART}/tilegrid.json -database: build/tilegrid.json +database: $(BUILD_FOLDER)/tilegrid.json -pushdb: build/tilegrid.json - cp build/tilegrid.json ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json +pushdb: $(BUILD_FOLDER)/tilegrid.json + cp $(BUILD_FOLDER)/tilegrid.json ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json -build/tiles/tiles.txt: - bash generate.sh build/tiles tiles +$(BUILD_FOLDER)/tiles/tiles.txt: + bash generate.sh $(BUILD_FOLDER)/tiles tiles -${BASICDB_TILEGRID}: generate.py build/tiles/tiles.txt - mkdir -p build/basicdb/${XRAY_PART} - cd build && python3 ${FUZDIR}/generate.py \ - --tiles $(FUZDIR)/build/tiles/tiles.txt \ - --pin_func $(FUZDIR)/build/tiles/pin_func.txt \ +${BASICDB_TILEGRID}: generate.py $(BUILD_FOLDER)/tiles/tiles.txt + mkdir -p $(BUILD_FOLDER)/basicdb/${XRAY_PART} + cd $(BUILD_FOLDER) && python3 ${FUZDIR}/generate.py \ + --tiles $(BUILD_DIR)/tiles/tiles.txt \ + --pin_func $(BUILD_DIR)/tiles/pin_func.txt \ --out ${BUILD_DIR}/basicdb/${XRAY_PART}/tilegrid.json -clb/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +clb/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd clb && $(MAKE) -clb_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +clb_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd clb_int && $(MAKE) -cfg/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +cfg/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd cfg && $(MAKE) -iob/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +iob/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd iob && $(MAKE) -iob_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +iob_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd iob_int && $(MAKE) -ioi/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +ioi/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd ioi && $(MAKE) -mmcm/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +mmcm/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd mmcm && $(MAKE) -pll/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +pll/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd pll && $(MAKE) -ps7_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +ps7_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd ps7_int && $(MAKE) -monitor/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +monitor/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd monitor && $(MAKE) -monitor_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +monitor_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd monitor_int && $(MAKE) -bram/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +bram/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd bram && $(MAKE) -bram_block/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +bram_block/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd bram_block && $(MAKE) -bram_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +bram_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd bram_int && $(MAKE) -dsp/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +dsp/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd dsp && $(MAKE) -dsp_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +dsp_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd dsp_int && $(MAKE) -fifo_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +fifo_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd fifo_int && $(MAKE) -cfg_int/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +cfg_int/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd cfg_int && $(MAKE) -orphan_int_column/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +orphan_int_column/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd orphan_int_column && $(MAKE) -clk_hrow/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +clk_hrow/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd clk_hrow && $(MAKE) -clk_bufg/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +clk_bufg/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd clk_bufg && $(MAKE) -hclk_cmt/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +hclk_cmt/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd hclk_cmt && $(MAKE) -hclk_ioi/build/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} +hclk_ioi/$(BUILD_FOLDER)/segbits_tilegrid.tdb: ${BASICDB_TILEGRID} cd hclk_ioi && $(MAKE) -build/tilegrid_tdb.json: add_tdb.py $(TILEGRID_TDB_DEPENDENCIES) +$(BUILD_FOLDER)/tilegrid_tdb.json: add_tdb.py $(TILEGRID_TDB_DEPENDENCIES) python3 add_tdb.py \ --fn-in ${BASICDB_TILEGRID} \ - --fn-out build/tilegrid_tdb.json + --fn-out $(BUILD_FOLDER)/tilegrid_tdb.json -build/tilegrid.json: generate_full.py build/tilegrid_tdb.json - cd build && python3 ${FUZDIR}/generate_full.py \ +$(BUILD_FOLDER)/tilegrid.json: generate_full.py $(BUILD_FOLDER)/tilegrid_tdb.json + cd $(BUILD_FOLDER) && python3 ${FUZDIR}/generate_full.py \ --json-in tilegrid_tdb.json --json-out ${BUILD_DIR}/tilegrid.json run: $(MAKE) clean $(MAKE) database $(MAKE) pushdb - touch run.ok + touch run.${XRAY_PART}.ok clean: - rm -rf build run.ok + rm -rf build_* run.*.ok cd clb && $(MAKE) clean cd clb_int && $(MAKE) clean cd cfg && $(MAKE) clean diff --git a/fuzzers/005-tilegrid/add_tdb.py b/fuzzers/005-tilegrid/add_tdb.py index 61403894..e526f38d 100644 --- a/fuzzers/005-tilegrid/add_tdb.py +++ b/fuzzers/005-tilegrid/add_tdb.py @@ -76,34 +76,35 @@ def run(fn_in, fn_out, verbose=False): # FIXME: generate words from pitch int_frames, int_words = localutil.get_int_params() tdb_fns = [ - ("iob/build/segbits_tilegrid.tdb", 42, 4), - ("ioi/build/segbits_tilegrid.tdb", 42, 4), - ("mmcm/build/segbits_tilegrid.tdb", 30, 101), - ("pll/build/segbits_tilegrid.tdb", 30, 26), - ("monitor/build/segbits_tilegrid.tdb", 30, 101), - ("bram/build/segbits_tilegrid.tdb", 28, 10), - ("bram_block/build/segbits_tilegrid.tdb", 128, 10), - ("clb/build/segbits_tilegrid.tdb", 36, 2), - ("cfg/build/segbits_tilegrid.tdb", 30, 101), - ("dsp/build/segbits_tilegrid.tdb", 28, 10), - ("clk_hrow/build/segbits_tilegrid.tdb", 30, 18), - ("clk_bufg/build/segbits_tilegrid.tdb", 30, 8), - ("hclk_cmt/build/segbits_tilegrid.tdb", 30, 10), - ("hclk_ioi/build/segbits_tilegrid.tdb", 42, 1), - ("clb_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ("iob_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ("bram_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ("dsp_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ("fifo_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ("ps7_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ("cfg_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ("monitor_int/build/segbits_tilegrid.tdb", int_frames, int_words), - ( - "orphan_int_column/build/segbits_tilegrid.tdb", int_frames, - int_words), + ("iob", 42, 4), + ("ioi", 42, 4), + ("mmcm", 30, 101), + ("pll", 30, 26), + ("monitor", 30, 101), + ("bram", 28, 10), + ("bram_block", 128, 10), + ("clb", 36, 2), + ("cfg", 30, 101), + ("dsp", 28, 10), + ("clk_hrow", 30, 18), + ("clk_bufg", 30, 8), + ("hclk_cmt", 30, 10), + ("hclk_ioi", 42, 1), + ("clb_int", int_frames, int_words), + ("iob_int", int_frames, int_words), + ("bram_int", int_frames, int_words), + ("dsp_int", int_frames, int_words), + ("fifo_int", int_frames, int_words), + ("ps7_int", int_frames, int_words), + ("cfg_int", int_frames, int_words), + ("monitor_int", int_frames, int_words), + ("orphan_int_column", int_frames, int_words), ] - for (tdb_fn, frames, words) in tdb_fns: + for (subdir, frames, words) in tdb_fns: + tdb_fn = os.path.join( + subdir, 'build_{}'.format(os.environ['XRAY_PART']), + 'segbits_tilegrid.tdb') if not os.path.exists(tdb_fn): verbose and print('Skipping {}, file not found!'.format(tdb_fn)) continue diff --git a/fuzzers/005-tilegrid/fuzzaddr/common.mk b/fuzzers/005-tilegrid/fuzzaddr/common.mk index 21b185d6..f54efa78 100644 --- a/fuzzers/005-tilegrid/fuzzaddr/common.mk +++ b/fuzzers/005-tilegrid/fuzzaddr/common.mk @@ -1,12 +1,13 @@ N ?= 10 +BUILD_DIR = build_$(XRAY_PART) GENERATE_ARGS ?= -SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N))) +SPECIMENS := $(addprefix $(BUILD_DIR)/specimen_,$(shell seq -f '%03.0f' $(N))) SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) -database: build/segbits_tilegrid.tdb +database: $(BUILD_DIR)/segbits_tilegrid.tdb -build/segbits_tilegrid.tdb: $(SPECIMENS_OK) - ${XRAY_SEGMATCH} -o build/segbits_tilegrid.tdb $$(find build -name "segdata_tilegrid.txt") +$(BUILD_DIR)/segbits_tilegrid.tdb: $(SPECIMENS_OK) + ${XRAY_SEGMATCH} -o $(BUILD_DIR)/segbits_tilegrid.tdb $$(find $(BUILD_DIR) -name "segdata_tilegrid.txt") $(SPECIMENS_OK): GENERATE_ARGS=${GENERATE_ARGS} bash ../fuzzaddr/generate.sh $(subst /OK,,$@) @@ -16,10 +17,10 @@ run: $(MAKE) clean $(MAKE) database $(MAKE) pushdb - touch run.ok + touch run.${XRAY_PART}.ok clean: - rm -rf build + rm -rf build_* run.*.ok .PHONY: database pushdb run clean diff --git a/fuzzers/005-tilegrid/fuzzaddr/generate.sh b/fuzzers/005-tilegrid/fuzzaddr/generate.sh index 76503f6d..f5095f62 100644 --- a/fuzzers/005-tilegrid/fuzzaddr/generate.sh +++ b/fuzzers/005-tilegrid/fuzzaddr/generate.sh @@ -7,7 +7,7 @@ source ${XRAY_GENHEADER} # Some projects have hard coded top.v, others are generated if [ -f $FUZDIR/top.py ] ; then - XRAY_DATABASE_ROOT=$FUZDIR/../build/basicdb python3 $FUZDIR/top.py >top.v + XRAY_DATABASE_ROOT=$FUZDIR/../build_${XRAY_PART}/basicdb python3 $FUZDIR/top.py >top.v fi ${XRAY_VIVADO} -mode batch -source $FUZDIR/generate.tcl diff --git a/fuzzers/072-ordered_wires/Makefile b/fuzzers/072-ordered_wires/Makefile index 851bebc8..49682145 100644 --- a/fuzzers/072-ordered_wires/Makefile +++ b/fuzzers/072-ordered_wires/Makefile @@ -1,6 +1,6 @@ N := 1 -SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N))) +SPECIMENS := $(addprefix build_${XRAY_PART}/specimen_,$(shell seq -f '%03.0f' $(N))) SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) MAX_VIVADO_PROCESS ?= 4 MAX_PIPS_INSTANCE ?= 340000 @@ -19,10 +19,10 @@ run: $(MAKE) clean $(MAKE) database $(MAKE) pushdb - touch run.ok + touch run.${XRAY_PART}.ok clean: - rm -rf build run.ok + rm -rf build_* run.*.ok .PHONY: database pushdb run clean diff --git a/fuzzers/073-get_counts/Makefile b/fuzzers/073-get_counts/Makefile index e4542ba5..1b7fcab7 100644 --- a/fuzzers/073-get_counts/Makefile +++ b/fuzzers/073-get_counts/Makefile @@ -1,13 +1,14 @@ N := 1 -SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N))) +BUILD_DIR = build_${XRAY_PART} +SPECIMENS := $(addprefix $(BUILD_DIR)/specimen_,$(shell seq -f '%03.0f' $(N))) SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) database: $(SPECIMENS_OK) true pushdb: - cp build/specimen_001/*.csv ${XRAY_DATABASE_DIR}/$(XRAY_DATABASE)/ + cp $(BUILD_DIR)/specimen_001/*.csv ${XRAY_DATABASE_DIR}/$(XRAY_DATABASE)/ $(SPECIMENS_OK): bash generate.sh $(subst /OK,,$@) @@ -17,10 +18,10 @@ run: $(MAKE) clean $(MAKE) database $(MAKE) pushdb - touch run.ok + touch run.${XRAY_PART}.ok clean: - rm -rf build run.ok + rm -rf build_* run.${XRAY_PART}.ok .PHONY: database pushdb run clean diff --git a/fuzzers/074-dump_all/Makefile b/fuzzers/074-dump_all/Makefile index b5247934..9d3850c5 100644 --- a/fuzzers/074-dump_all/Makefile +++ b/fuzzers/074-dump_all/Makefile @@ -1,6 +1,7 @@ N := 1 -SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N))) +BUILD_DIR = build_${XRAY_PART} +SPECIMENS := $(addprefix $(BUILD_DIR)/specimen_,$(shell seq -f '%03.0f' $(N))) SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) MAX_VIVADO_PROCESS ?= 4 MAX_TILES_INSTANCE ?= 300 @@ -10,10 +11,10 @@ database: $(SPECIMENS_OK) true pushdb: - cp build/output/tile_type_*.json ${XRAY_FAMILY_DIR}/ + cp $(BUILD_DIR)/output/tile_type_*.json ${XRAY_FAMILY_DIR}/ rm ${XRAY_FAMILY_DIR}/tile_type_*_site_type_*.json - cp build/output/site_type_*.json ${XRAY_FAMILY_DIR}/ - cp build/output/tileconn.json ${XRAY_FAMILY_DIR}/$(XRAY_PART)/ + cp $(BUILD_DIR)/output/site_type_*.json ${XRAY_FAMILY_DIR}/ + cp $(BUILD_DIR)/output/tileconn.json ${XRAY_FAMILY_DIR}/$(XRAY_PART)/ $(SPECIMENS_OK): bash generate.sh $(subst /OK,,$@) -p=$(MAX_VIVADO_PROCESS) -t=$(MAX_TILES_INSTANCE) -n=$(MAX_NODES_INSTANCE) @@ -24,11 +25,11 @@ run: $(MAKE) database $(MAKE) pushdb # Clean up intermediate files after successful pushdb. - find build -name "*.json5" -delete - touch run.ok + find $(BUILD_DIR) -name "*.json5" -delete + touch run.${XRAY_PART}.ok clean: - rm -rf build run.ok + rm -rf build_* run.*.ok .PHONY: database pushdb run clean diff --git a/fuzzers/074-dump_all/generate_after_dump.sh b/fuzzers/074-dump_all/generate_after_dump.sh index 5c5bc9d9..712a7e2b 100755 --- a/fuzzers/074-dump_all/generate_after_dump.sh +++ b/fuzzers/074-dump_all/generate_after_dump.sh @@ -3,16 +3,19 @@ # By default use ~50 GiB for generate_grid.py, but allow override. export DEFAULT_MAX_GRID_CPU=10 -rm -rf build/output -mkdir -p build/output +export BUILD_DIR=build_${XRAY_PART} +rm -rf ${BUILD_DIR}/output +mkdir -p ${BUILD_DIR}/output python3 reduce_tile_types.py \ - --root_dir build/specimen_001/ \ - --output_dir build/output + --root_dir ${BUILD_DIR}/specimen_001/ \ + --output_dir ${BUILD_DIR}/output python3 create_node_tree.py \ - --dump_all_root_dir build/specimen_001/ \ - --ordered_wires_root_dir ../072-ordered_wires/build/specimen_001/ \ - --output_dir build/output -python3 reduce_site_types.py --output_dir build/output -python3 generate_grid.py --root_dir build/specimen_001/ --output_dir build/output \ + --dump_all_root_dir ${BUILD_DIR}/specimen_001/ \ + --ordered_wires_root_dir ../072-ordered_wires/${BUILD_DIR}/specimen_001/ \ + --output_dir ${BUILD_DIR}/output +python3 reduce_site_types.py --output_dir ${BUILD_DIR}/output +python3 generate_grid.py \ + --root_dir ${BUILD_DIR}/specimen_001/ \ + --output_dir ${BUILD_DIR}/output \ --ignored_wires ignored_wires/${XRAY_DATABASE}/${XRAY_PART}_ignored_wires.txt \ --max_cpu=${MAX_GRID_CPU:-${DEFAULT_MAX_GRID_CPU}} diff --git a/fuzzers/075-pins/Makefile b/fuzzers/075-pins/Makefile index 0c1bb466..299e73c5 100644 --- a/fuzzers/075-pins/Makefile +++ b/fuzzers/075-pins/Makefile @@ -1,12 +1,13 @@ N := 1 -SPECIMENS := $(addprefix build/specimen_,$(shell seq -f '%03.0f' $(N))) +BUILD_DIR = build_${XRAY_PART} +SPECIMENS := $(addprefix $(BUILD_DIR)/specimen_,$(shell seq -f '%03.0f' $(N))) SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) database: $(SPECIMENS_OK) pushdb: mkdir -p ${XRAY_FAMILY_DIR}/${XRAY_PART}/ - cp build/specimen_001/*_package_pins.csv ${XRAY_FAMILY_DIR}/${XRAY_PART}/package_pins.csv + cp $(BUILD_DIR)/specimen_001/*_package_pins.csv ${XRAY_FAMILY_DIR}/${XRAY_PART}/package_pins.csv $(SPECIMENS_OK): bash generate.sh $(subst /OK,,$@) @@ -16,9 +17,9 @@ run: $(MAKE) clean $(MAKE) database $(MAKE) pushdb - touch run.ok + touch run.$(XRAY_PART).ok clean: - rm -rf build run.ok + rm -rf build_* run.*.ok .PHONY: database pushdb run clean diff --git a/fuzzers/Makefile b/fuzzers/Makefile index fb0f29b2..7ef38090 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -23,9 +23,15 @@ define fuzzer # $(1) - Fuzzer name/directory # $(2) - Space seperated list of dependencies for the fuzzer. +# $(3) - Is this fuzzer setting specific? # Make the all target depend on the run.ok file for the fuzzer. +ifeq ($(3),Y) +all: $(1)/run.$(XRAY_PART).ok +part_only: $(1)/run.$(XRAY_PART).ok +else all: $(1)/run.ok +endif # Make the clean target run `make clean` in the fuzzer's directory. clean_fuzzers:: @@ -40,92 +46,123 @@ clean_logs:: ifeq ($(VERBOSE),Y) # When verbose we just call make directory -$(1)/run.ok: $(addsuffix /run.ok,$(2)) +ifeq ($(3),Y) + +$(1)/run.$(XRAY_PART).ok: $(addprefix fuzzer_, $(2)) $$(MAKE) -C $(1) run else +$(1)/run.ok: $(addprefix fuzzer_, $(2)) + $$(MAKE) -C $(1) run + +endif + +else + # When not verbose, we use the run_fuzzer wrapper which will save the results # to log files. -$(1)/run.ok: $(addsuffix /run.ok,$(2)) +ifeq ($(3),Y) + +$(1)/run.$(XRAY_PART).ok: $(addprefix fuzzer_, $(2)) + +@$(SELF_DIR)/run_fuzzer.py $(1) + +else + +$(1)/run.ok: $(addprefix fuzzer_, $(2)) +@$(SELF_DIR)/run_fuzzer.py $(1) endif +endif + +.PHONY:: fuzzer_$(1) + +ifeq ($(3),Y) + +fuzzer_$(1): $(1)/run.$(XRAY_PART).ok + +else + +fuzzer_$(1): $(1)/run.ok + +endif + + endef -$(eval $(call fuzzer,000-init-db,)) +$(eval $(call fuzzer,000-init-db,,Y)) ifneq ($(FUZZONLY),Y) -$(eval $(call fuzzer,001-part-yaml,000-init-db)) -$(eval $(call fuzzer,005-tilegrid,001-part-yaml)) +$(eval $(call fuzzer,001-part-yaml,000-init-db,Y)) +$(eval $(call fuzzer,005-tilegrid,001-part-yaml,Y)) else all:: 005-tilegrid/run.ok touch 005-tilegrid/run.ok endif ifneq ($(XRAY_DATABASE),kintex7) -$(eval $(call fuzzer,007-timing,005-tilegrid)) +$(eval $(call fuzzer,007-timing,005-tilegrid,N)) endif -$(eval $(call fuzzer,010-clb-lutinit,005-tilegrid)) -$(eval $(call fuzzer,011-clb-ffconfig,005-tilegrid)) -$(eval $(call fuzzer,012-clb-n5ffmux,005-tilegrid)) -$(eval $(call fuzzer,013-clb-ncy0,005-tilegrid)) -$(eval $(call fuzzer,014-clb-ffsrcemux,005-tilegrid)) -$(eval $(call fuzzer,015-clb-nffmux,005-tilegrid)) -$(eval $(call fuzzer,016-clb-noutmux,005-tilegrid)) -$(eval $(call fuzzer,017-clb-precyinit,005-tilegrid)) -$(eval $(call fuzzer,018-clb-ram,005-tilegrid)) -$(eval $(call fuzzer,019-clb-ndi1mux,005-tilegrid)) -$(eval $(call fuzzer,025-bram-config,005-tilegrid)) -$(eval $(call fuzzer,026-bram-data,005-tilegrid)) -$(eval $(call fuzzer,027-bram36-config,005-tilegrid)) -$(eval $(call fuzzer,028-fifo-config,005-tilegrid)) -$(eval $(call fuzzer,029-bram-fifo-config,005-tilegrid)) -$(eval $(call fuzzer,030-iob,005-tilegrid)) -$(eval $(call fuzzer,032-cmt-pll,005-tilegrid)) -$(eval $(call fuzzer,034-cmt-pll-pips,005-tilegrid 071-ppips)) -$(eval $(call fuzzer,035-iob-ilogic,005-tilegrid)) -$(eval $(call fuzzer,035a-iob-idelay,005-tilegrid)) -$(eval $(call fuzzer,036-iob-ologic,005-tilegrid)) -$(eval $(call fuzzer,037-iob-pips,005-tilegrid)) -$(eval $(call fuzzer,038-cfg,005-tilegrid)) -$(eval $(call fuzzer,039-hclk-config,005-tilegrid)) -$(eval $(call fuzzer,040-clk-hrow-config,005-tilegrid)) -$(eval $(call fuzzer,041-clk-hrow-pips,005-tilegrid)) -$(eval $(call fuzzer,042-clk-bufg-config,005-tilegrid)) -$(eval $(call fuzzer,043-clk-rebuf-pips,005-tilegrid)) -$(eval $(call fuzzer,044-clk-bufg-pips,046-clk-bufg-muxed-pips)) -$(eval $(call fuzzer,045-hclk-cmt-pips,005-tilegrid)) -$(eval $(call fuzzer,046-clk-bufg-muxed-pips,005-tilegrid)) -$(eval $(call fuzzer,047-hclk-ioi-pips,005-tilegrid)) -$(eval $(call fuzzer,047a-hclk-idelayctrl-pips,047-hclk-ioi-pips)) -$(eval $(call fuzzer,048-int-piplist,005-tilegrid)) -$(eval $(call fuzzer,049-int-imux-gfan,048-int-piplist)) -$(eval $(call fuzzer,050-pip-seed,048-int-piplist)) -$(eval $(call fuzzer,051-pip-imuxlout-bypalts,048-int-piplist)) -$(eval $(call fuzzer,052-pip-clkin,048-int-piplist)) -$(eval $(call fuzzer,053-pip-ctrlin,048-int-piplist)) -$(eval $(call fuzzer,054-pip-fan-alt,048-int-piplist)) -$(eval $(call fuzzer,055-pip-gnd,048-int-piplist)) -$(eval $(call fuzzer,056-pip-rem,049-int-imux-gfan 050-pip-seed 051-pip-imuxlout-bypalts 052-pip-clkin 053-pip-ctrlin 054-pip-fan-alt 055-pip-gnd 059-pip-byp-bounce)) -$(eval $(call fuzzer,057-pip-bi,056-pip-rem)) +$(eval $(call fuzzer,010-clb-lutinit,005-tilegrid,N)) +$(eval $(call fuzzer,011-clb-ffconfig,005-tilegrid,N)) +$(eval $(call fuzzer,012-clb-n5ffmux,005-tilegrid,N)) +$(eval $(call fuzzer,013-clb-ncy0,005-tilegrid,N)) +$(eval $(call fuzzer,014-clb-ffsrcemux,005-tilegrid,N)) +$(eval $(call fuzzer,015-clb-nffmux,005-tilegrid,N)) +$(eval $(call fuzzer,016-clb-noutmux,005-tilegrid,N)) +$(eval $(call fuzzer,017-clb-precyinit,005-tilegrid,N)) +$(eval $(call fuzzer,018-clb-ram,005-tilegrid,N)) +$(eval $(call fuzzer,019-clb-ndi1mux,005-tilegrid,N)) +$(eval $(call fuzzer,025-bram-config,005-tilegrid,N)) +$(eval $(call fuzzer,026-bram-data,005-tilegrid,N)) +$(eval $(call fuzzer,027-bram36-config,005-tilegrid,N)) +$(eval $(call fuzzer,028-fifo-config,005-tilegrid,N)) +$(eval $(call fuzzer,029-bram-fifo-config,005-tilegrid,N)) +$(eval $(call fuzzer,030-iob,005-tilegrid,N)) +$(eval $(call fuzzer,032-cmt-pll,005-tilegrid,N)) +$(eval $(call fuzzer,034-cmt-pll-pips,005-tilegrid 071-ppips,N)) +$(eval $(call fuzzer,035-iob-ilogic,005-tilegrid,N)) +$(eval $(call fuzzer,035a-iob-idelay,005-tilegrid,N)) +$(eval $(call fuzzer,036-iob-ologic,005-tilegrid,N)) +$(eval $(call fuzzer,037-iob-pips,005-tilegrid,N)) +$(eval $(call fuzzer,038-cfg,005-tilegrid,N)) +$(eval $(call fuzzer,039-hclk-config,005-tilegrid,N)) +$(eval $(call fuzzer,040-clk-hrow-config,005-tilegrid,N)) +$(eval $(call fuzzer,041-clk-hrow-pips,005-tilegrid,N)) +$(eval $(call fuzzer,042-clk-bufg-config,005-tilegrid,N)) +$(eval $(call fuzzer,043-clk-rebuf-pips,005-tilegrid,N)) +$(eval $(call fuzzer,044-clk-bufg-pips,046-clk-bufg-muxed-pips,N)) +$(eval $(call fuzzer,045-hclk-cmt-pips,005-tilegrid,N)) +$(eval $(call fuzzer,046-clk-bufg-muxed-pips,005-tilegrid,N)) +$(eval $(call fuzzer,047-hclk-ioi-pips,005-tilegrid,N)) +$(eval $(call fuzzer,047a-hclk-idelayctrl-pips,047-hclk-ioi-pips,N)) +$(eval $(call fuzzer,048-int-piplist,005-tilegrid,N)) +$(eval $(call fuzzer,049-int-imux-gfan,048-int-piplist,N)) +$(eval $(call fuzzer,050-pip-seed,048-int-piplist,N)) +$(eval $(call fuzzer,051-pip-imuxlout-bypalts,048-int-piplist,N)) +$(eval $(call fuzzer,052-pip-clkin,048-int-piplist,N)) +$(eval $(call fuzzer,053-pip-ctrlin,048-int-piplist,N)) +$(eval $(call fuzzer,054-pip-fan-alt,048-int-piplist,N)) +$(eval $(call fuzzer,055-pip-gnd,048-int-piplist,N)) +$(eval $(call fuzzer,056-pip-rem,049-int-imux-gfan 050-pip-seed 051-pip-imuxlout-bypalts 052-pip-clkin 053-pip-ctrlin 054-pip-fan-alt 055-pip-gnd 059-pip-byp-bounce,N)) +$(eval $(call fuzzer,057-pip-bi,056-pip-rem,N)) ifneq ($(QUICK),Y) -$(eval $(call fuzzer,058-pip-hclk,005-tilegrid)) -$(eval $(call fuzzer,059-pip-byp-bounce,048-int-piplist)) -$(eval $(call fuzzer,060-bram-cascades,005-tilegrid)) -$(eval $(call fuzzer,071-ppips,057-pip-bi 058-pip-hclk 060-bram-cascades)) +$(eval $(call fuzzer,058-pip-hclk,005-tilegrid,N)) +$(eval $(call fuzzer,059-pip-byp-bounce,048-int-piplist,N)) +$(eval $(call fuzzer,060-bram-cascades,005-tilegrid,N)) +$(eval $(call fuzzer,071-ppips,057-pip-bi 058-pip-hclk 060-bram-cascades,N)) ifneq ($(BITONLY),Y) -$(eval $(call fuzzer,072-ordered_wires,)) -$(eval $(call fuzzer,073-get_counts,)) -$(eval $(call fuzzer,074-dump_all,005-tilegrid 072-ordered_wires)) -$(eval $(call fuzzer,075-pins,)) +$(eval $(call fuzzer,072-ordered_wires,,Y)) +$(eval $(call fuzzer,073-get_counts,,Y)) +$(eval $(call fuzzer,074-dump_all,005-tilegrid 072-ordered_wires,Y)) +$(eval $(call fuzzer,075-pins,,Y)) ifeq ($(XRAY_DATABASE),zynq7) -$(eval $(call fuzzer,076-ps7,)) +$(eval $(call fuzzer,076-ps7,,N)) endif endif endif -$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid)) +$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid,N)) quick: $(MAKE) QUICK=Y @@ -133,51 +170,11 @@ quick: # Part only targets # ----------------- -$(addprefix ${XRAY_FAMILY_DIR}/${XRAY_PART}/part.,yaml json): - $(MAKE) 001-part-yaml/run.ok - -${XRAY_FAMILY_DIR}/${XRAY_PART}/package_pins.csv: - $(MAKE) 075-pins/run.ok - -${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json: - $(MAKE) 005-tilegrid/run.ok - -${XRAY_FAMILY_DIR}/${XRAY_PART}/tileconn.json: - $(MAKE) 072-ordered_wires/run.ok - $(MAKE) 073-get_counts/run.ok - $(MAKE) 074-dump_all/run.ok - -part_only_yaml: ${XRAY_FAMILY_DIR}/${XRAY_PART}/part.yaml -part_only_tilegrid: ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json -part_only_tileconn: ${XRAY_FAMILY_DIR}/${XRAY_PART}/tileconn.json -part_only_pins: ${XRAY_FAMILY_DIR}/${XRAY_PART}/package_pins.csv - -# part_only runs the fuzzers required to support additional parts -part_only: - +$(MAKE) clean_fuzzers - # Create PART-specific directory - mkdir -p ${XRAY_FAMILY_DIR}/${XRAY_PART} - # Generate YAML - +$(MAKE) part_only_yaml - # Generate Tile grid - +$(MAKE) part_only_tilegrid - # Generate Tile connections - +$(MAKE) part_only_tileconn - # Generate package pins - +$(MAKE) part_only_pins - # roi_only runs the fuzzers required for supporting additional parts when building # a roi harness. -roi_only: - +$(MAKE) clean_fuzzers - # Create PART-specific directory - mkdir -p ${XRAY_FAMILY_DIR}/${XRAY_PART} - # Generate YAML - +$(MAKE) part_only_yaml - # Generate package pins - +$(MAKE) part_only_pins +roi_only: 000-init-db/run.${XRAY_PART}.ok 001-part-yaml/run.${XRAY_PART}.ok 075-pins/run.${XRAY_PART}.ok # Copy tilegrid and tileconn cp ${XRAY_FAMILY_DIR}/${XRAY_EQUIV_PART}/tilegrid.json ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json cp ${XRAY_FAMILY_DIR}/${XRAY_EQUIV_PART}/tileconn.json ${XRAY_FAMILY_DIR}/${XRAY_PART}/tileconn.json -.PHONY: all clean clean_fuzzers clean_logs quick part_only roi_only +.PHONY:: all clean clean_fuzzers clean_logs quick part_only roi_only diff --git a/minitests/roi_harness/Makefile b/minitests/roi_harness/Makefile index 36aed8f5..5eb613da 100644 --- a/minitests/roi_harness/Makefile +++ b/minitests/roi_harness/Makefile @@ -1,28 +1,28 @@ -BUILD_DIR=build -HARNESS_DIR ?= harness -export BUILD_DIR - XRAY_PINCFG ?= BASYS3-SWBUT export XRAY_PINCFG +BUILD_DIR=build_$(XRAY_PINCFG) +HARNESS_DIR ?= harness_$(XRAY_PINCFG) +export BUILD_DIR + HARNESS_FILES=$(BUILD_DIR)/design.bit $(BUILD_DIR)/design.txt $(BUILD_DIR)/design.json $(BUILD_DIR)/design.dcp # official demo configuration -all: $(HARNESS_FILES) +all: $(BUILD_DIR)/run.ok -$(HARNESS_FILES): runme.sh runme.tcl +$(BUILD_DIR)/run.ok: runme.sh runme.tcl ./runme.sh + touch $(BUILD_DIR)/run.ok -copy: $(HARNESS_FILES) +copy: $(BUILD_DIR)/run.ok mkdir -p $(HARNESS_DIR) cp $(HARNESS_FILES) $(HARNESS_DIR) clean: - rm -rf $(BUILD_DIR) $(HARNESS_DIR) + rm -rf build_* harness_* run: make clean make copy .PHONY: all clean copy run - From 80add259ed4fa36c07bd9d43b24e808c138ac541 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 10:24:49 -0800 Subject: [PATCH 20/41] Fix some parallelism issues. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .gitignore | 2 +- Makefile | 1 - fuzzers/run_fuzzer.py | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c33ccb73..eb75f580 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ env build build_* -logs +logs_* database .Xil **/specimen_* diff --git a/Makefile b/Makefile index cdfbba14..dae7940f 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,6 @@ db-format-$(1): @if [ -e database/Info.md ]; then $(IN_ENV) ./utils/info_md.py --keep; fi .PHONY: db-$(1) db-check-$(1) db-format-$(1) db-extras-$(1) db-extras-$(1)-parts db-extras-$(1)-harness -.NOTPARALLEL: db-check-$(1) db-format-$(1) db-extras-$(1): db-extras-$(1)-parts db-extras-$(1)-harness diff --git a/fuzzers/run_fuzzer.py b/fuzzers/run_fuzzer.py index aedc253d..22b1863e 100755 --- a/fuzzers/run_fuzzer.py +++ b/fuzzers/run_fuzzer.py @@ -429,7 +429,8 @@ def main(argv): fuzzer_dir = os.path.join(fuzzers_dir, args.fuzzer) assert os.path.exists(fuzzer_dir), fuzzer_dir - fuzzer_logdir = os.path.join(fuzzer_dir, "logs") + fuzzer_logdir = os.path.join( + fuzzer_dir, "logs_{}".format(os.environ['XRAY_PART'])) if not os.path.exists(fuzzer_logdir): os.makedirs(fuzzer_logdir) assert os.path.exists(fuzzer_logdir) From f4fd84625fcc8904f210f7b6666ddfe8215a4501 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:00:06 -0800 Subject: [PATCH 21/41] Add part to run_fuzzer output. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/run_fuzzer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fuzzers/run_fuzzer.py b/fuzzers/run_fuzzer.py index 22b1863e..e3fb7a18 100755 --- a/fuzzers/run_fuzzer.py +++ b/fuzzers/run_fuzzer.py @@ -126,8 +126,11 @@ class Logger: running_for = time_log - self.time_start msg = msg.format(*args, **kw) - log_prefix = "{:s} - {:s} - {:>5s}: ".format( + time_log = time_log.replace(microsecond=0) + + log_prefix = "{:s} - {}/{:s} - {:>5s}: ".format( time_log.isoformat(), + os.environ['XRAY_PART'], self.fuzzer, pretty_timedelta_str(running_for), ) From ec6b1aa02dcb294821cc0818acb7c1e93b14d6cf Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:03:18 -0800 Subject: [PATCH 22/41] Fix some typo's. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- Makefile | 2 -- fuzzers/000-init-db/Makefile | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dae7940f..18602ab5 100644 --- a/Makefile +++ b/Makefile @@ -189,8 +189,6 @@ db-extras-artix7-harness: +source minitests/roi_harness/arty-swbut.sh && \ $(MAKE) -C minitests/roi_harness \ HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/swbut run copy - +XRAY_PIN_00=J13 XRAY_PIN_01=J14 XRAY_PIN_02=K15 XRAY_PIN_03=K16 \ - XRAY_PART=xc7a35tftg256-1 XRAY_EQUIV_PART=xc7a50tfgg484-1 $(MAKE) -C fuzzers roi_only db-extras-kintex7-parts: @true diff --git a/fuzzers/000-init-db/Makefile b/fuzzers/000-init-db/Makefile index 849adebd..f4ef08d3 100644 --- a/fuzzers/000-init-db/Makefile +++ b/fuzzers/000-init-db/Makefile @@ -58,7 +58,7 @@ DB_FILES_PATH=$(addprefix $(XRAY_DATABASE_DIR)/$(XRAY_DATABASE)/,$(DB_FILES)) BUILD_DIR = build_${XRAY_PART} check: - @mkdir -p build_ + @mkdir -p $(BUILD_DIR) @rm -f $(BUILD_DIR)/existing.txt @for DB_FILE in $(sort $(notdir $(wildcard $(XRAY_DATABASE_DIR)/$(XRAY_DATABASE)/*.db))); do \ echo $$DB_FILE >> $(BUILD_DIR)/existing.txt; \ From 3aeb1f120ac0c35899c611b2c154e04fa391954f Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:04:36 -0800 Subject: [PATCH 23/41] Also clean log directories. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/Makefile b/fuzzers/Makefile index 7ef38090..c9566a1c 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -38,7 +38,7 @@ clean_fuzzers:: $$(MAKE) -C $(1) clean clean_logs:: - rm -rf $(1)/logs + rm -rf $(1)/logs_* # Describe how to create the fuzzer's run.ok file. # This command must start with a + to tell make to pass the jobserver From 907a9ee72ea40b5b9a5b90eb567fccda8dd13770 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:24:13 -0800 Subject: [PATCH 24/41] Pass MAKEFLAGS to children. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- minitests/roi_harness/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minitests/roi_harness/Makefile b/minitests/roi_harness/Makefile index 5eb613da..b7a4d040 100644 --- a/minitests/roi_harness/Makefile +++ b/minitests/roi_harness/Makefile @@ -22,7 +22,7 @@ clean: rm -rf build_* harness_* run: - make clean - make copy + +$(MAKE) clean + +$(MAKE) copy .PHONY: all clean copy run From 6bace67abf97810fe4a1b809496bda8ab9af9341 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:24:54 -0800 Subject: [PATCH 25/41] Don't double build the harnesses. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 18602ab5..5a93e0bf 100644 --- a/Makefile +++ b/Makefile @@ -175,20 +175,20 @@ db-extras-artix7-harness: +source minitests/roi_harness/arty-uart.sh && $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/basys3-swbut.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut run copy + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut run +source minitests/roi_harness/basys3-swbut.sh && \ $(MAKE) -C minitests/roi_harness \ XRAY_ROIV=../roi_base_div2.v \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut_50 copy + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut_50 run +source minitests/roi_harness/arty-uart.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/uart run copy + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/uart run +source minitests/roi_harness/arty-pmod.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/pmod run copy + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/pmod run +source minitests/roi_harness/arty-swbut.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/swbut run copy + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/swbut run db-extras-kintex7-parts: @true From 63ab362d2ac5dd6f2dece3fc26c2d17e6f36bb64 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:25:14 -0800 Subject: [PATCH 26/41] Fix clean step update for 073. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/073-get_counts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/073-get_counts/Makefile b/fuzzers/073-get_counts/Makefile index 1b7fcab7..73795866 100644 --- a/fuzzers/073-get_counts/Makefile +++ b/fuzzers/073-get_counts/Makefile @@ -21,7 +21,7 @@ run: touch run.${XRAY_PART}.ok clean: - rm -rf build_* run.${XRAY_PART}.ok + rm -rf build_* run.*.ok .PHONY: database pushdb run clean From d6e4c28323f438a264758a1a4a9576e32d8f53eb Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:26:22 -0800 Subject: [PATCH 27/41] Report full untruncated log upon failure. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/run_fuzzer.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/fuzzers/run_fuzzer.py b/fuzzers/run_fuzzer.py index e3fb7a18..ff6541a4 100755 --- a/fuzzers/run_fuzzer.py +++ b/fuzzers/run_fuzzer.py @@ -622,14 +622,23 @@ def run_fuzzer(fuzzer_name, fuzzer_dir, fuzzer_logdir, logger, will_retry): # Log the last 10,000 lines of stderr on a failure log( """\ -Failed @ {time_end} with exit code: {retcode} -------------------------------------------------------------------------- -{error_log} +!Failed! @ {time_end} with exit code: {retcode} +-------------------------------------------------------------------------- +- STDOUT: - +-------------------------------------------------------------------------- +{stdout_log} +-------------------------------------------------------------------------- +- STDERR: - +-------------------------------------------------------------------------- +{stderr_log} +-------------------------------------------------------------------------- +!Failed! @ {time_end} with exit code: {retcode} -------------------------------------------------------------------------- -Failed @ {time_end} with exit code: {retcode} """, retcode=retcode, - error_log=error_log, + stdout_log=open(fuzzer_stdout).read(), + stderr_log=open(fuzzer_stderr).read(), time_end=time_end.isoformat()) else: # Log the last 100 lines of a successful run From 850d16fa02aac3693bd0b89a5eaac2b2e5fd3183 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 11:53:01 -0800 Subject: [PATCH 28/41] Don't clobber other parts build directories on run target. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/000-init-db/Makefile | 2 +- fuzzers/001-part-yaml/Makefile | 5 ++--- fuzzers/005-tilegrid/Makefile | 3 ++- fuzzers/005-tilegrid/fuzzaddr/common.mk | 2 +- fuzzers/072-ordered_wires/Makefile | 5 +++-- fuzzers/073-get_counts/Makefile | 2 +- fuzzers/074-dump_all/Makefile | 2 +- fuzzers/075-pins/Makefile | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/fuzzers/000-init-db/Makefile b/fuzzers/000-init-db/Makefile index f4ef08d3..64f6a51f 100644 --- a/fuzzers/000-init-db/Makefile +++ b/fuzzers/000-init-db/Makefile @@ -91,7 +91,7 @@ pushdb: $(DB_FILES_PATH) ${XRAY_FAMILY_DIR}/${XRAY_PART} @true run: - $(MAKE) clean + rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok $(MAKE) pushdb touch run.${XRAY_PART}.ok diff --git a/fuzzers/001-part-yaml/Makefile b/fuzzers/001-part-yaml/Makefile index 2cd79e3c..bf90aa97 100644 --- a/fuzzers/001-part-yaml/Makefile +++ b/fuzzers/001-part-yaml/Makefile @@ -1,7 +1,6 @@ N := 1 -SPECIMENS := $(addprefix build_${XRAY_PART}/specimen_,$(shell seq -f '%03.0f' $(N))) - BUILD_DIR = build_${XRAY_PART} +SPECIMENS := $(addprefix $(BUILD_DIR)/specimen_,$(shell seq -f '%03.0f' $(N))) database: $(SPECIMENS) mkdir -p $(BUILD_DIR) @@ -21,7 +20,7 @@ pushdb: cp $(BUILD_DIR)/${XRAY_PART}_required_features.fasm ${XRAY_FAMILY_DIR}/${XRAY_PART}/required_features.fasm 2>/dev/null || true run: - $(MAKE) clean + rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok $(MAKE) database $(MAKE) pushdb touch run.${XRAY_PART}.ok diff --git a/fuzzers/005-tilegrid/Makefile b/fuzzers/005-tilegrid/Makefile index 81959b4c..a02bba5c 100644 --- a/fuzzers/005-tilegrid/Makefile +++ b/fuzzers/005-tilegrid/Makefile @@ -133,7 +133,8 @@ $(BUILD_FOLDER)/tilegrid.json: generate_full.py $(BUILD_FOLDER)/tilegrid_tdb.jso cd $(BUILD_FOLDER) && python3 ${FUZDIR}/generate_full.py \ --json-in tilegrid_tdb.json --json-out ${BUILD_DIR}/tilegrid.json run: - $(MAKE) clean + find -name $(BUILD_FOLDER) -exec rm -rf {} \; + find -name run.${XRAY_PART}.ok -delete $(MAKE) database $(MAKE) pushdb touch run.${XRAY_PART}.ok diff --git a/fuzzers/005-tilegrid/fuzzaddr/common.mk b/fuzzers/005-tilegrid/fuzzaddr/common.mk index f54efa78..016191d9 100644 --- a/fuzzers/005-tilegrid/fuzzaddr/common.mk +++ b/fuzzers/005-tilegrid/fuzzaddr/common.mk @@ -14,7 +14,7 @@ $(SPECIMENS_OK): touch $@ run: - $(MAKE) clean + rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok $(MAKE) database $(MAKE) pushdb touch run.${XRAY_PART}.ok diff --git a/fuzzers/072-ordered_wires/Makefile b/fuzzers/072-ordered_wires/Makefile index 49682145..bbdc30b9 100644 --- a/fuzzers/072-ordered_wires/Makefile +++ b/fuzzers/072-ordered_wires/Makefile @@ -1,6 +1,7 @@ N := 1 -SPECIMENS := $(addprefix build_${XRAY_PART}/specimen_,$(shell seq -f '%03.0f' $(N))) +BUILD_DIR = build_${XRAY_PART} +SPECIMENS := $(addprefix $(BUILD_DIR)/specimen_,$(shell seq -f '%03.0f' $(N))) SPECIMENS_OK := $(addsuffix /OK,$(SPECIMENS)) MAX_VIVADO_PROCESS ?= 4 MAX_PIPS_INSTANCE ?= 340000 @@ -16,7 +17,7 @@ $(SPECIMENS_OK): touch $@ run: - $(MAKE) clean + rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok $(MAKE) database $(MAKE) pushdb touch run.${XRAY_PART}.ok diff --git a/fuzzers/073-get_counts/Makefile b/fuzzers/073-get_counts/Makefile index 73795866..37b8cdb6 100644 --- a/fuzzers/073-get_counts/Makefile +++ b/fuzzers/073-get_counts/Makefile @@ -15,7 +15,7 @@ $(SPECIMENS_OK): touch $@ run: - $(MAKE) clean + rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok $(MAKE) database $(MAKE) pushdb touch run.${XRAY_PART}.ok diff --git a/fuzzers/074-dump_all/Makefile b/fuzzers/074-dump_all/Makefile index 9d3850c5..01c07b9e 100644 --- a/fuzzers/074-dump_all/Makefile +++ b/fuzzers/074-dump_all/Makefile @@ -21,7 +21,7 @@ $(SPECIMENS_OK): touch $@ run: - $(MAKE) clean + rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok $(MAKE) database $(MAKE) pushdb # Clean up intermediate files after successful pushdb. diff --git a/fuzzers/075-pins/Makefile b/fuzzers/075-pins/Makefile index 299e73c5..6471fc6d 100644 --- a/fuzzers/075-pins/Makefile +++ b/fuzzers/075-pins/Makefile @@ -14,7 +14,7 @@ $(SPECIMENS_OK): touch $@ run: - $(MAKE) clean + rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok $(MAKE) database $(MAKE) pushdb touch run.$(XRAY_PART).ok From 32833e6f93b4cd72b3692f71b4c338cda483510f Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 12:47:17 -0800 Subject: [PATCH 29/41] Add diagnostic to find 005 instability. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/005-tilegrid/add_tdb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fuzzers/005-tilegrid/add_tdb.py b/fuzzers/005-tilegrid/add_tdb.py index e526f38d..f185259a 100644 --- a/fuzzers/005-tilegrid/add_tdb.py +++ b/fuzzers/005-tilegrid/add_tdb.py @@ -37,6 +37,7 @@ def load_db(fn): parts = l.split(' ') tagstr = parts[0] addrlist = parts[1:] + assert not any(s == '' for s in addrlist), (fn, l) check_frames(tagstr, addrlist) # Take the first address in the list frame, wordidx, bitidx = parse_addr(addrlist[0]) From 6a50598cdc430f426fa8dbf07dea7db052cb9327 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 13:02:34 -0800 Subject: [PATCH 30/41] Sort tilegrid_tdb.json for better debugging. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/005-tilegrid/add_tdb.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fuzzers/005-tilegrid/add_tdb.py b/fuzzers/005-tilegrid/add_tdb.py index f185259a..974a59e2 100644 --- a/fuzzers/005-tilegrid/add_tdb.py +++ b/fuzzers/005-tilegrid/add_tdb.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +from prjxray import xjson import json import util as localutil import os.path @@ -116,12 +117,9 @@ def run(fn_in, fn_out, verbose=False): localutil.add_tile_bits(tile, tilej, frame, wordidx, frames, words) # Save - json.dump( - database, + xjson.pprint( open(fn_out, "w"), - sort_keys=True, - indent=4, - separators=(",", ": ")) + database) def main(): From 61d4a43b3f08c09f07aa0d18c4ca3125d1b18400 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 13:02:59 -0800 Subject: [PATCH 31/41] Remove some unused targets from fuzzaddr/common.mk Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/005-tilegrid/fuzzaddr/common.mk | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fuzzers/005-tilegrid/fuzzaddr/common.mk b/fuzzers/005-tilegrid/fuzzaddr/common.mk index 016191d9..4218f803 100644 --- a/fuzzers/005-tilegrid/fuzzaddr/common.mk +++ b/fuzzers/005-tilegrid/fuzzaddr/common.mk @@ -13,14 +13,8 @@ $(SPECIMENS_OK): GENERATE_ARGS=${GENERATE_ARGS} bash ../fuzzaddr/generate.sh $(subst /OK,,$@) touch $@ -run: - rm -rf $(BUILD_DIR) run.${XRAY_PART}.ok - $(MAKE) database - $(MAKE) pushdb - touch run.${XRAY_PART}.ok - clean: - rm -rf build_* run.*.ok + rm -rf build_* -.PHONY: database pushdb run clean +.PHONY: database clean From e626994d4d6af3f53ca0ced4f1e0a6dab192768c Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 13:03:25 -0800 Subject: [PATCH 32/41] Add some samples for cfg_int to remove discrepancies. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/005-tilegrid/cfg_int/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzers/005-tilegrid/cfg_int/Makefile b/fuzzers/005-tilegrid/cfg_int/Makefile index e583d848..e073f312 100644 --- a/fuzzers/005-tilegrid/cfg_int/Makefile +++ b/fuzzers/005-tilegrid/cfg_int/Makefile @@ -1,3 +1,3 @@ -N ?= 4 +N ?= 10 GENERATE_ARGS?="--oneval 0 --design params.csv --dframe 15 --dword 0" include ../fuzzaddr/common.mk From bc00250f90ea60c3e09a5065302c5a1f62f58b0d Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 13:07:57 -0800 Subject: [PATCH 33/41] Run make format. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/005-tilegrid/add_tdb.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fuzzers/005-tilegrid/add_tdb.py b/fuzzers/005-tilegrid/add_tdb.py index 974a59e2..45875463 100644 --- a/fuzzers/005-tilegrid/add_tdb.py +++ b/fuzzers/005-tilegrid/add_tdb.py @@ -117,9 +117,7 @@ def run(fn_in, fn_out, verbose=False): localutil.add_tile_bits(tile, tilej, frame, wordidx, frames, words) # Save - xjson.pprint( - open(fn_out, "w"), - database) + xjson.pprint(open(fn_out, "w"), database) def main(): From ceb5b2679bb6a443ffdec6f30caaf5c59efe6059 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 15:23:44 -0800 Subject: [PATCH 34/41] Increase MAX_VIVADO_PROCESS to use more of available memory. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .github/kokoro/db-full.sh | 7 ------- .github/kokoro/steps/hostinfo.sh | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/kokoro/db-full.sh b/.github/kokoro/db-full.sh index c3d41152..0512391d 100755 --- a/.github/kokoro/db-full.sh +++ b/.github/kokoro/db-full.sh @@ -44,13 +44,6 @@ echo "----------------------------------------" echo "----------------------------------------" # Run the fuzzers - # - # Cap MAX_VIVADO_PROCESS at 20 to limit memory usage of 074 fuzzer. - # At MAX_VIVADO_PROCESS=20: - # - 072 completes in ~35 minutes - # - 074 completes in ~60 minutes - # which is well before the 05x INT fuzzers complete. - export MAX_VIVADO_PROCESS=$((CORES/2 < 20 ? CORES/2 : 20)) set -x +e tmp=`mktemp` script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$MAX_VIVADO_PROCESS db-${XRAY_SETTINGS}-all" $tmp diff --git a/.github/kokoro/steps/hostinfo.sh b/.github/kokoro/steps/hostinfo.sh index b0042f8a..f55cb432 100755 --- a/.github/kokoro/steps/hostinfo.sh +++ b/.github/kokoro/steps/hostinfo.sh @@ -24,8 +24,9 @@ export MEM_GB=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo)/(1024*1024))) echo "Total Memory (GB): $MEM_GB" # Approx memory per grid process -export MEM_PER_GRID=8 +export MEM_PER_RUN=8 export MAX_CPU_PER_GRID=$(($MEM_GB/$MEM_PER_RUN)) +export MAX_VIVADO_PROCESS=$(($MEM_GB/$MEM_PER_RUN)) echo echo "========================================" From 1f22d60160e6850b7948a927f96a7c275e4bf94a Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 18:47:17 -0800 Subject: [PATCH 35/41] Fix up Makefile dependences. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- Makefile | 10 +++++----- fuzzers/Makefile | 27 ++++++++++++++++++--------- minitests/roi_harness/Makefile | 5 ++++- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 5a93e0bf..915ed776 100644 --- a/Makefile +++ b/Makefile @@ -175,20 +175,20 @@ db-extras-artix7-harness: +source minitests/roi_harness/arty-uart.sh && $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/basys3-swbut.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut run + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut copy +source minitests/roi_harness/basys3-swbut.sh && \ $(MAKE) -C minitests/roi_harness \ XRAY_ROIV=../roi_base_div2.v \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut_50 run + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/basys3/swbut_50 copy +source minitests/roi_harness/arty-uart.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/uart run + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/uart copy +source minitests/roi_harness/arty-pmod.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/pmod run + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/pmod copy +source minitests/roi_harness/arty-swbut.sh && \ $(MAKE) -C minitests/roi_harness \ - HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/swbut run + HARNESS_DIR=$(XRAY_DATABASE_DIR)/artix7/harness/arty-a7/swbut copy db-extras-kintex7-parts: @true diff --git a/fuzzers/Makefile b/fuzzers/Makefile index c9566a1c..dd4cb8c2 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -19,6 +19,12 @@ clean_locks: clean_piplists: rm -rf $(XRAY_FUZZERS_DIR)/piplist/build +fuzzer_ok: + mkdir -p fuzzer_ok + +clean_fuzzers:: + rm -rf fuzzer_ok + define fuzzer # $(1) - Fuzzer name/directory @@ -48,12 +54,12 @@ ifeq ($(VERBOSE),Y) # When verbose we just call make directory ifeq ($(3),Y) -$(1)/run.$(XRAY_PART).ok: $(addprefix fuzzer_, $(2)) +$(1)/run.$(XRAY_PART).ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) $$(MAKE) -C $(1) run else -$(1)/run.ok: $(addprefix fuzzer_, $(2)) +$(1)/run.ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) $$(MAKE) -C $(1) run endif @@ -64,30 +70,33 @@ else # to log files. ifeq ($(3),Y) -$(1)/run.$(XRAY_PART).ok: $(addprefix fuzzer_, $(2)) +$(1)/run.$(XRAY_PART).ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) +@$(SELF_DIR)/run_fuzzer.py $(1) else -$(1)/run.ok: $(addprefix fuzzer_, $(2)) +$(1)/run.ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) +@$(SELF_DIR)/run_fuzzer.py $(1) endif endif -.PHONY:: fuzzer_$(1) - ifeq ($(3),Y) -fuzzer_$(1): $(1)/run.$(XRAY_PART).ok +fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.$(XRAY_PART).ok fuzzer_ok + touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok else -fuzzer_$(1): $(1)/run.ok +fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.ok fuzzer_ok + touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok endif +.PHONY: fuzzer_$(1) + +fuzzer_$(1): fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok endef @@ -177,4 +186,4 @@ roi_only: 000-init-db/run.${XRAY_PART}.ok 001-part-yaml/run.${XRAY_PART}.ok 075- cp ${XRAY_FAMILY_DIR}/${XRAY_EQUIV_PART}/tilegrid.json ${XRAY_FAMILY_DIR}/${XRAY_PART}/tilegrid.json cp ${XRAY_FAMILY_DIR}/${XRAY_EQUIV_PART}/tileconn.json ${XRAY_FAMILY_DIR}/${XRAY_PART}/tileconn.json -.PHONY:: all clean clean_fuzzers clean_logs quick part_only roi_only +.PHONY: all clean clean_fuzzers clean_logs quick part_only roi_only diff --git a/minitests/roi_harness/Makefile b/minitests/roi_harness/Makefile index b7a4d040..ac6a9f70 100644 --- a/minitests/roi_harness/Makefile +++ b/minitests/roi_harness/Makefile @@ -14,9 +14,12 @@ $(BUILD_DIR)/run.ok: runme.sh runme.tcl ./runme.sh touch $(BUILD_DIR)/run.ok -copy: $(BUILD_DIR)/run.ok +$(BUILD_DIR)/copy.ok: $(BUILD_DIR)/run.ok mkdir -p $(HARNESS_DIR) cp $(HARNESS_FILES) $(HARNESS_DIR) + touch $(BUILD_DIR)/copy.ok + +copy: $(BUILD_DIR)/copy.ok clean: rm -rf build_* harness_* From cf463419bfecbd1b89a6596cff330f0711b326bf Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 18 Feb 2020 18:47:51 -0800 Subject: [PATCH 36/41] Set MAX_GRID_CPU to increase 074 speed. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .github/kokoro/steps/hostinfo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/kokoro/steps/hostinfo.sh b/.github/kokoro/steps/hostinfo.sh index f55cb432..bd84e9d8 100755 --- a/.github/kokoro/steps/hostinfo.sh +++ b/.github/kokoro/steps/hostinfo.sh @@ -25,7 +25,7 @@ echo "Total Memory (GB): $MEM_GB" # Approx memory per grid process export MEM_PER_RUN=8 -export MAX_CPU_PER_GRID=$(($MEM_GB/$MEM_PER_RUN)) +export MAX_GRID_CPU=$(($MEM_GB/$MEM_PER_RUN)) export MAX_VIVADO_PROCESS=$(($MEM_GB/$MEM_PER_RUN)) echo From fabae5eb64c218e5506b7c794c3e5155841396a5 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 19 Feb 2020 06:19:26 -0800 Subject: [PATCH 37/41] Fix some bugs in makefile work tracking. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .github/kokoro/db-full.sh | 14 -------------- fuzzers/Makefile | 4 ++-- fuzzers/run_fuzzer.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/kokoro/db-full.sh b/.github/kokoro/db-full.sh index 0512391d..271dc4dc 100755 --- a/.github/kokoro/db-full.sh +++ b/.github/kokoro/db-full.sh @@ -60,20 +60,6 @@ echo "----------------------------------------" rm $tmp exit $DATABASE_RET fi - - # Check there is nothing to do after running... - echo - if [ $(make --dry-run | grep -v 'Nothing to be done' | wc -l) -gt 0 ]; then - echo "The following targets need to still run!" - make --dry-run - echo "----------------------------------------" - echo "Debug output on why they still need to run" - make --dry-run --debug - echo "----------------------------------------" - exit 1 - else - echo "All good, nothing more to do!" - fi ) echo "----------------------------------------" diff --git a/fuzzers/Makefile b/fuzzers/Makefile index dd4cb8c2..bc216696 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -84,12 +84,12 @@ endif ifeq ($(3),Y) -fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.$(XRAY_PART).ok fuzzer_ok +fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.$(XRAY_PART).ok | fuzzer_ok touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok else -fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.ok fuzzer_ok +fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.ok | fuzzer_ok touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok endif diff --git a/fuzzers/run_fuzzer.py b/fuzzers/run_fuzzer.py index ff6541a4..70870d9d 100755 --- a/fuzzers/run_fuzzer.py +++ b/fuzzers/run_fuzzer.py @@ -466,6 +466,17 @@ def run_fuzzer(fuzzer_name, fuzzer_dir, fuzzer_logdir, logger, will_retry): if not should_run_submake(make_flags): return 0 + fuzzer_runok = os.path.join( + fuzzer_dir, "run.{}.ok".format(os.environ['XRAY_PART'])) + if os.path.exists(fuzzer_runok): + last_modified = datetime.fromtimestamp(os.stat(fuzzer_runok).st_mtime) + + log( + "Skipping as run.{}.ok exists (updated @ {})", + os.environ['XRAY_PART'], last_modified.isoformat()) + + return 0 + fuzzer_runok = os.path.join(fuzzer_dir, "run.ok") if os.path.exists(fuzzer_runok): last_modified = datetime.fromtimestamp(os.stat(fuzzer_runok).st_mtime) From 9d9fc20d380c62818629ea8aa46b83381bed906b Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 19 Feb 2020 16:28:32 -0800 Subject: [PATCH 38/41] Add xc7a200tsbg484-1 extra data. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 915ed776..9e1a3b31 100644 --- a/Makefile +++ b/Makefile @@ -171,6 +171,10 @@ db-extras-artix7-parts: $(addprefix db-part-only-,$(ARTIX_PARTS)) db-extras-artix7-harness: +XRAY_PIN_00=J13 XRAY_PIN_01=J14 XRAY_PIN_02=K15 XRAY_PIN_03=K16 \ XRAY_PART=xc7a35tftg256-1 XRAY_EQUIV_PART=xc7a50tfgg484-1 $(MAKE) -C fuzzers roi_only + +source settings/artix200t.sh && \ + XRAY_PIN_00=V10 XRAY_PIN_01=W10 XRAY_PIN_02=Y11 XRAY_PIN_03=Y12 \ + XRAY_PART=xc7a200tsbg484-1 XRAY_EQUIV_PART=xc7a200tffg1156-1 \ + $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/basys3-swbut.sh && $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/arty-uart.sh && $(MAKE) -C fuzzers roi_only +source minitests/roi_harness/basys3-swbut.sh && \ From 44eb914f8d6334387eb102e85abf0c0f2b9d00d5 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 19 Feb 2020 16:28:58 -0800 Subject: [PATCH 39/41] Fill holes in excluded part of grid. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/005-tilegrid/generate.py | 42 +++++++++++++++++-------- fuzzers/005-tilegrid/generate_tiles.tcl | 6 +--- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/fuzzers/005-tilegrid/generate.py b/fuzzers/005-tilegrid/generate.py index 67037f37..099cea33 100644 --- a/fuzzers/005-tilegrid/generate.py +++ b/fuzzers/005-tilegrid/generate.py @@ -5,7 +5,7 @@ from utils import xjson def load_tiles(tiles_fn): ''' - "$type $tile $grid_x $grid_y $typed_sites" + "$type $tile $grid_x $grid_y $skip_tile $clock_region $typed_sites" typed_sites: foreach t $site_types s $sites ''' tiles = list() @@ -14,26 +14,42 @@ def load_tiles(tiles_fn): for line in f: # CLBLM_L CLBLM_L_X10Y98 30 106 SLICEL SLICE_X13Y98 SLICEM SLICE_X12Y98 record = line.split() - tile_type, tile_name, grid_x, grid_y = record[0:4] + tile_type, tile_name, grid_x, grid_y, skip_tile = record[0:5] grid_x, grid_y = int(grid_x), int(grid_y) + skip_tile = int(skip_tile) != 0 sites = {} clock_region = None - if len(record) >= 5: - clock_region = record[4] + if len(record) >= 6: + clock_region = record[5] if clock_region == "NA": clock_region = None - for i in range(5, len(record), 2): + for i in range(6, len(record), 2): site_type, site_name = record[i:i + 2] sites[site_name] = site_type - tile = { - 'type': tile_type, - 'name': tile_name, - 'grid_x': grid_x, - 'grid_y': grid_y, - 'sites': sites, - 'clock_region': clock_region, - } + if not skip_tile: + tile = { + 'type': tile_type, + 'name': tile_name, + 'grid_x': grid_x, + 'grid_y': grid_y, + 'sites': sites, + 'clock_region': clock_region, + } + else: + # Replace tiles within the exclude_roi with NULL tiles to + # ensure no gaps in the tilegrid. + # + # The name will reflect the original tile. + tile = { + 'type': 'NULL', + 'name': tile_name, + 'grid_x': grid_x, + 'grid_y': grid_y, + 'sites': {}, + 'clock_region': clock_region, + } + tiles.append(tile) return tiles diff --git a/fuzzers/005-tilegrid/generate_tiles.tcl b/fuzzers/005-tilegrid/generate_tiles.tcl index bdfb4304..251b359c 100644 --- a/fuzzers/005-tilegrid/generate_tiles.tcl +++ b/fuzzers/005-tilegrid/generate_tiles.tcl @@ -26,10 +26,6 @@ proc write_tiles_txt {} { } } - if { $skip_tile == 1 } { - continue - } - set typed_sites {} set clock_region "NA" @@ -51,7 +47,7 @@ proc write_tiles_txt {} { } - puts $fp "$type $tile $grid_x $grid_y $clock_region $typed_sites" + puts $fp "$type $tile $grid_x $grid_y $skip_tile $clock_region $typed_sites" } close $fp_pin close $fp From 22e1a8f7c30bb7ceda520f19c9a38bb5bca89f98 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 19 Feb 2020 16:31:15 -0800 Subject: [PATCH 40/41] Refactor how part specific for part generic fuzzers are marked. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/Makefile | 153 ++++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 88 deletions(-) diff --git a/fuzzers/Makefile b/fuzzers/Makefile index bc216696..c880ed24 100644 --- a/fuzzers/Makefile +++ b/fuzzers/Makefile @@ -29,10 +29,10 @@ define fuzzer # $(1) - Fuzzer name/directory # $(2) - Space seperated list of dependencies for the fuzzer. -# $(3) - Is this fuzzer setting specific? +# $(3) - Is this fuzzer setting specific? Should be either "part" or "all" # Make the all target depend on the run.ok file for the fuzzer. -ifeq ($(3),Y) +ifeq ($(3),part) all: $(1)/run.$(XRAY_PART).ok part_only: $(1)/run.$(XRAY_PART).ok else @@ -49,50 +49,27 @@ clean_logs:: # Describe how to create the fuzzer's run.ok file. # This command must start with a + to tell make to pass the jobserver # parameters downwards. -ifeq ($(VERBOSE),Y) - -# When verbose we just call make directory -ifeq ($(3),Y) +ifeq ($(3),part) $(1)/run.$(XRAY_PART).ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) - $$(MAKE) -C $(1) run - else - $(1)/run.ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) - $$(MAKE) -C $(1) run - endif - +ifeq ($(VERBOSE),Y) +# When verbose we just call make directory + $$(MAKE) -C $(1) run else - # When not verbose, we use the run_fuzzer wrapper which will save the results # to log files. -ifeq ($(3),Y) - -$(1)/run.$(XRAY_PART).ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) +@$(SELF_DIR)/run_fuzzer.py $(1) - -else - -$(1)/run.ok: $(addsuffix _$(XRAY_PART).ok,$(addprefix fuzzer_ok/fuzzer_, $(2))) - +@$(SELF_DIR)/run_fuzzer.py $(1) - endif -endif - -ifeq ($(3),Y) - +ifeq ($(3),part) fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.$(XRAY_PART).ok | fuzzer_ok - touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok - else - fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok: $(1)/run.ok | fuzzer_ok - touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok - endif + touch fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok .PHONY: fuzzer_$(1) @@ -100,78 +77,78 @@ fuzzer_$(1): fuzzer_ok/fuzzer_$(1)_$(XRAY_PART).ok endef -$(eval $(call fuzzer,000-init-db,,Y)) +$(eval $(call fuzzer,000-init-db,,part)) ifneq ($(FUZZONLY),Y) -$(eval $(call fuzzer,001-part-yaml,000-init-db,Y)) -$(eval $(call fuzzer,005-tilegrid,001-part-yaml,Y)) +$(eval $(call fuzzer,001-part-yaml,000-init-db,part)) +$(eval $(call fuzzer,005-tilegrid,001-part-yaml,part)) else all:: 005-tilegrid/run.ok touch 005-tilegrid/run.ok endif ifneq ($(XRAY_DATABASE),kintex7) -$(eval $(call fuzzer,007-timing,005-tilegrid,N)) +$(eval $(call fuzzer,007-timing,005-tilegrid,all)) endif -$(eval $(call fuzzer,010-clb-lutinit,005-tilegrid,N)) -$(eval $(call fuzzer,011-clb-ffconfig,005-tilegrid,N)) -$(eval $(call fuzzer,012-clb-n5ffmux,005-tilegrid,N)) -$(eval $(call fuzzer,013-clb-ncy0,005-tilegrid,N)) -$(eval $(call fuzzer,014-clb-ffsrcemux,005-tilegrid,N)) -$(eval $(call fuzzer,015-clb-nffmux,005-tilegrid,N)) -$(eval $(call fuzzer,016-clb-noutmux,005-tilegrid,N)) -$(eval $(call fuzzer,017-clb-precyinit,005-tilegrid,N)) -$(eval $(call fuzzer,018-clb-ram,005-tilegrid,N)) -$(eval $(call fuzzer,019-clb-ndi1mux,005-tilegrid,N)) -$(eval $(call fuzzer,025-bram-config,005-tilegrid,N)) -$(eval $(call fuzzer,026-bram-data,005-tilegrid,N)) -$(eval $(call fuzzer,027-bram36-config,005-tilegrid,N)) -$(eval $(call fuzzer,028-fifo-config,005-tilegrid,N)) -$(eval $(call fuzzer,029-bram-fifo-config,005-tilegrid,N)) -$(eval $(call fuzzer,030-iob,005-tilegrid,N)) -$(eval $(call fuzzer,032-cmt-pll,005-tilegrid,N)) -$(eval $(call fuzzer,034-cmt-pll-pips,005-tilegrid 071-ppips,N)) -$(eval $(call fuzzer,035-iob-ilogic,005-tilegrid,N)) -$(eval $(call fuzzer,035a-iob-idelay,005-tilegrid,N)) -$(eval $(call fuzzer,036-iob-ologic,005-tilegrid,N)) -$(eval $(call fuzzer,037-iob-pips,005-tilegrid,N)) -$(eval $(call fuzzer,038-cfg,005-tilegrid,N)) -$(eval $(call fuzzer,039-hclk-config,005-tilegrid,N)) -$(eval $(call fuzzer,040-clk-hrow-config,005-tilegrid,N)) -$(eval $(call fuzzer,041-clk-hrow-pips,005-tilegrid,N)) -$(eval $(call fuzzer,042-clk-bufg-config,005-tilegrid,N)) -$(eval $(call fuzzer,043-clk-rebuf-pips,005-tilegrid,N)) -$(eval $(call fuzzer,044-clk-bufg-pips,046-clk-bufg-muxed-pips,N)) -$(eval $(call fuzzer,045-hclk-cmt-pips,005-tilegrid,N)) -$(eval $(call fuzzer,046-clk-bufg-muxed-pips,005-tilegrid,N)) -$(eval $(call fuzzer,047-hclk-ioi-pips,005-tilegrid,N)) -$(eval $(call fuzzer,047a-hclk-idelayctrl-pips,047-hclk-ioi-pips,N)) -$(eval $(call fuzzer,048-int-piplist,005-tilegrid,N)) -$(eval $(call fuzzer,049-int-imux-gfan,048-int-piplist,N)) -$(eval $(call fuzzer,050-pip-seed,048-int-piplist,N)) -$(eval $(call fuzzer,051-pip-imuxlout-bypalts,048-int-piplist,N)) -$(eval $(call fuzzer,052-pip-clkin,048-int-piplist,N)) -$(eval $(call fuzzer,053-pip-ctrlin,048-int-piplist,N)) -$(eval $(call fuzzer,054-pip-fan-alt,048-int-piplist,N)) -$(eval $(call fuzzer,055-pip-gnd,048-int-piplist,N)) -$(eval $(call fuzzer,056-pip-rem,049-int-imux-gfan 050-pip-seed 051-pip-imuxlout-bypalts 052-pip-clkin 053-pip-ctrlin 054-pip-fan-alt 055-pip-gnd 059-pip-byp-bounce,N)) -$(eval $(call fuzzer,057-pip-bi,056-pip-rem,N)) +$(eval $(call fuzzer,010-clb-lutinit,005-tilegrid,all)) +$(eval $(call fuzzer,011-clb-ffconfig,005-tilegrid,all)) +$(eval $(call fuzzer,012-clb-n5ffmux,005-tilegrid,all)) +$(eval $(call fuzzer,013-clb-ncy0,005-tilegrid,all)) +$(eval $(call fuzzer,014-clb-ffsrcemux,005-tilegrid,all)) +$(eval $(call fuzzer,015-clb-nffmux,005-tilegrid,all)) +$(eval $(call fuzzer,016-clb-noutmux,005-tilegrid,all)) +$(eval $(call fuzzer,017-clb-precyinit,005-tilegrid,all)) +$(eval $(call fuzzer,018-clb-ram,005-tilegrid,all)) +$(eval $(call fuzzer,019-clb-ndi1mux,005-tilegrid,all)) +$(eval $(call fuzzer,025-bram-config,005-tilegrid,all)) +$(eval $(call fuzzer,026-bram-data,005-tilegrid,all)) +$(eval $(call fuzzer,027-bram36-config,005-tilegrid,all)) +$(eval $(call fuzzer,028-fifo-config,005-tilegrid,all)) +$(eval $(call fuzzer,029-bram-fifo-config,005-tilegrid,all)) +$(eval $(call fuzzer,030-iob,005-tilegrid,all)) +$(eval $(call fuzzer,032-cmt-pll,005-tilegrid,all)) +$(eval $(call fuzzer,034-cmt-pll-pips,005-tilegrid 071-ppips,all)) +$(eval $(call fuzzer,035-iob-ilogic,005-tilegrid,all)) +$(eval $(call fuzzer,035a-iob-idelay,005-tilegrid,all)) +$(eval $(call fuzzer,036-iob-ologic,005-tilegrid,all)) +$(eval $(call fuzzer,037-iob-pips,005-tilegrid,all)) +$(eval $(call fuzzer,038-cfg,005-tilegrid,all)) +$(eval $(call fuzzer,039-hclk-config,005-tilegrid,all)) +$(eval $(call fuzzer,040-clk-hrow-config,005-tilegrid,all)) +$(eval $(call fuzzer,041-clk-hrow-pips,005-tilegrid,all)) +$(eval $(call fuzzer,042-clk-bufg-config,005-tilegrid,all)) +$(eval $(call fuzzer,043-clk-rebuf-pips,005-tilegrid,all)) +$(eval $(call fuzzer,044-clk-bufg-pips,046-clk-bufg-muxed-pips,all)) +$(eval $(call fuzzer,045-hclk-cmt-pips,005-tilegrid,all)) +$(eval $(call fuzzer,046-clk-bufg-muxed-pips,005-tilegrid,all)) +$(eval $(call fuzzer,047-hclk-ioi-pips,005-tilegrid,all)) +$(eval $(call fuzzer,047a-hclk-idelayctrl-pips,047-hclk-ioi-pips,all)) +$(eval $(call fuzzer,048-int-piplist,005-tilegrid,all)) +$(eval $(call fuzzer,049-int-imux-gfan,048-int-piplist,all)) +$(eval $(call fuzzer,050-pip-seed,048-int-piplist,all)) +$(eval $(call fuzzer,051-pip-imuxlout-bypalts,048-int-piplist,all)) +$(eval $(call fuzzer,052-pip-clkin,048-int-piplist,all)) +$(eval $(call fuzzer,053-pip-ctrlin,048-int-piplist,all)) +$(eval $(call fuzzer,054-pip-fan-alt,048-int-piplist,all)) +$(eval $(call fuzzer,055-pip-gnd,048-int-piplist,all)) +$(eval $(call fuzzer,056-pip-rem,049-int-imux-gfan 050-pip-seed 051-pip-imuxlout-bypalts 052-pip-clkin 053-pip-ctrlin 054-pip-fan-alt 055-pip-gnd 059-pip-byp-bounce,all)) +$(eval $(call fuzzer,057-pip-bi,056-pip-rem,all)) ifneq ($(QUICK),Y) -$(eval $(call fuzzer,058-pip-hclk,005-tilegrid,N)) -$(eval $(call fuzzer,059-pip-byp-bounce,048-int-piplist,N)) -$(eval $(call fuzzer,060-bram-cascades,005-tilegrid,N)) -$(eval $(call fuzzer,071-ppips,057-pip-bi 058-pip-hclk 060-bram-cascades,N)) +$(eval $(call fuzzer,058-pip-hclk,005-tilegrid,all)) +$(eval $(call fuzzer,059-pip-byp-bounce,048-int-piplist,all)) +$(eval $(call fuzzer,060-bram-cascades,005-tilegrid,all)) +$(eval $(call fuzzer,071-ppips,057-pip-bi 058-pip-hclk 060-bram-cascades,all)) ifneq ($(BITONLY),Y) -$(eval $(call fuzzer,072-ordered_wires,,Y)) -$(eval $(call fuzzer,073-get_counts,,Y)) -$(eval $(call fuzzer,074-dump_all,005-tilegrid 072-ordered_wires,Y)) -$(eval $(call fuzzer,075-pins,,Y)) +$(eval $(call fuzzer,072-ordered_wires,,part)) +$(eval $(call fuzzer,073-get_counts,,part)) +$(eval $(call fuzzer,074-dump_all,005-tilegrid 072-ordered_wires,part)) +$(eval $(call fuzzer,075-pins,,part)) ifeq ($(XRAY_DATABASE),zynq7) -$(eval $(call fuzzer,076-ps7,,N)) +$(eval $(call fuzzer,076-ps7,,all)) endif endif endif -$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid,N)) +$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid,all)) quick: $(MAKE) QUICK=Y From 89bc2008d85db60968308cff4bd658055ab13564 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Thu, 20 Feb 2020 11:33:12 -0800 Subject: [PATCH 41/41] Some more fixes around ignored tiles within a grid. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/074-dump_all/generate_grid.py | 15 ++++++++++++++- fuzzers/074-dump_all/jobtiles.tcl | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fuzzers/074-dump_all/generate_grid.py b/fuzzers/074-dump_all/generate_grid.py index 80cb5f20..82f98502 100644 --- a/fuzzers/074-dump_all/generate_grid.py +++ b/fuzzers/074-dump_all/generate_grid.py @@ -19,9 +19,16 @@ def get_tile_grid_info(fname): with open(fname, 'r') as f: tile = json5.load(f) + tile_type = tile['type'] + ignored = int(tile['ignored']) != 0 + + if ignored: + tile_type = 'NULL' + return { tile['tile']: { - 'type': tile['type'], + 'type': tile_type, + 'ignored': ignored, 'grid_x': tile['x'], 'grid_y': tile['y'], 'sites': dict( @@ -592,6 +599,12 @@ def main(): for tile in db_grid_keys: for k in grid2[tile]: + if k == 'ignored': + continue + + if k == 'sites' and grid2[tile]['ignored']: + continue + assert k in grid[tile], k assert grid[tile][k] == grid2[tile][k], ( tile, k, grid[tile][k], grid2[tile][k]) diff --git a/fuzzers/074-dump_all/jobtiles.tcl b/fuzzers/074-dump_all/jobtiles.tcl index 55cdd550..15336674 100644 --- a/fuzzers/074-dump_all/jobtiles.tcl +++ b/fuzzers/074-dump_all/jobtiles.tcl @@ -30,7 +30,9 @@ for {set j $start } { $j < $stop } { incr j } { # If tile is not allowed, skip it set res [lsearch $not_allowed_tiles $tile] if { $res != -1 } { - continue + set ignored 1 + } else { + set ignored 0 } set fname tile_$tile.json5 @@ -40,6 +42,7 @@ for {set j $start } { $j < $stop } { incr j } { set fp [open "${fname}" w] puts $fp "\{" puts $fp "\t\"tile\": \"$tile\"," + puts $fp "\t\"ignored\": \"$ignored\"," # tile properties: # CLASS COLUMN DEVICE_ID FIRST_SITE_ID GRID_POINT_X GRID_POINT_Y INDEX # INT_TILE_X INT_TILE_Y IS_CENTER_TILE IS_DCM_TILE IS_GT_CLOCK_SITE_TILE