Hog v10.55.0
post-bitstream.tcl
Go to the documentation of this file.
1 #!/usr/bin/env tclsh
2 # Copyright 2018-2026 The University of Birmingham
3 # Copyright 2018-2026 Max-Planck-Institute for Physics
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 
17 # @file
18 # The post bitstream script copies binary files, reports and other files to the bin directory in your repository.
19 # This script is automatically integrated into the Vivado/Quartus workflow by the Create Project script.
20 
21 # Libero sources this script inside a procedure: use the global variables.
22 global env auto_path
23 set old_path [pwd]
24 set tcl_path [file normalize "[file dirname [info script]]/.."]
25 source $tcl_path/hog.tcl
26 set repo_path [file normalize "$tcl_path/../../"]
27 
28 
29 # write_hw_platform has weird behavior when run in post-bitstream hook;
30 # workaround by launching a separate Vivado instance to run it
31 proc WriteHwPlatformWorkaround {proj_dir proj_name work_path hw_platform_args} {
32  set proj_file [file normalize "$proj_dir/$proj_name.xpr"]
33  set impl_run [file tail $work_path]
34  set tmp_script "$work_path/hog_write_hw_platform_tmp.tcl"
35 
36  set fp [open $tmp_script w]
37  puts $fp "open_project {$proj_file}"
38  puts $fp "open_run $impl_run"
39  puts $fp "write_hw_platform $hw_platform_args"
40  puts $fp "close_project"
41  close $fp
42 
43  Msg Info "Launching another Vivado instance to run write_hw_platform for $impl_run..."
44  set ret [catch {exec vivado -mode batch -notrace -source $tmp_script >@ stdout 2>@ stderr} result]
45 
46  if {$ret != 0} {
47  Msg Error "write_hw_platform failed in separate Vivado instance:\n$result"
48  } else {
49  Msg Info "write_hw_platform completed successfully in separate Vivado instance for $impl_run."
50  }
51  return $ret
52 }
53 
54 # Import tcllib
55 if {[IsLibero] || [IsDiamond]} {
56  if {[info exists env(HOG_TCLLIB_PATH)]} {
57  lappend auto_path $env(HOG_TCLLIB_PATH)
58  } else {
59  puts "ERROR: To run Hog with Microsemi Libero SoC, you need to define the HOG_TCLLIB_PATH variable."
60  return
61  }
62 }
63 
64 if {[info exists env(HOG_EXTERNAL_PATH)]} {
65  set ext_path $env(HOG_EXTERNAL_PATH)
66  Msg Info "Found environment variable HOG_EXTERNAL_PATH, setting path for external files to $ext_path..."
67 } else {
68  set ext_path ""
69 }
70 
71 set bin_dir [file normalize "$repo_path/bin"]
72 
73 if {[IsXilinx]} {
74  # Binary files are called .bit for ISE and for Vivado unless the chip is a Versal
75  set fw_file_ext "bit"
76 
77  # Vivado + PlanAhead
78  if {[IsISE]} {
79  # planAhead
80  set work_path [get_property DIRECTORY [get_runs impl_1]]
81  } else {
82  # Vivado
83  set work_path $old_path
84  if {[IsVersal [get_property PART [current_design]]]} {
85  #In Vivado if a Versal chip is used, the main binary file is called .pdi
86  set fw_file_ext "pdi"
87  }
88  }
89 
90  set main_files [lsort [glob -nocomplain "$work_path/*.$fw_file_ext"]]
91  if {[llength $main_files] > 1} {
92  #In case of segmented configuration on Versal there are 2 .pdi files: <top>_boot.pdi and <top>_pld.pdi
93  # Main file is the pld, so not the first
94  set main_file [file normalize [lindex $main_files 1]]
95  # Secondary file is the boot, so the first!
96  set secondary_file [file normalize [lindex $main_files 0]]
97  set main_file_suffix "_pld"
98  set secondary_file_suffix "_boot"
99  Msg Info "Found main and secondary binary file main: [file tail $main_file], secondary: [file tail $secondary_file]..."
100  # remove _pld suffix only at the end
101  set top_name [regsub $main_file_suffix\$ [file rootname [file tail $main_file]] ""]
102  if {[llength $main_files] > 2} {
103  Msg Warning "Multiple (more than 2) binary files found: $main_files."
104  }
105  } else {
106  set main_file [file normalize [lindex $main_files 0]]
107  set main_file_suffix ""
108  set secondary_file ""
109  set secondary_file_suffix ""
110  set top_name [file rootname [file tail $main_file]]
111  }
112 
113 
114  set proj_name [file tail [file normalize $work_path/../../]]
115  set proj_dir [file normalize "$work_path/../.."]
116 
117 
118  set additional_ext ".bin .ltx .bif .mmi"
119 
120  set xml_dir [file normalize "$work_path/../xml"]
121  set run_dir [file normalize "$work_path/.."]
122 } elseif {[IsQuartus]} {
123  # Quartus
124  ##nagelfar ignore Unknown variable
125  set proj_name [lindex $quartus(args) 1]
126  set proj_dir [pwd]
127  set xml_dir [file normalize "$repo_path/xml"]
128  set run_dir [file normalize "$proj_dir"]
129  set name [file rootname [file tail [file normalize [pwd]]]]
130  # programming object file
131  set pof_file [file normalize "$proj_dir/output_files/$proj_name.pof"]
132  # SRAM Object File
133  set sof_file [file normalize "$proj_dir/output_files/$proj_name.sof"]
134  # raw binary file
135  set rbf_file [file normalize "$proj_dir/output_files/$proj_name.rbf"]
136  #raw programming file
137  set rpd_file [file normalize "$proj_dir/output_files/$proj_name.rpd"]
138  # signal tap file
139  set stp_file [file normalize "$proj_dir/output_files/$proj_name.stp"]
140  #source and probes file
141  set spf_file [file normalize "$proj_dir/output_files/$proj_name.spf"]
142 } elseif {[IsLibero]} {
143  # Libero: sourced by GenerateBitstream, which provides run_folder.
144  set proj_dir [file normalize $run_folder]
145  set proj_name [file tail $proj_dir]
146  set project $proj_name
147  set sap_file [file normalize [lindex [glob -nocomplain "$proj_dir/synthesis/*.sap"] 0]]
148  set srd_file [file normalize [lindex [glob -nocomplain "$proj_dir/synthesis/*.srd"] 0]]
149  set srm_file [file normalize [lindex [glob -nocomplain "$proj_dir/synthesis/*.srm"] 0]]
150  set srs_file [file normalize [lindex [glob -nocomplain "$proj_dir/synthesis/*.srs"] 0]]
151  set srr_file [file normalize [lindex [glob -nocomplain "$proj_dir/synthesis/*.srr"] 0]]
152  set top_name [file rootname [file tail $srr_file]]
153  # Programming data written by GENERATEPROGRAMMINGDATA.
154  set map_file [file normalize "$proj_dir/designer/$top_name/$top_name.map"]
155  set stxt_files [glob -nocomplain "$proj_dir/synthesis/*.txt"]
156  set scsv_files [glob -nocomplain "$proj_dir/synthesis/*.csv"]
157  set slog_files [glob -nocomplain "$proj_dir/synthesis/*.log"]
158  set srpt_files [glob -nocomplain "$proj_dir/synthesis/*.rpt"]
159  set dtxt_files [glob -nocomplain "$proj_dir/designer/$top_name/*.txt"]
160  set dcsv_files [glob -nocomplain "$proj_dir/designer/$top_name/*.csv"]
161  set dlog_files [glob -nocomplain "$proj_dir/designer/$top_name/*.log"]
162  set drpt_files [glob -nocomplain "$proj_dir/designer/$top_name/*.rpt"]
163  set xml_dir [file normalize "$repo_path/xml"]
164 } elseif {[IsDiamond]} {
165  set proj_dir [file normalize "[pwd]/.."]
166  set proj_name [file tail $proj_dir]
167  set project $proj_name
168  set xml_dir [file normalize "$repo_path/xml"]
169  set main_file [file normalize "$proj_dir/Implementation0/${proj_name}_Implementation0"]
170 } else {
171  #tcl shell
172  set work_path $old_path
173  set fw_file [file normalize [lindex [glob -nocomplain "$work_path/*.bit"] 0]]
174  set proj_name [file tail [file normalize $work_path/../../]]
175  set proj_dir [file normalize "$work_path/../.."]
176 
177  set top_name [file rootname [file tail $fw_file]]
178 
179  set main_file [file normalize "$work_path/$top_name.bit"]
180  set bin_file [file normalize "$work_path/$top_name.bin"]
181  set ltx_file [file normalize "$work_path/$top_name.ltx"]
182 
183  set xml_dir [file normalize "$work_path/../xml"]
184  set run_dir [file normalize "$work_path/.."]
185 }
186 
187 set group_name [GetGroupName $proj_dir "$tcl_path/../.."]
188 # Go to repository path
189 cd $repo_path
190 
191 Msg Info "Evaluating Hog describe for $proj_name..."
192 set describe [GetHogDescribe [file normalize ./Top/$group_name/$proj_name] $repo_path]
193 Msg Info "Hog describe set to: $describe"
194 
195 set dst_dir [file normalize "$bin_dir/$group_name/$proj_name\-$describe"]
196 set dst_xml [file normalize "$dst_dir/xml"]
197 
198 Msg Info "Creating $dst_dir..."
199 file mkdir $dst_dir
200 
201 set ts [clock format [clock seconds] -format {%Y-%m-%d-%H-%M}]
202 
203 
204 # Vivado
205 if {[IsXilinx] && [file exists $main_file]} {
206  set dst_main [file normalize "$dst_dir/$proj_name$main_file_suffix\-$describe.$fw_file_ext"]
207  Msg Info "Copying main binary file $main_file into $dst_main..."
208  file copy -force $main_file $dst_main
209  if {$secondary_file != ""} {
210  set dst_secondary [file normalize "$dst_dir/$proj_name$secondary_file_suffix\-$describe.$fw_file_ext"]
211  Msg Info "Copying secondary binary file $secondary_file into $dst_secondary..."
212  file copy -force $secondary_file $dst_secondary
213  }
214 
215 
216  # Additional files
217  # In case of Segmented Configuration, there are 2 files per extension.
218 
219  set ltx_files {}
220  lappend ltx_files "$top_name.ltx"
221 
222  if {$main_file_suffix != ""} {
223  foreach e $additional_ext {
224  lappend new_ext $e
225  lappend new_ext $main_file_suffix$e
226  lappend new_ext $secondary_file_suffix$e
227  lappend ltx_files "$top_name$main_file_suffix.ltx"
228  lappend ltx_files "$top_name$secondary_file_suffix.ltx"
229  }
230  set additional_ext $new_ext
231  }
232 
233 
234  # LTX file for ILA, needs a special treatment...
235  foreach l $ltx_files {
236  set ltx_file "$work_path/$l"
237  Msg Info "Writing debug probes for $ltx_file..."
238  write_debug_probes -quiet $ltx_file
239  }
240 
241  foreach e $additional_ext {
242  set orig [file normalize "$work_path/$top_name$e"]
243  set dst [file normalize "$dst_dir/$proj_name\-$describe$e"]
244  if {[file exists $work_path/$top_name$e] == 1} {
245  Msg Info "Copying $orig file into $dst..."
246  file copy -force $orig $dst
247  } else {
248  Msg Debug "File: $orig not found."
249  }
250  }
251 } elseif {[IsQuartus]} {
252  set dst_pof [file normalize "$dst_dir/$name\-$describe.pof"]
253  set dst_sof [file normalize "$dst_dir/$name\-$describe.sof"]
254  set dst_rbf [file normalize "$dst_dir/$name\-$describe.rbf"]
255  set dst_rpd [file normalize "$dst_dir/$name\-$describe.rpd"]
256  set dst_stp [file normalize "$dst_dir/$name\-$describe.stp"]
257  set dst_spf [file normalize "$dst_dir/$name\-$describe.spf"]
258  set dst_xml [file normalize "$dst_dir/xml"]
259 
260  Msg Info "Evaluating differences with last commit..."
261  set found_uncommitted 0
262  set diff [Git diff]
263  if {$diff != ""} {
264  set found_uncommitted 1
265  Msg Warning "Found non committed changes:"
266  Msg Status "$diff"
267  set fp [open "$dst_dir/diff_postbistream.txt" w+]
268  puts $fp "$diff"
269  close $fp
270  }
271 
272  if {$found_uncommitted == 0} {
273  Msg Info "No uncommitted changes found."
274  }
275 
276  #pof file
277  if {[file exists $pof_file]} {
278  Msg Info "Copying pof file $pof_file into $dst_pof..."
279  file copy -force $pof_file $dst_pof
280  } else {
281  Msg Info "No pof file found: $pof_file, that is not a problem"
282  }
283 
284  #Reports
285  file mkdir $dst_dir/reports
286  set reps [glob -nocomplain "$proj_dir/output_files/*.rpt"]
287 
288  if {[file exists [lindex $reps 0]]} {
289  file copy -force {*}$reps $dst_dir/reports
290  } else {
291  Msg Warning "No reports found in $proj_dir/output_files subfolders"
292  }
293 
294  # sof File
295  if {[file exists $sof_file]} {
296  Msg Info "Copying sof file $sof_file into $dst_sof..."
297  file copy -force $sof_file $dst_sof
298  } else {
299  Msg Info "No sof file found: $sof_file, that is not a problem"
300  }
301 
302 
303  #rbf rpd
304  if {[file exists $rbf_file] || [file exists $rpd_file]} {
305  if {[file exists $rbf_file]} {
306  file copy -force $rbf_file $dst_rbf
307  }
308  if {[file exists $rpd_file]} {
309  file copy -force $rpd_file $dst_rpd
310  }
311  } else {
312  Msg Info "No rbf or rpd file found: this is not a problem"
313  }
314 
315  # stp and spf File
316  if {[file exists $stp_file] || [file exists $spf_file]} {
317  if {[file exists $stp_file]} {
318  file copy -force $stp_file $dst_stp
319  }
320  if {[file exists $spf_file]} {
321  file copy -force $spf_file $dst_spf
322  }
323  } else {
324  Msg Info "No stp or spf file found: that is not a problem"
325  }
326 } elseif {[IsLibero]} {
327  set dst_map [file normalize "$dst_dir/$project\-$describe.map"]
328  set dst_sap [file normalize "$dst_dir/$project\-$describe.sap"]
329  set dst_srd [file normalize "$dst_dir/$project\-$describe.srd"]
330  set dst_srm [file normalize "$dst_dir/$project\-$describe.srm"]
331  set dst_srs [file normalize "$dst_dir/$project\-$describe.srs"]
332  set dst_srr [file normalize "$dst_dir/$project\-$describe.srr"]
333  set dst_rpt [file normalize "$dst_dir/reports"]
334  set dst_xml [file normalize "$dst_dir/xml"]
335 
336  file mkdir $dst_dir/reports
337 
338  if {[file exists $map_file]} {
339  Msg Info "Copying map file $map_file into $dst_map..."
340  file copy -force $map_file $dst_map
341  }
342 
343  if {[file exists $sap_file]} {
344  Msg Info "Copying sap file $sap_file into $dst_sap..."
345  file copy -force $sap_file $dst_sap
346  }
347 
348  if {[file exists $srd_file]} {
349  Msg Info "Copying srd file $srd_file into $dst_srd..."
350  file copy -force $srd_file $dst_srd
351  }
352 
353  if {[file exists $srm_file]} {
354  Msg Info "Copying srm file $srm_file into $dst_srm..."
355  file copy -force $srm_file $dst_srm
356  }
357 
358  if {[file exists $srs_file]} {
359  Msg Info "Copying srs file $srs_file into $dst_srs..."
360  file copy -force $srs_file $dst_srs
361  }
362 
363  if {[file exists $srr_file]} {
364  Msg Info "Copying srr file $srr_file into $dst_srr..."
365  file copy -force $srr_file $dst_srr
366  }
367 
368 
369  # One file at a time: "file copy {*}$list" fails when a list is empty.
370  set reports [concat $stxt_files $scsv_files $slog_files $srpt_files \
371  $dtxt_files $dcsv_files $dlog_files $drpt_files]
372  Msg Info "Copying [llength $reports] synthesis and implementation reports into $dst_rpt..."
373  foreach report $reports {
374  file copy -force $report $dst_rpt
375  }
376 } elseif {[IsDiamond]} {
377  set dst_main [file normalize "$dst_dir/$proj_name\-$describe.bit"]
378  Msg Info "Copying main binary file $main_file.bit into $dst_main..."
379  file copy -force $main_file.bit $dst_main
380  Msg Info "Copying binary generation log $main_file.bgn into $dst_dir/reports..."
381  file copy -force $main_file.bgn $dst_dir/reports
382 } else {
383  Msg CriticalWarning "Firmware binary file not found."
384 }
385 
386 
387 # IPbus XML
388 if {[file exists $xml_dir]} {
389  Msg Info "XML directory found, copying xml files from $xml_dir to $dst_xml..."
390  if {[file exists $dst_xml]} {
391  Msg Info "Directory $dst_xml exists, deleting it..."
392  file delete -force $dst_xml
393  }
394  file copy -force $xml_dir $dst_xml
395 }
396 
397 # XSA export (Zynq/Versal SoCs, or soft processors such as MicroBlaze/RISC-V)
398 if {[IsXilinx]} {
399  # auto-enable for Zynq/Versal parts, or when an app targets a soft processor
400  set export_xsa "NONE"
401  set part [get_property part [current_project]]
402 
403  # check for explicit EXPORT_XSA flag in hog.conf
404  set properties [ReadConf [lindex [GetConfFiles $repo_path/Top/$group_name/$proj_name] 0]]
405  if {[dict exists $properties "hog"]} {
406  set propDict [dict get $properties "hog"]
407  if {[dict exists $propDict "EXPORT_XSA"]} {
408  set export_xsa [dict get $propDict "EXPORT_XSA"]
409  }
410  }
411 
412  if {$export_xsa == "NONE"} {
413  set export_xsa false
414  if {([IsZynq $part] || [IsVersal $part])} {
415  Msg Info "SoC FPGA detected (Zynq or Versal), automatically enabling XSA file creation. \
416  To disable it, add 'EXPORT_XSA = false' in the \[hog\] section of hog.conf."
417  set export_xsa true
418  } else {
419  # MicroBlaze/RISC-V soft processors are not detectable from the part name.
420  # If an app targets one, export XSA so the ELF can be rebuilt and merged
421  # into the bitstream (same flow as Zynq/Versal software rebuild)
422  set apps [GetAppsFromProps $properties]
423  dict for {app_name app_conf} $apps {
424  if {
425  [dict exists $app_conf "proc"] &&
426  [regexp -nocase {microblaze|risc} [dict get $app_conf "proc"]]
427  } {
428  Msg Info "Soft processor ([dict get $app_conf proc]) detected in app '$app_name', \
429  automatically enabling XSA file creation. \
430  To disable it, add 'EXPORT_XSA = false' in the \[hog\] section of hog.conf."
431  set export_xsa true
432  break
433  }
434  }
435  }
436  }
437 
438  if {[string compare [string tolower $export_xsa] "true"] == 0} {
439  set wrote_xsa 0
440 
441  # There is a bug in Vivado 2020.1, check for that version and warn
442  # that we can't export XSAs
443  regexp -- {Vivado v([0-9]{4}\.[0-9,A-z,_,\.]*) } [version] -> VIVADO_VERSION
444  if {[string compare "2020.1" $VIVADO_VERSION] == 0} {
445  Msg Warning "Vivado 2020.1, a patch must be applied to Vivado to export XSA Files, c.f. https://www.xilinx.com/support/answers/75210.html"
446  } else {
447  set dst_xsa [file normalize "$dst_dir/${proj_name}\-$describe.xsa"]
448  Msg Info "Generating XSA File at $dst_xsa"
449 
450  if {[IsVersal $part]} {
451  # Run user pre-platform file
452  set user_pre_platform_file "./Top/$group_name/$proj_name/pre-platform.tcl"
453  if {[file exists $user_pre_platform_file]} {
454  Msg Info "Sourcing user pre-platform file $user_pre_platform_file"
455  source $user_pre_platform_file
456  }
457 
458  # We do not want to touch the full_pdi_file property if there is a _boot .pdi file
459  if {$secondary_file == ""} {
460  set pdi_post_imp [file normalize "$work_path/$top_name.pdi"]
461  set_property platform.full_pdi_file $pdi_post_imp [current_project]
462  Msg Info "XSA file will be generated for Versal with this PDI: $pdi_post_imp"
463  WriteHwPlatformWorkaround $proj_dir $proj_name $work_path "-fixed -force -file {$dst_xsa}"
464  set wrote_xsa 1
465  }
466  Msg Warning "No XSA will be produced in post-bitream for segmented configuration mode. \
467  If you're running with the GUI, please type the following on the Tcl console: write_hw_platform -fixed -force -file $dst_xsa."
468  } else {
469  # We leave include bit also for Versal
470  WriteHwPlatformWorkaround $proj_dir $proj_name $work_path \
471  "-include_bit -fixed -force -file {$dst_xsa}"
472  set wrote_xsa 1
473  }
474  }
475 
476  if {$wrote_xsa == 1} {
477  # Determine project type from configuration file
478  set conf_file [lindex [GetConfFiles $repo_path/Top/$group_name/$proj_name] 0]
479  set is_vitis_classic 0
480  set is_vitis_unified 0
481 
482  if {[file exists $conf_file]} {
483  set ide_name_and_ver [GetIDEFromConf $conf_file]
484  set ide_name [string tolower [lindex $ide_name_and_ver 0]]
485  if {[string match "*vitis_classic*" $ide_name] || [string match "*vivado_vitis_classic*" $ide_name]} {
486  set is_vitis_classic 1
487  } elseif {[string match "*vitis_unified*" $ide_name] || [string match "*vivado_vitis_unified*" $ide_name]} {
488  set is_vitis_unified 1
489  }
490  }
491 
492  if {$is_vitis_classic || $is_vitis_unified} {
493  Msg Info "XSA file written to $dst_xsa"
494 
495  set full_proj_name [file join $group_name $proj_name]
496 
497  # Determine command based on project type
498  if {$is_vitis_classic} {
499  set vitis_cmd "xsct $tcl_path/launch.tcl CW -xsa $dst_xsa -vitis_only $full_proj_name"
500  set vitis_type "Vitis Classic"
501  set error_prefix "xsct (vitis classic)"
502  } elseif {$is_vitis_unified} {
503  # Keep the log of the spawned process so that a failure in it can be diagnosed
504  set vitis_log [file normalize "$proj_dir/vitis_unified_build.log"]
505  set vitis_jou [file normalize "$proj_dir/vitis_unified_build.jou"]
506  set vitis_cmd "vivado -mode batch -notrace \
507  -log $vitis_log -journal $vitis_jou \
508  -source $tcl_path/launch.tcl \
509  -tclargs CW -xsa $dst_xsa -vitis_only $full_proj_name"
510  set vitis_type "Vitis Unified"
511  set error_prefix "vivado (for vitis unified)"
512  } else {
513  Msg Error "No Vitis project type found."
514  return
515  }
516 
517  Msg Info "Running $vitis_type to create elf file with cmd: $vitis_cmd"
518  set ret [catch {exec -ignorestderr {*}$vitis_cmd >@ stdout} result]
519  if {$ret != 0} {
520  Msg Error "$error_prefix returned an error state: $result"
521  }
522 
523  # Copy ELF files from Vitis build output into bin directory
524  # Extract app names preserving original case from hog.conf,
525  # since Vitis creates directories matching the original case
526  set app_names [list]
527  foreach prop_key [dict keys $properties] {
528  if {[regexp {^app:(.+)$} $prop_key -> raw_app_name]} {
529  lappend app_names [string trim $raw_app_name]
530  }
531  }
532  foreach app_name $app_names {
533  if {$is_vitis_unified} {
534  set elf_src [file normalize "$repo_path/Projects/$full_proj_name/vitis_unified/$app_name/build/$app_name.elf"]
535  } else {
536  set elf_src [file normalize "$repo_path/Projects/$full_proj_name/vitis_classic/$app_name/Release/$app_name.elf"]
537  }
538  set elf_dst [file normalize "$dst_dir/${proj_name}\-${app_name}\-$describe.elf"]
539  if {[file exists $elf_src]} {
540  Msg Info "Copying ELF $elf_src into $elf_dst..."
541  file copy -force $elf_src $elf_dst
542  } else {
543  Msg Warning "ELF file not found: $elf_src"
544  }
545  }
546 
547  # Process ELF files and update bitstream with memory content
548  set mmi_file [file normalize "$dst_dir/${proj_name}\-$describe.mmi"]
549  GenerateBootArtifacts $properties $repo_path $proj_dir $dst_dir $proj_name $describe $dst_main $mmi_file
550  }
551  }
552  }
553 }
554 
555 
556 # Run user post-bitstream file
557 set user_post_bitstream_file "./Top/$group_name/$proj_name/post-bitstream.tcl"
558 if {[file exists $user_post_bitstream_file]} {
559  Msg Info "Sourcing user post-bitstream file $user_post_bitstream_file"
560  source $user_post_bitstream_file
561 }
562 
563 Notify Info "Completed bitstream of $proj_name."
564 
565 cd $old_path
566 Msg Info "All done."