2 # Vivado (TM) v2015.4 (64-bit)
4 # recreate.tcl: Tcl script for re-creating project 'canbench'
6 # Generated by Vivado on Fri Mar 25 10:03:14 CET 2016
7 # IP Build 1412160 on Tue Nov 17 13:47:24 MST 2015
9 # This file contains the Vivado Tcl commands for re-creating the project to the state*
10 # when this script was generated. In order to re-create the project, please source this
11 # file in the Vivado Tcl Shell.
13 # * Note that the runs in the created project will be configured the same way as the
14 # original project, however they will not be launched automatically. To regenerate the
15 # run results please launch the synthesis/implementation runs as needed.
17 #*****************************************************************************************
18 # NOTE: In order to use this script for source control purposes, please make sure that the
19 # following files are added to the source control system:-
21 # 1. This project restoration tcl script (recreate.tcl) that was generated.
23 # 2. The following source(s) files that were local or imported into the original project.
24 # (Please see the '$orig_proj_dir' and '$origin_dir' variable setting below at the start of the script)
28 # 3. The following remote source files that were added to the original project:-
30 # "/home/martin/projects/cvut/bakalarka/canbench-sw/system/src/top/top.bd"
31 # "/home/martin/projects/cvut/bakalarka/canbench-sw/system/src/top/hdl/top_wrapper.vhd"
32 # "/home/martin/projects/cvut/bakalarka/canbench-sw/system/project/canbench.srcs/constrs_1/new/top_wrapper.xdc"
34 #*****************************************************************************************
36 # Set the reference directory for source file relative paths (by default the value is script directory path)
39 # Use origin directory path location variable, if specified in the tcl shell
40 if { [info exists ::origin_dir_loc] } {
41 set origin_dir $::origin_dir_loc
45 set script_file "recreate.tcl"
47 # Help information for this script
51 puts "Recreate a Vivado project from this script. The created project will be"
52 puts "functionally equivalent to the original project for which this script was"
53 puts "generated. The script contains commands for creating a project, filesets,"
54 puts "runs, adding/importing sources and setting properties on various objects.\n"
57 puts "$script_file -tclargs \[--origin_dir <path>\]"
58 puts "$script_file -tclargs \[--help\]\n"
60 puts "Name Description"
61 puts "-------------------------------------------------------------------------"
62 puts "\[--origin_dir <path>\] Determine source file paths wrt this path. Default"
63 puts " origin_dir path value is \".\", otherwise, the value"
64 puts " that was set with the \"-paths_relative_to\" switch"
65 puts " when this script was generated.\n"
66 puts "\[--help\] Print help information for this script"
67 puts "-------------------------------------------------------------------------\n"
72 for {set i 0} {$i < [llength $::argc]} {incr i} {
73 set option [string trim [lindex $::argv $i]]
74 switch -regexp -- $option {
75 "--origin_dir" { incr i; set origin_dir [lindex $::argv $i] }
78 if { [regexp {^-} $option] } {
79 puts "ERROR: Unknown option '$option' specified, please type '$script_file -tclargs --help' for usage info.\n"
87 # Set the directory path for the original project from where this script was exported
88 set orig_proj_dir "[file normalize "$origin_dir/../project"]"
91 create_project canbench ../project
93 # Set the directory path for the new project
94 set proj_dir [get_property directory [current_project]]
96 # Set project properties
97 set obj [get_projects canbench]
98 set_property "board_part" "em.avnet.com:microzed_7010:part0:1.0" $obj
99 set_property "default_lib" "xil_defaultlib" $obj
100 set_property "sim.ip.auto_export_scripts" "1" $obj
101 set_property "simulator_language" "Mixed" $obj
103 # Create 'sources_1' fileset (if not found)
104 if {[string equal [get_filesets -quiet sources_1] ""]} {
105 create_fileset -srcset sources_1
108 # Set IP repository paths
109 set obj [get_filesets sources_1]
110 set_property "ip_repo_paths" "[file normalize "$origin_dir/../ip/can_merge"]" $obj
112 # Rebuild user ip_repo's index before adding any source files
113 update_ip_catalog -rebuild
115 # Set 'sources_1' fileset object
116 set obj [get_filesets sources_1]
118 "[file normalize "$origin_dir/../src/top/top.bd"]"\
119 "[file normalize "$origin_dir/../src/top/hdl/top_wrapper.vhd"]"\
121 add_files -norecurse -fileset $obj $files
123 # Set 'sources_1' fileset file properties for remote files
124 set file "$origin_dir/../src/top/top.bd"
125 set file [file normalize $file]
126 set file_obj [get_files -of_objects [get_filesets sources_1] [list "*$file"]]
127 if { ![get_property "is_locked" $file_obj] } {
128 set_property "generate_synth_checkpoint" "0" $file_obj
131 set file "$origin_dir/../src/top/hdl/top_wrapper.vhd"
132 set file [file normalize $file]
133 set file_obj [get_files -of_objects [get_filesets sources_1] [list "*$file"]]
134 set_property "file_type" "VHDL" $file_obj
137 # Set 'sources_1' fileset file properties for local files
140 # Set 'sources_1' fileset properties
141 set obj [get_filesets sources_1]
142 set_property "top" "top_wrapper" $obj
143 set_property elab_link_dcps false $obj
145 # Create 'constrs_1' fileset (if not found)
146 if {[string equal [get_filesets -quiet constrs_1] ""]} {
147 create_fileset -constrset constrs_1
150 # Set 'constrs_1' fileset object
151 set obj [get_filesets constrs_1]
153 # Add/Import constrs file and set constrs file properties
155 # Set 'constrs_1' fileset properties
157 # Create 'sim_1' fileset (if not found)
158 if {[string equal [get_filesets -quiet sim_1] ""]} {
159 create_fileset -simset sim_1
162 # Set 'sim_1' fileset object
163 set obj [get_filesets sim_1]
164 # Empty (no sources present)
166 # Set 'sim_1' fileset properties
167 set obj [get_filesets sim_1]
168 set_property "top" "top_wrapper" $obj
169 set_property "xelab.nosort" "1" $obj
170 set_property "xelab.unifast" "" $obj
172 # Create 'synth_1' run (if not found)
173 if {[string equal [get_runs -quiet synth_1] ""]} {
174 create_run -name synth_1 -part xc7z010clg400-1 -flow {Vivado Synthesis 2015} -strategy "Vivado Synthesis Defaults" -constrset constrs_1
176 set_property strategy "Vivado Synthesis Defaults" [get_runs synth_1]
177 set_property flow "Vivado Synthesis 2015" [get_runs synth_1]
179 set obj [get_runs synth_1]
181 # set the current synth run
182 current_run -synthesis [get_runs synth_1]
184 # Create 'impl_1' run (if not found)
185 if {[string equal [get_runs -quiet impl_1] ""]} {
186 create_run -name impl_1 -part xc7z010clg400-1 -flow {Vivado Implementation 2015} -strategy "Vivado Implementation Defaults" -constrset constrs_1 -parent_run synth_1
188 set_property strategy "Vivado Implementation Defaults" [get_runs impl_1]
189 set_property flow "Vivado Implementation 2015" [get_runs impl_1]
191 set obj [get_runs impl_1]
192 set_property "steps.write_bitstream.args.readback_file" "0" $obj
193 set_property "steps.write_bitstream.args.verbose" "0" $obj
195 # set the current impl run
196 current_run -implementation [get_runs impl_1]
198 puts "INFO: Project created:canbench"