From 4ba4c6b8971d0c3edf332fb99c27d5847759ec96 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 15 Jan 2019 12:17:40 -0800 Subject: [PATCH 1/3] Add retries to bidirection PIP fuzzer. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/057-pip-bi/generate.tcl | 50 +++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/fuzzers/057-pip-bi/generate.tcl b/fuzzers/057-pip-bi/generate.tcl index a6b10245..10dbdd0e 100644 --- a/fuzzers/057-pip-bi/generate.tcl +++ b/fuzzers/057-pip-bi/generate.tcl @@ -41,22 +41,50 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} { set dst_wire [lindex $line 1] set src_wire [lindex $line 2] - if {$tile_type == "INT_L"} {set tile [lindex $int_l_tiles $idx]; set other_tile [lindex $int_r_tiles $idx]} - if {$tile_type == "INT_R"} {set tile [lindex $int_r_tiles $idx]; set other_tile [lindex $int_l_tiles $idx]} + set tries 0 + while {1} { + set tile_idx [expr $tries + [expr $idx * 3]] + incr tries - puts "PIP Tile: $tile" + if {$tile_type == "INT_L"} {set tile [lindex $int_l_tiles $tile_idx]; set other_tile [lindex $int_r_tiles $idx]} + if {$tile_type == "INT_R"} {set tile [lindex $int_r_tiles $tile_idx]; set other_tile [lindex $int_l_tiles $idx]} - set driver_site [get_sites -of_objects [get_site_pins -of_objects [get_nodes -downhill \ - -of_objects [get_nodes -of_objects [get_wires $other_tile/CLK*0]]]]] + puts "PIP Tile: $tile" - puts "LUT Tile (Site): $other_tile ($driver_site)" + set driver_site [get_sites -of_objects [get_site_pins -of_objects [get_nodes -downhill \ + -of_objects [get_nodes -of_objects [get_wires $other_tile/CLK*0]]]]] - set mylut [create_cell -reference LUT1 mylut_$idx] - set_property -dict "LOC $driver_site BEL A6LUT" $mylut + puts "LUT Tile (Site): $other_tile ($driver_site)" - set mynet [create_net mynet_$idx] - connect_net -net $mynet -objects "$mylut/I0 $mylut/O" - route_via $mynet "$tile/$src_wire $tile/$dst_wire" + set mylut [create_cell -reference LUT1 mylut_$idx] + set_property -dict "LOC $driver_site BEL A6LUT" $mylut + + set mynet [create_net mynet_$idx] + connect_net -net $mynet -objects "$mylut/I0 $mylut/O" + set rc [route_via $mynet "$tile/$src_wire $tile/$dst_wire" 0] + if {$rc != 0} { + puts "ROUTING DONE!" + break + } + + # fallback + puts "WARNING: failed to route net" + write_checkpoint -force route_todo_$idx.$tries.fail.dcp + + puts "Rolling back route" + set_property is_route_fixed 0 $mynet + set_property is_bel_fixed 0 $mylut + set_property is_loc_fixed 1 $mylut + set_property is_bel_fixed 0 $myff + set_property is_loc_fixed 1 $myff + route_design -unroute -nets $mynet + + # sometimes it gets stuck in specific src -> dst locations + if {$tries >= 3} { + puts "WARNING: failed to route net after $tries tries" + error + } + } if {[get_pips -filter "NAME == \"${tile}/${tile_type}.${src_wire}<<->>${dst_wire}\" || NAME == \"${tile}/${tile_type}.${dst_wire}<<->>${src_wire}\"" -of_objects [get_nets $mynet]] != ""} { puts $fp "A $tile/$dst_wire $tile/$src_wire" From dc060064c39b762b2303208f2ead3485ef30788d Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 15 Jan 2019 12:30:52 -0800 Subject: [PATCH 2/3] Fix copy/paste error, no such var as myff. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/057-pip-bi/generate.tcl | 2 -- 1 file changed, 2 deletions(-) diff --git a/fuzzers/057-pip-bi/generate.tcl b/fuzzers/057-pip-bi/generate.tcl index 10dbdd0e..84dd588f 100644 --- a/fuzzers/057-pip-bi/generate.tcl +++ b/fuzzers/057-pip-bi/generate.tcl @@ -75,8 +75,6 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} { set_property is_route_fixed 0 $mynet set_property is_bel_fixed 0 $mylut set_property is_loc_fixed 1 $mylut - set_property is_bel_fixed 0 $myff - set_property is_loc_fixed 1 $myff route_design -unroute -nets $mynet # sometimes it gets stuck in specific src -> dst locations From 63b397199ced34102737bc85415dee555a53dd28 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Tue, 15 Jan 2019 12:38:11 -0800 Subject: [PATCH 3/3] Move 1-time part of loop out of loop. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- fuzzers/057-pip-bi/generate.tcl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fuzzers/057-pip-bi/generate.tcl b/fuzzers/057-pip-bi/generate.tcl index 84dd588f..f09b5d28 100644 --- a/fuzzers/057-pip-bi/generate.tcl +++ b/fuzzers/057-pip-bi/generate.tcl @@ -41,6 +41,11 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} { set dst_wire [lindex $line 1] set src_wire [lindex $line 2] + set mylut [create_cell -reference LUT1 mylut_$idx] + + set mynet [create_net mynet_$idx] + connect_net -net $mynet -objects "$mylut/I0 $mylut/O" + set tries 0 while {1} { set tile_idx [expr $tries + [expr $idx * 3]] @@ -56,11 +61,8 @@ for {set idx 0} {$idx < [llength $todo_lines]} {incr idx} { puts "LUT Tile (Site): $other_tile ($driver_site)" - set mylut [create_cell -reference LUT1 mylut_$idx] set_property -dict "LOC $driver_site BEL A6LUT" $mylut - set mynet [create_net mynet_$idx] - connect_net -net $mynet -objects "$mylut/I0 $mylut/O" set rc [route_via $mynet "$tile/$src_wire $tile/$dst_wire" 0] if {$rc != 0} { puts "ROUTING DONE!"