-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathred_pitaya_vivado_project_Z20_250.tcl
95 lines (73 loc) · 2.99 KB
/
red_pitaya_vivado_project_Z20_250.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
################################################################################
# Vivado tcl script for building RedPitaya FPGA in non project mode
#
# Usage:
# vivado -mode batch -source red_pitaya_vivado_project_Z20.tcl -tclargs projectname
################################################################################
set prj_name [lindex $argv 0]
puts "Project name: $prj_name"
cd prj/$prj_name
#cd prj/$::argv
################################################################################
# define paths
################################################################################
set path_brd brd
set path_rtl rtl_250
set path_ip ip
set path_sdc sdc_250
set path_sdc_prj sdc
set path_bd project/redpitaya.srcs/sources_1/bd/system/hdl
################################################################################
# list board files
################################################################################
set_param board.repoPaths [list $path_brd]
set_param iconstr.diffPairPulltype {opposite}
################################################################################
# setup an in memory project
################################################################################
set part xc7z020clg400-3
create_project -part $part -force redpitaya ./project
################################################################################
# create PS BD (processing system block design)
################################################################################
# file was created from GUI using "write_bd_tcl -force ip/systemZ20.tcl"
# create PS BD
source $path_ip/systemZ20.tcl
# generate SDK files
generate_target all [get_files system.bd]
################################################################################
# read files:
# 1. RTL design sources
# 2. IP database files
# 3. constraints
################################################################################
add_files ../../$path_rtl
add_files $path_rtl
add_files $path_bd
add_files -fileset constrs_1 $path_sdc_prj/red_pitaya.xdc
set ip_files [glob -nocomplain $path_ip/*.xci]
if {$ip_files != ""} {
add_files $ip_files
}
## search for HWID parameter to select xdc
foreach item $argv {
puts "Input arfguments: $argv"
if {[lsearch -all $item "*HWID*"] >= 0} {
set hwid [split $item "="]
set board [lindex $hwid 1]
puts "Special board: $board"
}
}
if {[info exists board]} {
puts "Special board: $board"
add_files -fileset constrs_1 ../../$path_sdc/red_pitaya_${board}.xdc
} else {
puts "Reading standard board constraints."
add_files -fileset constrs_1 ../../$path_sdc/red_pitaya.xdc
}
################################################################################
# start gui
################################################################################
import_files -force
update_compile_order -fileset sources_1
set_property top red_pitaya_top [current_fileset]