Commit 2dbe1061 authored by Jens Korinth's avatar Jens Korinth
Browse files

Re-activate normal evaluation

* fixed optimization 42 implementation: normal runs (O != 42) are
  executed in single run mode
* fixed bug with SAIF reading
* fixed common_ip bug
parent 095f9417
Pipeline #285 passed with stage
in 3 minutes and 7 seconds
# create a dictionary of compatible VLNVs
source $::env(TAPASCO_HOME)/common/common_ip.tcl
#source $::env(TAPASCO_HOME)/common/common_ip.tcl
dict set stdcomps dualdma vlnv "esa.informatik.tu-darmstadt.de:user:dual_dma:1.10"
# create a dictionary of compatible VLNVs
source $::env(TAPASCO_HOME)/common/common_ip.tcl
#source $::env(TAPASCO_HOME)/common/common_ip.tcl
dict set stdcomps dualdma vlnv "esa.informatik.tu-darmstadt.de:user:dual_dma:1.11"
......@@ -31,9 +31,6 @@ set_param general.maxThreads 1
create_project -in_memory -part @@PART@@
# set parameters
set opt @@OPTIMIZATION@@
# add files
add_files @@SRC_FILES@@
# Read ngc/edif files, e.g. for primitives
......@@ -51,126 +48,137 @@ foreach script [list @@TCL_FILES@@] { source $script }
# find top
set top [lindex [find_top] 0]
# read switching activity files (if any)
foreach saif [glob -nocomplain *.saif] {
read_saif $saif
}
# set parameters
set opt @@OPTIMIZATION@@
set target_opt @@OPTIMIZATION@@
set period @@PERIOD@@
set target_period @@PERIOD@@
if {@@OPTIMIZATION@@ == 42} {
set results_file [open [file join [file dirname "@@REPORT_TIMING@@"] "synthesis_results.tsv"] "w+"]
puts $results_file "TT\tTF\t\O\tWNS\tOT\tOF"
set runtimes_file [open [file join [file dirname "@@REPORT_TIMING@@"] "synthesis_runtimes.tsv"] "w+"]
puts $runtimes_file "TT\tTF\tO\tP\tS\t\E\tD"
for {set period 0.5} {$period <= 5.0} {set period [expr $period + 0.125]} {
for {set opt 3} {$opt >= 0} {incr opt -1} {
set synth_start [clock seconds]
set synth_options [list @@SYNTH_OPTIONS@@]
lappend synth_options {-part} {@@PART@@} {-top} $top {-mode} {out_of_context}
# synthesize and optimize netlist
if {$opt >= 1} {
lappend synth_options {-retiming} {-fanout_limit} 400 {-shreg_min_size} 5 {-flatten_hierarchy} {full}
}
if {$opt >= 2} {
lappend synth_options {-fsm_extraction} {one_hot}
}
if {$opt >= 3} {
lappend synth_options {-keep_equivalent_registers} {-resource_sharing} {off} {-no_lc}
}
synth_design {*}$synth_options
set opt_start [clock seconds]
opt_design
set synth_finish [clock seconds]
set ur [file join [file dirname "@@REPORT_UTILIZATION@@"] "synth_utilization_period${period}_opt${opt}.rpt"]
puts "writing utilization report $ur ..."
report_utilization -quiet -file $ur
set tr [file join [file dirname "@@REPORT_TIMING@@"] "synth_timing_period${period}_opt${opt}.rpt"]
puts "writing timing report summary $tr ..."
report_timing_summary -quiet -file $tr
puts "synth_design for O$opt took [expr $synth_finish - $opt_start] sec, opt_design took [expr $opt_start - $synth_finish] sec."
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tsynth_design\t$synth_start\t$opt_start\t[expr $opt_start - $synth_start]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\topt_design\t$opt_start\t$synth_finish\t[expr $synth_finish - $opt_start]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\ttotal_synth\t$synth_start\t$synth_finish\t[expr $synth_finish - $synth_start]"
# write design checkpoint
#write_checkpoint -force "@@SYNTH_CHECKPOINT@@.O${opt}_P${period}.dcp"
# set clock
set clock_ports [get_ports -filter {DIRECTION == IN && (NAME =~ *clk* || NAME =~ *CLK* || NAME =~ clock)}]
puts "clock_ports = $clock_ports"
create_clock -name clk -period $period $clock_ports
set pnr_start [clock seconds]
# place and route
set opt_directive "RuntimeOptimized"
if {$opt >= 1} { set opt_directive "Default" }
if {$opt >= 2} { set opt_directive "Explore" }
puts "running opt_design -directive $opt_directive ..."
opt_design -directive $opt_directive
set opt_design_finish [clock seconds]
set place_directive "RuntimeOptimized"
if {$opt >= 1} { set place_directive "Default" }
if {$opt >= 1} { set place_directive "Explore" }
puts "running place_design -directive $place_directive ..."
place_design -directive $place_directive
set place_design_finish [clock seconds]
set physopt1_directive "RuntimeOptimized"
if {$opt >= 1} { set physopt1_directive "Default" }
if {$opt >= 2} { set physopt1_directive "Explore" }
if {$opt >= 3} { set physopt1_directive "AggressiveExplore" }
puts "running phys_opt_design -directive $physopt1_directive ..."
phys_opt_design -directive $physopt1_directive
set physopt1_finish [clock seconds]
set route_directive "RuntimeOptimized"
if {$opt >= 1} { set route_directive "Default" }
if {$opt >= 2} { set route_directive "Explore" }
puts "running route_design -directive $route_directive ..."
route_design -directive $route_directive
set route_design_finish [clock seconds]
set physopt2_directive "Explore"
if {$opt > 2} { set physopt2_directive "AggressiveExplore" }
if {$opt >= 2} {
puts "phys_opt_design -directive $physopt2_directive ..."
phys_opt_design -directive $physopt2_directive
set physopt2_finish [clock seconds]
}
set pnr_finish [clock seconds]
# report timing
set tr [file join [file dirname "@@REPORT_TIMING@@"] "pnr_timing_period${period}_opt${opt}.rpt"]
report_timing_summary -quiet -datasheet -file $tr
# report utilization
report_utilization -quiet -file [file join [file dirname "@@REPORT_UTILIZATION@@"] "pnr_utilization_period${period}_opt${opt}.rpt"]
set wns [tapasco::get_wns_from_timing_report $tr]
set clk [expr "$period - $wns"]
# write design checkpoint
#write_checkpoint -force "@@IMPL_CHECKPOINT@@.O${opt}_P${period}.dcp"
puts "O$opt RESULT: WNS = $wns PERIOD = $clk F = [expr 1000.0 / $clk]"
puts $results_file "$period\t[expr 1000.0/$period]\t$opt\t$wns\t$clk\t[expr 1000.0/$clk]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tpnr_opt_design\t$pnr_start\t$opt_design_finish\t[expr $opt_design_finish - $pnr_start]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tplace_design\t$opt_design_finish\t$place_design_finish\t[expr $place_design_finish - $opt_design_finish]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tphys_opt_design\t$place_design_finish\t$physopt1_finish\t[expr $physopt1_finish - $place_design_finish]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\troute_design\t$physopt1_finish\t$route_design_finish\t[expr $route_design_finish - $physopt1_finish]"
if {$opt >= 2} {
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tphys_opt_design2\t$route_design_finish\t$physopt2_finish\t[expr $physopt2_finish - $route_design_finish]"
}
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\ttotal_pnr\t$pnr_start\t$pnr_finish\t[expr $pnr_finish - $pnr_start]"
flush $runtimes_file
flush $results_file
# activate opt and period loops
set opt 3
set target_opt 0
set period 0.5
set target_period 5.0
}
set results_file [open [file join [file dirname "@@REPORT_TIMING@@"] "synthesis_results.tsv"] "w+"]
puts $results_file "TT\tTF\t\O\tWNS\tOT\tOF"
set runtimes_file [open [file join [file dirname "@@REPORT_TIMING@@"] "synthesis_runtimes.tsv"] "w+"]
puts $runtimes_file "TT\tTF\tO\tP\tS\t\E\tD"
#for {set period 0.5} {$period <= 5.0} {set period [expr $period + 0.125]} {
for {} {$period <= $target_period} {set period [expr $period + 0.125]} {
for {} {$opt >= $target_opt} {incr opt -1} {
set synth_start [clock seconds]
set synth_options [list @@SYNTH_OPTIONS@@]
lappend synth_options {-part} {@@PART@@} {-top} $top {-mode} {out_of_context}
# synthesize and optimize netlist
if {$opt >= 1} {
lappend synth_options {-retiming} {-fanout_limit} 400 {-shreg_min_size} 5 {-flatten_hierarchy} {full}
}
if {$opt >= 2} {
lappend synth_options {-fsm_extraction} {one_hot}
}
if {$opt >= 3} {
lappend synth_options {-keep_equivalent_registers} {-resource_sharing} {off} {-no_lc}
}
synth_design {*}$synth_options
set opt_start [clock seconds]
opt_design
set synth_finish [clock seconds]
set ur [file join [file dirname "@@REPORT_UTILIZATION@@"] "synth_utilization_period${period}_opt${opt}.rpt"]
puts "writing utilization report $ur ..."
report_utilization -quiet -file $ur
set tr [file join [file dirname "@@REPORT_TIMING@@"] "synth_timing_period${period}_opt${opt}.rpt"]
puts "writing timing report summary $tr ..."
report_timing_summary -quiet -file $tr
puts "synth_design for O$opt took [expr $synth_finish - $opt_start] sec, opt_design took [expr $opt_start - $synth_finish] sec."
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tsynth_design\t$synth_start\t$opt_start\t[expr $opt_start - $synth_start]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\topt_design\t$opt_start\t$synth_finish\t[expr $synth_finish - $opt_start]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\ttotal_synth\t$synth_start\t$synth_finish\t[expr $synth_finish - $synth_start]"
# read switching activity files (if any)
foreach saif [glob -nocomplain *.saif] {
read_saif $saif
}
# write design checkpoint
write_checkpoint -force "@@SYNTH_CHECKPOINT@@.O${opt}_P${period}.dcp"
# set clock
set clock_ports [get_ports -filter {DIRECTION == IN && (NAME =~ *clk* || NAME =~ *CLK* || NAME =~ clock)}]
puts "clock_ports = $clock_ports"
create_clock -name clk -period $period $clock_ports
set pnr_start [clock seconds]
# place and route
set opt_directive "RuntimeOptimized"
if {$opt >= 1} { set opt_directive "Default" }
if {$opt >= 2} { set opt_directive "Explore" }
puts "running opt_design -directive $opt_directive ..."
opt_design -directive $opt_directive
set opt_design_finish [clock seconds]
set place_directive "RuntimeOptimized"
if {$opt >= 1} { set place_directive "Default" }
if {$opt >= 1} { set place_directive "Explore" }
puts "running place_design -directive $place_directive ..."
place_design -directive $place_directive
set place_design_finish [clock seconds]
set physopt1_directive "RuntimeOptimized"
if {$opt >= 1} { set physopt1_directive "Default" }
if {$opt >= 2} { set physopt1_directive "Explore" }
if {$opt >= 3} { set physopt1_directive "AggressiveExplore" }
puts "running phys_opt_design -directive $physopt1_directive ..."
phys_opt_design -directive $physopt1_directive
set physopt1_finish [clock seconds]
set route_directive "RuntimeOptimized"
if {$opt >= 1} { set route_directive "Default" }
if {$opt >= 2} { set route_directive "Explore" }
puts "running route_design -directive $route_directive ..."
route_design -directive $route_directive
set route_design_finish [clock seconds]
set physopt2_directive "Explore"
if {$opt > 2} { set physopt2_directive "AggressiveExplore" }
if {$opt >= 2} {
puts "phys_opt_design -directive $physopt2_directive ..."
phys_opt_design -directive $physopt2_directive
set physopt2_finish [clock seconds]
}
set pnr_finish [clock seconds]
# report timing
set tr [file join [file dirname "@@REPORT_TIMING@@"] "pnr_timing_period${period}_opt${opt}.rpt"]
report_timing_summary -quiet -datasheet -file $tr
# report utilization
report_utilization -quiet -file [file join [file dirname "@@REPORT_UTILIZATION@@"] "pnr_utilization_period${period}_opt${opt}.rpt"]
set wns [tapasco::get_wns_from_timing_report $tr]
set clk [expr "$period - $wns"]
# write design checkpoint
write_checkpoint -force "@@IMPL_CHECKPOINT@@.O${opt}_P${period}.dcp"
puts "O$opt RESULT: WNS = $wns PERIOD = $clk F = [expr 1000.0 / $clk]"
puts $results_file "$period\t[expr 1000.0/$period]\t$opt\t$wns\t$clk\t[expr 1000.0/$clk]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tpnr_opt_design\t$pnr_start\t$opt_design_finish\t[expr $opt_design_finish - $pnr_start]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tplace_design\t$opt_design_finish\t$place_design_finish\t[expr $place_design_finish - $opt_design_finish]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tphys_opt_design\t$place_design_finish\t$physopt1_finish\t[expr $physopt1_finish - $place_design_finish]"
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\troute_design\t$physopt1_finish\t$route_design_finish\t[expr $route_design_finish - $physopt1_finish]"
if {$opt >= 2} {
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\tphys_opt_design2\t$route_design_finish\t$physopt2_finish\t[expr $physopt2_finish - $route_design_finish]"
}
puts $runtimes_file "$period\t[expr 1000.0/$period]\t$opt\ttotal_pnr\t$pnr_start\t$pnr_finish\t[expr $pnr_finish - $pnr_start]"
flush $runtimes_file
flush $results_file
}
close $runtimes_file
close $results_file
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment