proc start_step { step } {
  set stopFile ".stop.rst"
  if {[file isfile .stop.rst]} {
    puts ""
    puts "*** Halting run - EA reset detected ***"
    puts ""
    puts ""
    return -code error
  }
  set beginFile ".$step.begin.rst"
  set platform "$::tcl_platform(platform)"
  set user "$::tcl_platform(user)"
  set pid [pid]
  set host ""
  if { [string equal $platform unix] } {
    if { [info exist ::env(HOSTNAME)] } {
      set host $::env(HOSTNAME)
    }
  } else {
    if { [info exist ::env(COMPUTERNAME)] } {
      set host $::env(COMPUTERNAME)
    }
  }
  set ch [open $beginFile w]
  puts $ch "<?xml version=\"1.0\"?>"
  puts $ch "<ProcessHandle Version=\"1\" Minor=\"0\">"
  puts $ch "    <Process Command=\".planAhead.\" Owner=\"$user\" Host=\"$host\" Pid=\"$pid\">"
  puts $ch "    </Process>"
  puts $ch "</ProcessHandle>"
  close $ch
}

proc end_step { step } {
  set endFile ".$step.end.rst"
  set ch [open $endFile w]
  close $ch
}

proc step_failed { step } {
  set endFile ".$step.error.rst"
  set ch [open $endFile w]
  close $ch
}

set_msg_config -id {HDL 9-1061} -limit 100000
set_msg_config -id {HDL 9-1654} -limit 100000

start_step init_design
set rc [catch {
  create_msg_db init_design.pb
  set_property design_mode GateLvl [current_fileset]
  set_property webtalk.parent_dir C:/Basys_3_Projects/Temperature_Sensor_Interface/Temperature_Sensor_Interface.cache/wt [current_project]
  set_property parent.project_path C:/Basys_3_Projects/Temperature_Sensor_Interface/Temperature_Sensor_Interface.xpr [current_project]
  set_property ip_repo_paths {
  c:/Basys_3_Projects/Temperature_Sensor_Interface/Temperature_Sensor_Interface.cache/ip
  c:/basys_3_projects/temperature_sensor_interface/temperature_sensor_interface.srcs/sources_1/imports/temp_sensor/bin_bcd
  c:/basys_3_projects/temperature_sensor_interface/temperature_sensor_interface.srcs/sources_1/imports/hex_to_7_seg_v1_0
  c:/basys_3_projects/temperature_sensor_interface/temperature_sensor_interface.srcs/sources_1/imports/temp_sensor/seg_display
} [current_project]
  set_property ip_output_repo c:/Basys_3_Projects/Temperature_Sensor_Interface/Temperature_Sensor_Interface.cache/ip [current_project]
  add_files -quiet C:/Basys_3_Projects/Temperature_Sensor_Interface/Temperature_Sensor_Interface.runs/synth_1/Seg_Display_16.dcp
  read_xdc C:/Basys_3_Projects/Temperature_Sensor_Interface/Temperature_Sensor_Interface.srcs/constrs_1/imports/XDC/Basys3_Master.xdc
  link_design -top Seg_Display_16 -part xc7a35tcpg236-2
  close_msg_db -file init_design.pb
} RESULT]
if {$rc} {
  step_failed init_design
  return -code error $RESULT
} else {
  end_step init_design
}

start_step opt_design
set rc [catch {
  create_msg_db opt_design.pb
  catch {write_debug_probes -quiet -force debug_nets}
  opt_design 
  write_checkpoint -force Seg_Display_16_opt.dcp
  report_drc -file Seg_Display_16_drc_opted.rpt
  close_msg_db -file opt_design.pb
} RESULT]
if {$rc} {
  step_failed opt_design
  return -code error $RESULT
} else {
  end_step opt_design
}

start_step place_design
set rc [catch {
  create_msg_db place_design.pb
  catch {write_hwdef -file Seg_Display_16.hwdef}
  place_design 
  write_checkpoint -force Seg_Display_16_placed.dcp
  report_io -file Seg_Display_16_io_placed.rpt
  report_utilization -file Seg_Display_16_utilization_placed.rpt -pb Seg_Display_16_utilization_placed.pb
  report_control_sets -verbose -file Seg_Display_16_control_sets_placed.rpt
  close_msg_db -file place_design.pb
} RESULT]
if {$rc} {
  step_failed place_design
  return -code error $RESULT
} else {
  end_step place_design
}

start_step route_design
set rc [catch {
  create_msg_db route_design.pb
  route_design 
  write_checkpoint -force Seg_Display_16_routed.dcp
  report_drc -file Seg_Display_16_drc_routed.rpt -pb Seg_Display_16_drc_routed.pb
  report_timing_summary -warn_on_violation -max_paths 10 -file Seg_Display_16_timing_summary_routed.rpt -rpx Seg_Display_16_timing_summary_routed.rpx
  report_power -file Seg_Display_16_power_routed.rpt -pb Seg_Display_16_power_summary_routed.pb
  report_route_status -file Seg_Display_16_route_status.rpt -pb Seg_Display_16_route_status.pb
  report_clock_utilization -file Seg_Display_16_clock_utilization_routed.rpt
  close_msg_db -file route_design.pb
} RESULT]
if {$rc} {
  step_failed route_design
  return -code error $RESULT
} else {
  end_step route_design
}

