basys3top.tcl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. #
  2. # Report generation script generated by Vivado
  3. #
  4. proc create_report { reportName command } {
  5. set status "."
  6. append status $reportName ".fail"
  7. if { [file exists $status] } {
  8. eval file delete [glob $status]
  9. }
  10. send_msg_id runtcl-4 info "Executing : $command"
  11. set retval [eval catch { $command } msg]
  12. if { $retval != 0 } {
  13. set fp [open $status w]
  14. close $fp
  15. send_msg_id runtcl-5 warning "$msg"
  16. }
  17. }
  18. namespace eval ::optrace {
  19. variable script "C:/Users/misspapaya/projects/cpu32/riscv/riscv_rtl/riscv_rtl.runs/impl_1/basys3top.tcl"
  20. variable category "vivado_impl"
  21. }
  22. # Try to connect to running dispatch if we haven't done so already.
  23. # This code assumes that the Tcl interpreter is not using threads,
  24. # since the ::dispatch::connected variable isn't mutex protected.
  25. if {![info exists ::dispatch::connected]} {
  26. namespace eval ::dispatch {
  27. variable connected false
  28. if {[llength [array get env XILINX_CD_CONNECT_ID]] > 0} {
  29. set result "true"
  30. if {[catch {
  31. if {[lsearch -exact [package names] DispatchTcl] < 0} {
  32. set result [load librdi_cd_clienttcl[info sharedlibextension]]
  33. }
  34. if {$result eq "false"} {
  35. puts "WARNING: Could not load dispatch client library"
  36. }
  37. set connect_id [ ::dispatch::init_client -mode EXISTING_SERVER ]
  38. if { $connect_id eq "" } {
  39. puts "WARNING: Could not initialize dispatch client"
  40. } else {
  41. puts "INFO: Dispatch client connection id - $connect_id"
  42. set connected true
  43. }
  44. } catch_res]} {
  45. puts "WARNING: failed to connect to dispatch server - $catch_res"
  46. }
  47. }
  48. }
  49. }
  50. if {$::dispatch::connected} {
  51. # Remove the dummy proc if it exists.
  52. if { [expr {[llength [info procs ::OPTRACE]] > 0}] } {
  53. rename ::OPTRACE ""
  54. }
  55. proc ::OPTRACE { task action {tags {} } } {
  56. ::vitis_log::op_trace "$task" $action -tags $tags -script $::optrace::script -category $::optrace::category
  57. }
  58. # dispatch is generic. We specifically want to attach logging.
  59. ::vitis_log::connect_client
  60. } else {
  61. # Add dummy proc if it doesn't exist.
  62. if { [expr {[llength [info procs ::OPTRACE]] == 0}] } {
  63. proc ::OPTRACE {{arg1 \"\" } {arg2 \"\"} {arg3 \"\" } {arg4 \"\"} {arg5 \"\" } {arg6 \"\"}} {
  64. # Do nothing
  65. }
  66. }
  67. }
  68. proc start_step { step } {
  69. set stopFile ".stop.rst"
  70. if {[file isfile .stop.rst]} {
  71. puts ""
  72. puts "*** Halting run - EA reset detected ***"
  73. puts ""
  74. puts ""
  75. return -code error
  76. }
  77. set beginFile ".$step.begin.rst"
  78. set platform "$::tcl_platform(platform)"
  79. set user "$::tcl_platform(user)"
  80. set pid [pid]
  81. set host ""
  82. if { [string equal $platform unix] } {
  83. if { [info exist ::env(HOSTNAME)] } {
  84. set host $::env(HOSTNAME)
  85. } elseif { [info exist ::env(HOST)] } {
  86. set host $::env(HOST)
  87. }
  88. } else {
  89. if { [info exist ::env(COMPUTERNAME)] } {
  90. set host $::env(COMPUTERNAME)
  91. }
  92. }
  93. set ch [open $beginFile w]
  94. puts $ch "<?xml version=\"1.0\"?>"
  95. puts $ch "<ProcessHandle Version=\"1\" Minor=\"0\">"
  96. puts $ch " <Process Command=\".planAhead.\" Owner=\"$user\" Host=\"$host\" Pid=\"$pid\">"
  97. puts $ch " </Process>"
  98. puts $ch "</ProcessHandle>"
  99. close $ch
  100. }
  101. proc end_step { step } {
  102. set endFile ".$step.end.rst"
  103. set ch [open $endFile w]
  104. close $ch
  105. }
  106. proc step_failed { step } {
  107. set endFile ".$step.error.rst"
  108. set ch [open $endFile w]
  109. close $ch
  110. OPTRACE "impl_1" END { }
  111. }
  112. OPTRACE "impl_1" START { ROLLUP_1 }
  113. OPTRACE "Phase: Init Design" START { ROLLUP_AUTO }
  114. start_step init_design
  115. set ACTIVE_STEP init_design
  116. set rc [catch {
  117. create_msg_db init_design.pb
  118. set_param chipscope.maxJobs 3
  119. set_param runs.launchOptions { -jobs 12 }
  120. OPTRACE "create in-memory project" START { }
  121. create_project -in_memory -part xc7a35tcpg236-1
  122. set_property design_mode GateLvl [current_fileset]
  123. set_param project.singleFileAddWarning.threshold 0
  124. OPTRACE "create in-memory project" END { }
  125. OPTRACE "set parameters" START { }
  126. set_property webtalk.parent_dir C:/Users/misspapaya/projects/cpu32/riscv/riscv_rtl/riscv_rtl.cache/wt [current_project]
  127. set_property parent.project_path C:/Users/misspapaya/projects/cpu32/riscv/riscv_rtl/riscv_rtl.xpr [current_project]
  128. set_property ip_output_repo C:/Users/misspapaya/projects/cpu32/riscv/riscv_rtl/riscv_rtl.cache/ip [current_project]
  129. set_property ip_cache_permissions {read write} [current_project]
  130. OPTRACE "set parameters" END { }
  131. OPTRACE "add files" START { }
  132. add_files -quiet C:/Users/misspapaya/projects/cpu32/riscv/riscv_rtl/riscv_rtl.runs/synth_1/basys3top.dcp
  133. OPTRACE "read constraints: implementation" START { }
  134. read_xdc C:/Users/misspapaya/projects/cpu32/riscv/riscv_rtl/riscv_rtl.srcs/constrs_1/new/basys3.xdc
  135. OPTRACE "read constraints: implementation" END { }
  136. OPTRACE "add files" END { }
  137. OPTRACE "link_design" START { }
  138. link_design -top basys3top -part xc7a35tcpg236-1
  139. OPTRACE "link_design" END { }
  140. OPTRACE "gray box cells" START { }
  141. OPTRACE "gray box cells" END { }
  142. OPTRACE "init_design_reports" START { REPORT }
  143. OPTRACE "init_design_reports" END { }
  144. OPTRACE "init_design_write_hwdef" START { }
  145. OPTRACE "init_design_write_hwdef" END { }
  146. close_msg_db -file init_design.pb
  147. } RESULT]
  148. if {$rc} {
  149. step_failed init_design
  150. return -code error $RESULT
  151. } else {
  152. end_step init_design
  153. unset ACTIVE_STEP
  154. }
  155. OPTRACE "Phase: Init Design" END { }
  156. OPTRACE "Phase: Opt Design" START { ROLLUP_AUTO }
  157. start_step opt_design
  158. set ACTIVE_STEP opt_design
  159. set rc [catch {
  160. create_msg_db opt_design.pb
  161. OPTRACE "read constraints: opt_design" START { }
  162. OPTRACE "read constraints: opt_design" END { }
  163. OPTRACE "opt_design" START { }
  164. opt_design
  165. OPTRACE "opt_design" END { }
  166. OPTRACE "read constraints: opt_design_post" START { }
  167. OPTRACE "read constraints: opt_design_post" END { }
  168. OPTRACE "opt_design reports" START { REPORT }
  169. create_report "impl_1_opt_report_drc_0" "report_drc -file basys3top_drc_opted.rpt -pb basys3top_drc_opted.pb -rpx basys3top_drc_opted.rpx"
  170. OPTRACE "opt_design reports" END { }
  171. OPTRACE "Opt Design: write_checkpoint" START { CHECKPOINT }
  172. write_checkpoint -force basys3top_opt.dcp
  173. OPTRACE "Opt Design: write_checkpoint" END { }
  174. close_msg_db -file opt_design.pb
  175. } RESULT]
  176. if {$rc} {
  177. step_failed opt_design
  178. return -code error $RESULT
  179. } else {
  180. end_step opt_design
  181. unset ACTIVE_STEP
  182. }
  183. OPTRACE "Phase: Opt Design" END { }
  184. OPTRACE "Phase: Place Design" START { ROLLUP_AUTO }
  185. start_step place_design
  186. set ACTIVE_STEP place_design
  187. set rc [catch {
  188. create_msg_db place_design.pb
  189. OPTRACE "read constraints: place_design" START { }
  190. OPTRACE "read constraints: place_design" END { }
  191. if { [llength [get_debug_cores -quiet] ] > 0 } {
  192. OPTRACE "implement_debug_core" START { }
  193. implement_debug_core
  194. OPTRACE "implement_debug_core" END { }
  195. }
  196. OPTRACE "place_design" START { }
  197. place_design
  198. OPTRACE "place_design" END { }
  199. OPTRACE "read constraints: place_design_post" START { }
  200. OPTRACE "read constraints: place_design_post" END { }
  201. OPTRACE "place_design reports" START { REPORT }
  202. create_report "impl_1_place_report_io_0" "report_io -file basys3top_io_placed.rpt"
  203. create_report "impl_1_place_report_utilization_0" "report_utilization -file basys3top_utilization_placed.rpt -pb basys3top_utilization_placed.pb"
  204. create_report "impl_1_place_report_control_sets_0" "report_control_sets -verbose -file basys3top_control_sets_placed.rpt"
  205. OPTRACE "place_design reports" END { }
  206. OPTRACE "Place Design: write_checkpoint" START { CHECKPOINT }
  207. write_checkpoint -force basys3top_placed.dcp
  208. OPTRACE "Place Design: write_checkpoint" END { }
  209. close_msg_db -file place_design.pb
  210. } RESULT]
  211. if {$rc} {
  212. step_failed place_design
  213. return -code error $RESULT
  214. } else {
  215. end_step place_design
  216. unset ACTIVE_STEP
  217. }
  218. OPTRACE "Phase: Place Design" END { }
  219. OPTRACE "Phase: Physical Opt Design" START { ROLLUP_AUTO }
  220. start_step phys_opt_design
  221. set ACTIVE_STEP phys_opt_design
  222. set rc [catch {
  223. create_msg_db phys_opt_design.pb
  224. OPTRACE "read constraints: phys_opt_design" START { }
  225. OPTRACE "read constraints: phys_opt_design" END { }
  226. OPTRACE "phys_opt_design" START { }
  227. phys_opt_design
  228. OPTRACE "phys_opt_design" END { }
  229. OPTRACE "read constraints: phys_opt_design_post" START { }
  230. OPTRACE "read constraints: phys_opt_design_post" END { }
  231. OPTRACE "phys_opt_design report" START { REPORT }
  232. OPTRACE "phys_opt_design report" END { }
  233. OPTRACE "Post-Place Phys Opt Design: write_checkpoint" START { CHECKPOINT }
  234. write_checkpoint -force basys3top_physopt.dcp
  235. OPTRACE "Post-Place Phys Opt Design: write_checkpoint" END { }
  236. close_msg_db -file phys_opt_design.pb
  237. } RESULT]
  238. if {$rc} {
  239. step_failed phys_opt_design
  240. return -code error $RESULT
  241. } else {
  242. end_step phys_opt_design
  243. unset ACTIVE_STEP
  244. }
  245. OPTRACE "Phase: Physical Opt Design" END { }
  246. OPTRACE "Phase: Route Design" START { ROLLUP_AUTO }
  247. start_step route_design
  248. set ACTIVE_STEP route_design
  249. set rc [catch {
  250. create_msg_db route_design.pb
  251. OPTRACE "read constraints: route_design" START { }
  252. OPTRACE "read constraints: route_design" END { }
  253. OPTRACE "route_design" START { }
  254. route_design
  255. OPTRACE "route_design" END { }
  256. OPTRACE "read constraints: route_design_post" START { }
  257. OPTRACE "read constraints: route_design_post" END { }
  258. OPTRACE "route_design reports" START { REPORT }
  259. create_report "impl_1_route_report_drc_0" "report_drc -file basys3top_drc_routed.rpt -pb basys3top_drc_routed.pb -rpx basys3top_drc_routed.rpx"
  260. create_report "impl_1_route_report_methodology_0" "report_methodology -file basys3top_methodology_drc_routed.rpt -pb basys3top_methodology_drc_routed.pb -rpx basys3top_methodology_drc_routed.rpx"
  261. create_report "impl_1_route_report_power_0" "report_power -file basys3top_power_routed.rpt -pb basys3top_power_summary_routed.pb -rpx basys3top_power_routed.rpx"
  262. create_report "impl_1_route_report_route_status_0" "report_route_status -file basys3top_route_status.rpt -pb basys3top_route_status.pb"
  263. create_report "impl_1_route_report_timing_summary_0" "report_timing_summary -max_paths 10 -report_unconstrained -file basys3top_timing_summary_routed.rpt -pb basys3top_timing_summary_routed.pb -rpx basys3top_timing_summary_routed.rpx -warn_on_violation "
  264. create_report "impl_1_route_report_incremental_reuse_0" "report_incremental_reuse -file basys3top_incremental_reuse_routed.rpt"
  265. create_report "impl_1_route_report_clock_utilization_0" "report_clock_utilization -file basys3top_clock_utilization_routed.rpt"
  266. create_report "impl_1_route_report_bus_skew_0" "report_bus_skew -warn_on_violation -file basys3top_bus_skew_routed.rpt -pb basys3top_bus_skew_routed.pb -rpx basys3top_bus_skew_routed.rpx"
  267. OPTRACE "route_design reports" END { }
  268. OPTRACE "Route Design: write_checkpoint" START { CHECKPOINT }
  269. write_checkpoint -force basys3top_routed.dcp
  270. OPTRACE "Route Design: write_checkpoint" END { }
  271. OPTRACE "route_design misc" START { }
  272. close_msg_db -file route_design.pb
  273. } RESULT]
  274. if {$rc} {
  275. OPTRACE "route_design write_checkpoint" START { CHECKPOINT }
  276. OPTRACE "route_design write_checkpoint" END { }
  277. write_checkpoint -force basys3top_routed_error.dcp
  278. step_failed route_design
  279. return -code error $RESULT
  280. } else {
  281. end_step route_design
  282. unset ACTIVE_STEP
  283. }
  284. OPTRACE "route_design misc" END { }
  285. OPTRACE "Phase: Route Design" END { }
  286. OPTRACE "Phase: Write Bitstream" START { ROLLUP_AUTO }
  287. OPTRACE "write_bitstream setup" START { }
  288. start_step write_bitstream
  289. set ACTIVE_STEP write_bitstream
  290. set rc [catch {
  291. create_msg_db write_bitstream.pb
  292. OPTRACE "read constraints: write_bitstream" START { }
  293. OPTRACE "read constraints: write_bitstream" END { }
  294. catch { write_mem_info -force -no_partial_mmi basys3top.mmi }
  295. OPTRACE "write_bitstream setup" END { }
  296. OPTRACE "write_bitstream" START { }
  297. write_bitstream -force basys3top.bit -bin_file
  298. OPTRACE "write_bitstream" END { }
  299. OPTRACE "write_bitstream misc" START { }
  300. OPTRACE "read constraints: write_bitstream_post" START { }
  301. OPTRACE "read constraints: write_bitstream_post" END { }
  302. catch {write_debug_probes -quiet -force basys3top}
  303. catch {file copy -force basys3top.ltx debug_nets.ltx}
  304. close_msg_db -file write_bitstream.pb
  305. } RESULT]
  306. if {$rc} {
  307. step_failed write_bitstream
  308. return -code error $RESULT
  309. } else {
  310. end_step write_bitstream
  311. unset ACTIVE_STEP
  312. }
  313. OPTRACE "write_bitstream misc" END { }
  314. OPTRACE "Phase: Write Bitstream" END { }
  315. OPTRACE "impl_1" END { }