22 {no_bitstream "If set, the bitstream file will not be produced."}
23 {recreate "If set, the project will be re-created if it already exists."}
24 {no_reset "If set, runs (synthesis and implementation) won't be reset before launching them."}
25 {check_syntax "If set, the HDL syntax will be checked at the beginning of the workflow."}
26 {njobs.arg 4 "Number of jobs. Default: 4"}
27 {ext_path.arg "" "Sets the absolute path for the external libraries."}
28 {lib.arg "" "Compiled simulation library path"}
29 {synth_only "If set, only the synthesis will be performed."}
30 {impl_only "If set, only the implementation will be performed. This assumes synthesis should was already done."}
31 {simset.arg "" "Simulation sets, separated by commas, to be run."}
32 {verbose "If set, launch the script in verbose mode"}
35 set usage " \[OPTIONS\] <directive> <project>\n The most common <directive> values are CREATE (or C), WORKFLOW (or W), SIMULATE (or S).
37 ** Directives (case insensitive):
38 - CREATE or C: Create the project, replacing it if already existing.
39 - WORKFLOW or W: Launches the complete workflow, creates the project if not existing.
40 - CREATEWORKFLOW or CW: Creates the project -even if existing- and launches the complete workflow.
41 - SIMULATE or S: Simulate the project, creating it if not existing.
42 - IMPLEMENT: Runs the implementation only, the project must already exist and be synthesised.
43 - SYNTHESIS: Runs the synthesis only, creates the project if not existing.
44 - LIST or L: Only list all the projects
47 set tcl_path [
file normalize "[
file dirname [
info script]]"]
48 source $tcl_path/hog.tcl
52 set argv $quartus(args)
55 Msg Debug "s: $::argv0 a: $argv"
57 lassign [
InitLauncher $::argv0 $tcl_path $parameters $usage $argv] directive project project_name group_name repo_path old_path bin_dir top_path commands_path cmd ide
59 Msg Debug "Returned by InitLauncher: $project $project_name $group_name $repo_path $old_path $bin_dir $top_path $commands_path $cmd"
62 append usage "\n** Options:"
65 set do_implementation 0
set do_synthesis 0
set do_bitstream 0
set do_create 0
set do_compile 0
set do_simulation 0
set recreate 0
set reset 1
67 set default_commands {
74 \^I(MPL(EMENT(ATION)?)?)?$ {
75 set do_implementation 1
80 \^SYNT(H(ESIS(E)?)?)? {
85 \^S(IM(ULAT(ION|E)?)?)?$ {
91 set do_implementation 1
97 \^(CREATEWORKFLOW|CW)$ {
98 set do_implementation 1
106 Msg Status "ERROR: Unknown directive $directive.\n\n[cmdline::usage $parameters $usage]"
113 Msg Debug "Looking for a $directive in : $default_commands $custom_commands"
114 switch -regexp -- $directive "$default_commands $custom_commands"
118 Msg Status "\n\nPossible projects are:"
122 }
elseif {$cmd == -2} {
124 Msg Status "ERROR: You must specify a project with directive $directive.\n\n[
cmdline::usage $parameters $usage]"
125 Msg Status "\n Possible projects are:"
130 }
elseif {$cmd == 0} {
132 Msg Info "$::argv0 was launched from the IDE."
136 Msg Info "Launching command: $cmd..."
139 set ret [
catch {
exec which $ide}]
141 Msg Error "$ide not found in your system. Make sure to add $ide to your PATH enviromental variable."
145 if {[
string first libero $cmd] >= 0} {
148 set libero_script [open "launch-libero-hog.sh" w]
149 puts $libero_script "#!/bin/sh"
150 puts $libero_script $cmd
152 set cmd "sh launch-libero-hog.sh"
157 set ret [
catch {
exec -ignorestderr {*}$cmd >@ stdout} result]
160 Msg Error "IDE returned an error state."
166 if {[
string first libero $cmd] >= 0} {
167 file delete "launch-libero-hog.sh"
178 if {[
info exists env(HOG_TCLLIB_PATH)]} {
179 lappend auto_path $env(HOG_TCLLIB_PATH)
181 puts "ERROR: To run Hog with Microsemi Libero SoC, you need to define the HOG_TCLLIB_PATH variable."
186 if {[
catch {
package require cmdline} ERROR] || [
catch {
package require struct::matrix} ERROR]} {
187 puts "$ERROR\n Tcllib not found. If you are running this script on tclsh for debuggin purpose ONLY, you can fix this by installing 'tcllib'"
191 lassign [
GetOptions $::argv $parameters $usage] option_list arg_list
193 if {[
catch {
array set options [
cmdline::getoptions option_list $parameters $usage]}] || [
llength $arg_list] != 2 } {
197 set main_folder [
file normalize "$repo_path/Projects/$project_name/$project.runs/"]
199 set main_folder [
file normalize "$repo_path/Projects/$project_name/"]
201 set main_sim_folder [
file normalize "$repo_path/Projects/$project_name/$project.sim/"]
207 set project_path [
file normalize "$repo_path/Projects/$project_name/"]
211 if { $options(no_bitstream) == 1 } {
216 if { $options(recreate) == 1 } {
220 if { $options(synth_only) == 1} {
221 set do_implementation 0
228 if { $options(impl_only) == 1} {
229 set do_implementation 0
237 if { $options(no_reset) == 1 } {
241 if { $options(check_syntax) == 1 } {
245 if { $do_simulation == 1 } {
246 set simsets $options(simset)
249 if { $options(ext_path) != ""} {
250 set ext_path $options(ext_path)
253 if {$options(lib)!= ""} {
254 set lib_path [
file normalize $options(lib)]
256 if {[
info exists env(HOG_SIMULATION_LIB_PATH)]} {
257 set lib_path $env(HOG_SIMULATION_LIB_PATH)
259 if {[
file exists "$repo_path/SimulationLib"]} {
260 set lib_path [
file normalize "$repo_path/SimulationLib"]
269 if { $options(verbose) == 1 } {
270 variable ::DEBUG_MODE 1
273 Msg Info "Number of jobs set to $options(njobs)."
285 set project_file [
file normalize $repo_path/Projects/$project_name/$project.ppr]
287 set project_file [
file normalize $repo_path/Projects/$project_name/$project.xpr]
290 if {[
file exists $project_file]} {
291 Msg Info "Found project file $project_file for $project_name."
294 Msg Info "Project file not found for $project_name."
298 if {($proj_found == 0 || $recreate == 1) && ($do_synthesis == 1 || $do_create == 1)} {
299 Msg Info "Creating (possibly replacing) the project $project_name..."
300 lassign [
GetConfFiles $repo_path/Top/$project_name] conf sim pre post
302 if {[
file exists $conf]} {
304 CreateProject -simlib_path $lib_path $project_name $repo_path
306 Msg Error "Project $project_name is incomplete: no hog.conf file found, please create one..."
309 Msg Info "Opening existing project file $project_file..."
310 file mkdir "$repo_path/Projects/$project_name/$project.gen/sources_1"
311 open_project $project_file
315 if { $check_syntax == 1 } {
317 Msg Info "Checking syntax option is not supported by Xilinx PlanAhead. Skipping.."
319 Msg Info "Checking syntax for project $project_name..."
320 set syntax [check_syntax -return_string]
322 if {[
string first "CRITICAL" $syntax] != -1} {
328 Msg Debug "Skipping syntax check for project $project_name"
332 if {$reset == 1 && $do_create == 0} {
333 Msg Info "Resetting run before launching synthesis..."
339 source $tcl_path/../../Hog/Tcl/integrated/pre-synthesis.tcl
342 if {$do_synthesis == 1} {
343 launch_runs synth_1 -jobs $options(njobs) -dir $main_folder
345 set prog [get_property PROGRESS [get_runs synth_1]]
346 set status [get_property STATUS [get_runs synth_1]]
347 Msg Info "Run: synth_1 progress: $prog, status : $status"
355 lassign [
GetRepoVersions [
file normalize ./Top/$project_name] $repo_path $ext_path] sha
357 Msg Info "Git describe set to $describe"
360 set xci_file [get_property IP_FILE $ip]
362 set xci_path [
file dirname $xci_file]
363 set xci_ip_name [
file rootname [
file tail $xci_file]]
364 foreach rptfile [glob -nocomplain -directory $xci_path *.rpt] {
365 file copy $rptfile $bin_dir/$project_name-$describe/reports
390 if {$prog ne "100%"} {
391 Msg Error "Synthesis error, status is: $status"
394 Msg Debug "Skipping synthesis (and IP handling)..."
399 if {$do_implementation == 1 } {
401 Msg Info "Starting implementation flow..."
402 if { $reset == 1 && $do_create == 0} {
403 Msg Info "Resetting run before launching implementation..."
407 if {[
IsISE]} {source $tcl_path/../../Hog/Tcl/integrated/pre-implementation.tcl}
408 launch_runs impl_1 -jobs $options(njobs) -dir $main_folder
410 if {[
IsISE]} {source $tcl_path/../../Hog/Tcl/integrated/post-implementation.tcl}
412 set prog [get_property PROGRESS [get_runs impl_1]]
413 set status [get_property STATUS [get_runs impl_1]]
414 Msg Info "Run: impl_1 progress: $prog, status : $status"
419 set status_file [open "$main_folder/timing.txt" "w"]
420 puts $status_file "## $project_name Timing summary"
422 set f [open [
lindex [glob "$main_folder/impl_1/*.twr" 0]]]
424 while {[
gets $f line] >= 0} {
425 if { [
string match "Timing summary:" $line] } {
426 while {[
gets $f line] >= 0} {
427 if { [
string match "Timing errors:*" $line] } {
428 set errs [regexp -inline -- {[0-9]+} $line]
430 if { [
string match "*Footnotes*" $line] } {
433 puts $status_file "$line"
442 Msg Info "Time requirements are met"
443 file rename -force "$main_folder/timing.txt" "$main_folder/timing_ok.txt"
446 Msg CriticalWarning "Time requirements are NOT met"
447 file rename -force "$main_folder/timing.txt" "$main_folder/timing_error.txt"
453 set wns [get_property STATS.WNS [get_runs [current_run]]]
454 set tns [get_property STATS.TNS [get_runs [current_run]]]
455 set whs [get_property STATS.WHS [get_runs [current_run]]]
456 set ths [get_property STATS.THS [get_runs [current_run]]]
458 if {$wns >= 0 && $whs >= 0} {
459 Msg Info "Time requirements are met"
460 set status_file [open "$main_folder/timing_ok.txt" "w"]
463 Msg CriticalWarning "Time requirements are NOT met"
464 set status_file [open "$main_folder/timing_error.txt" "w"]
468 Msg Status "*** Timing summary ***"
469 Msg Status "WNS: $wns"
470 Msg Status "TNS: $tns"
471 Msg Status "WHS: $whs"
472 Msg Status "THS: $ths"
478 puts $status_file "## $project_name Timing summary"
480 m add row "| **Parameter** | \"**value (ns)**\" |"
481 m add row "| --- | --- |"
482 m add row "| WNS: | $wns |"
483 m add row "| TNS: | $tns |"
484 m add row "| WHS: | $whs |"
485 m add row "| THS: | $ths |"
487 puts $status_file [m format 2string]
488 puts $status_file "\n"
489 if {$timing_ok == 1} {
490 puts $status_file " Time requirements are met."
492 puts $status_file "Time requirements are **NOT** met."
494 puts $status_file "\n\n"
498 if {$prog ne "100%"} {
499 Msg Error "Implementation error"
502 if {$do_bitstream == 1} {
503 Msg Info "Starting write bitstream flow..."
506 Msg Info "running pre-bitstream"
507 source $tcl_path/../../Hog/Tcl/integrated/pre-bitstream.tcl
508 launch_runs impl_1 -to_step Bitgen $options(njobs) -dir $main_folder
510 Msg Info "running post-bitstream"
511 source $tcl_path/../../Hog/Tcl/integrated/post-bitstream.tcl
512 }
elseif { [
string first Vivado [version]] ==0} {
514 launch_runs impl_1 -to_step [
BinaryStepName [get_property PART [current_project]]] $options(njobs) -dir $main_folder
518 set prog [get_property PROGRESS [get_runs impl_1]]
519 set status [get_property STATUS [get_runs impl_1]]
520 Msg Info "Run: impl_1 progress: $prog, status : $status"
522 if {$prog ne "100%"} {
523 Msg Error "Write bitstream error, status is: $status"
527 Msg Status "*** Timing summary (again) ***"
528 Msg Status "WNS: $wns"
529 Msg Status "TNS: $tns"
530 Msg Status "WHS: $whs"
531 Msg Status "THS: $ths"
538 lassign [
GetRepoVersions [
file normalize ./Top/$project_name] $repo_path] sha
540 Msg Info "Git describe set to $describe"
542 set dst_dir [
file normalize "$bin_dir/$project_name\-$describe"]
547 if {[
file exists $main_folder/versions.txt]} {
548 file copy -force $main_folder/versions.txt $dst_dir
550 Msg Warning "No versions file found in $main_folder/versions.txt"
553 set timing_files [ glob -nocomplain "$main_folder/timing_*.txt"]
554 set timing_file [
file normalize [
lindex $timing_files 0]]
556 if {[
file exists $timing_file]} {
557 file copy -force $timing_file $dst_dir/
559 Msg Warning "No timing file found, not a problem if running locally"
564 if {$do_simulation == 1} {
567 if {$simsets != ""} {
568 set simsets_todo [
split $simsets ","]
569 Msg Info "Will run only the following simsets (if they exist): $simsets_todo"
574 set sim_dic [dict create]
576 Msg Info "Retrieving list of simulation sets..."
577 foreach s [get_filesets] {
578 set type [get_property FILESET_TYPE $s]
579 if {$type eq "SimulationSrcs"} {
580 if {$simsets_todo != "" && $s ni $simsets_todo} {
581 Msg Info "Skipping $s as it was not specified with the -simset option..."
584 if {[
file exists "$repo_path/Top/$project_name/list/$s.sim"]} {
585 set fp [open "$repo_path/Top/$project_name/list/$s.sim" r]
586 set file_data [read $fp]
588 set data [
split $file_data "\n"]
589 set n [
llength $data]
590 Msg Info "$n lines read from $s.sim"
592 set firstline [
lindex $data 0]
594 if { [regexp {^ *\#Simulator} $firstline] } {
595 set simulator_prop [regexp -all -inline {\S+} $firstline]
596 set simulator [
string tolower [
lindex $simulator_prop 1]]
598 Msg Warning "Simulator not set in $s.sim. The first line of $s.sim should be #Simulator <SIMULATOR_NAME>, where <SIMULATOR_NAME> can be xsim, questa, modelsim, riviera, activehdl, ies, or vcs, e.g. #Simulator questa. Setting simulator by default as xsim."
601 if {$simulator eq "skip_simulation"} {
602 Msg Info "Skipping simulation for $s"
605 set_property "target_simulator" $simulator [current_project]
606 Msg Info "Creating simulation scripts for $s..."
607 if { [
file exists $repo_path/Top/$project_name/pre-simulation.tcl] } {
608 Msg Info "Running $repo_path/Top/$project_name/pre-simulation.tcl"
609 source $repo_path/Top/$project_name/pre-simulation.tcl
611 if { [
file exists $repo_path/Top/$project_name/pre-$s-simulation.tcl] } {
612 Msg Info "Running $repo_path/Top/$project_name/pre-$s-simulation.tcl"
613 source Running $repo_path/Top/$project_name/pre-$s-simulation.tcl
615 current_fileset -simset $s
616 set sim_dir $main_sim_folder/$s/behav
617 if { ([
string tolower $simulator] eq "xsim") } {
618 set sim_name "xsim:$s"
619 if { [
catch { launch_simulation -simset [get_filesets $s]} log] } {
620 Msg CriticalWarning "Simulation failed for $s, error info: $::errorInfo"
621 lappend failed $sim_name
623 lappend success $sim_name
626 Msg Info "Simulation library path is set to $lib_path."
628 if {!([
file exists $lib_path])} {
629 Msg Warning "Could not find simulation library path: $lib_path, $simulator simulation will not work."
633 if {$simlib_ok == 1} {
634 set_property "compxlib.${simulator}_compiled_library_dir" [
file normalize $lib_path] [current_project]
635 launch_simulation -scripts_only -simset [get_filesets $s]
636 set top_name [get_property TOP $s]
637 set sim_script [
file normalize $sim_dir/$simulator/]
638 Msg Info "Adding simulation script location $sim_script for $s..."
639 lappend sim_scripts $sim_script
640 dict append sim_dic $sim_script $s
642 Msg Error "Cannot run $simulator simulations without a valid library path"
650 if {[
info exists sim_scripts]} {
652 Msg Info "Generating IP simulation targets, if any..."
654 foreach ip [get_ips] {
655 generate_target simulation -quiet $ip
660 Msg Info "====== Starting simulations runs ======"
663 foreach s $sim_scripts {
666 Msg Info " ************* Compiling: $s ************* "
668 set sim_name "comp:[dict get $sim_dic $s]"
670 Msg CriticalWarning "Compilation failed for $s, error info: $::errorInfo"
671 lappend failed $sim_name
673 lappend success $sim_name
675 Msg Info "###################### Compilation log starts ######################"
676 Msg Info "\n\n$log\n\n"
677 Msg Info "###################### Compilation log ends ######################"
680 if { [
file exists "./elaborate.sh"] } {
681 set cmd ./elaborate.sh
682 Msg Info " ************* Elaborating: $s ************* "
684 set sim_name "elab:[dict get $sim_dic $s]"
686 Msg CriticalWarning "Elaboration failed for $s, error info: $::errorInfo"
687 lappend failed $sim_name
689 lappend success $sim_name
691 Msg Info "###################### Elaboration log starts ######################"
692 Msg Info "\n\n$log\n\n"
693 Msg Info "###################### Elaboration log ends ######################"
695 set cmd ./simulate.sh
696 Msg Info " ************* Simulating: $s ************* "
700 if {[
info exists env(HOG_SIMPASS_STR)]} {
701 Msg Info "Searching for simulation pass string: '$env(HOG_SIMPASS_STR)'"
702 if {[
string first $env(HOG_SIMPASS_STR) $log] == -1} {
707 set sim_name "sim:[dict get $sim_dic $s]"
709 Msg CriticalWarning "Simulation failed for $s, error info: $::errorInfo"
710 lappend failed $sim_name
712 lappend success $sim_name
714 Msg Info "###################### Simulation log starts ######################"
715 Msg Info "\n\n$log\n\n"
716 Msg Info "###################### Simulation log ends ######################"
722 if {[
llength $success] > 0} {
723 set successes [
join $success "\n"]
724 Msg Info "The following simulation sets were successful:\n\n$successes\n\n"
727 if {[
llength $failed] > 0} {
728 set failures [
join $failed "\n"]
729 Msg Error "The following simulation sets have failed:\n\n$failures\n\n"
731 }
elseif {[
llength $success] > 0} {
732 Msg Info "All the [
llength $success] compilations, elaborations and simulations were successful."
735 Msg Info "Simulation done."
748 if { [
catch {
package require ::quartus::project} ERROR] } {
749 Msg Error "$ERROR\n Can not find package ::quartus::project"
753 Msg Info "Loaded package ::quartus::project"
756 if {[
file exists "$project_path/$project.qpf"]} {
757 Msg Info "Found project file $project.qpf for $project_name."
760 Msg Warning "Project file not found for $project_name."
764 if { $proj_found == 0 || $recreate == 1 || $do_create == 1} {
765 Msg Info "Creating (possibly replacing) the project $project_name..."
766 lassign [
GetConfFiles $repo_path/Top/$project_name] conf sim pre post tcl_file
768 if {[
file exists $conf]} {
769 CreateProject -simlib_path $lib_path $project_name $repo_path
771 Msg Error "Project $project_name is incomplete: not Tcl file or hog.conf file found."
775 if {[
file exists "$project_path"]} {
778 Msg Error "Project directory not found for $project_name."
782 if { ![is_project_open] } {
783 Msg Info "Opening existing project file $project_name..."
784 project_open $project -current_revision
787 Msg Info "Number of jobs set to $options(njobs)."
788 set_global_assignment -name NUM_PARALLEL_PROCESSORS $options(njobs)
795 if { $check_syntax == 1 } {
796 Msg Info "Checking syntax for project $project_name..."
797 lassign [
GetHogFiles -list_files "*.src" "$repo_path/Top/$project_name/list/" $repo_path] src_files dummy
798 dict for {lib files} $src_files {
800 set file_extension [file extension $f]
801 if { $file_extension == ".vhd" || $file_extension == ".vhdl" || $file_extension == ".v" || $file_extension == ".sv" } {
802 if { [catch {execute_module -tool map -args "--analyze_file=$f"} result]} {
803 Msg Error "\nResult: $result\n"
804 Msg Error "Check syntax failed.\n"
806 if { $result == "" } {
807 Msg Info "Check syntax was successful for $f.\n"
809 Msg Warning "Found syntax error in file $f:\n $result\n"
818 lassign [
GetRepoVersions [
file normalize $repo_path/Top/$project_name] $repo_path] sha
821 set revision [get_current_revision]
822 if { $do_compile == 1 } {
823 if {[
catch {execute_flow -compile} result]} {
824 Msg Error "Result: $result\n"
825 Msg Error "Full compile flow failed. See the report file.\n"
827 Msg Info "Full compile Flow was successful for revision $revision.\n"
829 if {[
file exists "output_files/versions.txt"]} {
830 set dst_dir [
file normalize "$repo_path/bin/$project_name\-$describe"]
832 file copy -force "output_files/versions.txt" $dst_dir
838 if { $do_synthesis == 1 } {
842 set tool_and_command [
split [get_global_assignment -name PRE_FLOW_SCRIPT_FILE] ":"]
843 set tool [
lindex $tool_and_command 0]
844 set pre_flow_script [
lindex $tool_and_command 1]
845 set cmd "$tool -t $pre_flow_script quartus_map $project $revision"
851 Msg Warning "Can not execute command $cmd"
852 Msg Warning "LOG: $log"
854 Msg Info "Pre flow script executed!"
858 if { ![is_project_open] } {
859 Msg Info "Re-opening project file $project_name..."
860 project_open $project -current_revision
864 if {[
catch {execute_module -tool map -args "--parallel"} result]} {
865 Msg Error "Result: $result\n"
866 Msg Error "Analysis & Synthesis failed. See the report file.\n"
868 Msg Info "Analysis & Synthesis was successful for revision $revision.\n"
874 if { $do_implementation == 1 } {
875 if {[
catch {execute_module -tool fit} result]} {
876 Msg Error "Result: $result\n"
877 Msg Error "Place & Route failed. See the report file.\n"
879 Msg Info "\nINFO: Place & Route was successful for revision $revision.\n"
884 if { $do_bitstream == 1 } {
885 if {[
catch {execute_module -tool asm} result]} {
886 Msg Error "Result: $result\n"
887 Msg Error "Generate bitstream failed. See the report file.\n"
889 Msg Info "Generate bitstream was successful for revision $revision.\n"
896 if {[
catch {execute_module -tool sta -args "--do_report_timing"} result]} {
897 Msg Error "Result: $result\n"
898 Msg Error "Time Quest failed. See the report file.\n"
900 Msg Info "Time Quest was successfully run for revision $revision.\n"
903 set panel "Timing Analyzer||Timing Analyzer Summary"
904 set device [ get_report_panel_data -name $panel -col 1 -row_name "Device Name"]
905 set timing_model [ get_report_panel_data -name $panel -col 1 -row_name "Timing Models"]
906 set delay_model [ get_report_panel_data -name $panel -col 1 -row_name "Delay Model"]
908 Msg Info "*******************************************************************"
909 Msg Info "Device: $device"
910 Msg Info "Timing Models: $timing_model"
911 Msg Info "Delay Model: $delay_model"
914 Msg Info "*******************************************************************"
925 set project_file [
file normalize $repo_path/Projects/$project_name/$project.prjx]
927 if {[
file exists $project_file]} {
928 Msg Info "Found project file $project_file for $project_name."
931 Msg Info "Project file not found for $project_name."
935 if {($proj_found == 0 || $recreate == 1) && ($do_synthesis == 1 || $do_create == 1)} {
936 Msg Info "Creating (possibly replacing) the project $project_name..."
937 lassign [
GetConfFiles $repo_path/Top/$project_name] conf sim pre post
939 if {[
file exists $conf]} {
940 CreateProject -simlib_path $lib_path $project_name $repo_path
942 Msg Error "Project $project_name is incomplete: no hog.conf file found, please create one..."
945 Msg Info "Opening existing project file $project_file..."
946 open_project -file $project_file -do_backup_on_convert 1 -backup_file {./Projects/$project_file.zip}
950 if { $check_syntax == 1 } {
951 Msg Info "Checking syntax option is not supported for Microchip Libero Soc yet. Skipping.."
954 defvar_set -name RWNETLIST_32_64_MIXED_FLOW -value 0
958 if {$do_synthesis == 1} {
959 Msg Info "Run SYNTHESIS..."
960 if {[
catch {run_tool -name {SYNTHESIZE}}] } {
961 Msg Error "SYNTHESIZE FAILED!"
963 Msg Info "SYNTHESIZE PASSED!"
966 Msg Debug "Skipping synthesis (and IP handling)..."
971 if {$do_implementation == 1 } {
973 Msg Info "Starting implementation flow..."
974 if {[
catch {run_tool -name {PLACEROUTE}}] } {
975 Msg Error "PLACEROUTE FAILED!"
977 Msg Info "PLACEROUTE PASSED."
983 Msg Info "Run VERIFYTIMING ..."
984 if {[
catch {run_tool -name {VERIFYTIMING} -script {Hog/Tcl/integrated/libero_timing.tcl}}] } {
985 Msg CriticalWarning "VERIFYTIMING FAILED!"
987 Msg Info "VERIFYTIMING PASSED \n"
991 if {$do_bitstream == 1} {
992 Msg Info "Starting write bitstream flow..."
993 Msg Info "Run GENERATEPROGRAMMINGDATA ..."
994 if {[
catch {run_tool -name {GENERATEPROGRAMMINGDATA}}] } {
995 Msg Error "GENERATEPROGRAMMINGDATA FAILED!"
997 Msg Info "GENERATEPROGRAMMINGDATA PASSED."
999 Msg Info "Sourcing Hog/Tcl/integrated/post-bitstream.tcl"
1000 source $tcl_path/../../Hog/Tcl/integrated/post-bitstream.tcl
1006 lassign [
GetRepoVersions [
file normalize ./Top/$project_name] $repo_path] sha
1008 Msg Info "Git describe set to $describe"
1010 set dst_dir [
file normalize "$bin_dir/$project_name\-$describe"]
1011 file mkdir $dst_dir/reports
1014 if {[
file exists $main_folder/versions.txt]} {
1015 file copy -force $main_folder/versions.txt $dst_dir
1017 Msg Warning "No versions file found in $main_folder/versions.txt"
1020 set timing_file_path [
file normalize "$repo_path/Projects/timing_libero.txt"]
1021 if {[
file exists $timing_file_path]} {
1022 file copy -force $timing_file_path $dst_dir/reports/Timing.txt
1023 set timing_file [open $timing_file_path "r"]
1024 set status_file [open "$dst_dir/timing.txt" "w"]
1025 puts $status_file "## $project_name Timing summary\n\n"
1026 puts $status_file "| | |"
1027 puts $status_file "| --- | --- |"
1028 while {[
gets $timing_file line] >= 0} {
1029 if { [
string match "SUMMARY" $line] } {
1030 while {[
gets $timing_file line] >= 0} {
1031 if { [
string match "END SUMMARY" $line] } {
1034 if {[
string first ":" $line] == -1} {
1037 set out_string "| [
string map {: | } $line] |"
1038 puts $status_file "$out_string"
1043 Msg Warning "No timing file found, not a problem if running locally"
1050 Msg Error "Impossible condition. You need to run this in an IDE."
1054 Msg Info "All done."