This repository was archived by the owner on Dec 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
103 lines (79 loc) · 2.68 KB
/
SConstruct
File metadata and controls
103 lines (79 loc) · 2.68 KB
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
96
97
98
99
100
import os
import xilinx
debug = False
AddOption("--build_debug",
dest='build_debug',
action="store_true",
help='view messages for debugging the build',
default=False)
AddOption("--config_file",
type="string",
dest='config_file',
action="store",
help="specify a config file",
default='config.json')
AddOption("--clean_build",
dest="clean_build",
action="store_true",
help="Clean the build environment",
default=False)
AddOption("--clean_cores",
dest="clean_cores",
action="store_true",
help="Clean the generated cores",
default=False)
#Create an environment
env = Environment()
#parse options from the command line
debug = GetOption('build_debug')
clean_build = GetOption('clean_build')
clean_cores = GetOption('clean_cores')
env['CONFIG_FILE'] = GetOption('config_file')
#Add the both the XIL_SCRIPT_LOC and
# the required paths to the environmental paths
xilinx.initialize_environment(env = env,
xilinx_path = "",
build_tool = "ISE",
version_number = "")
if clean_build:
#Create a clean target
xilinx.clean_build(env)
Exit(0)
if clean_cores:
#remove all the outputted cores
xilinx.clean_cores(env)
Exit(0)
#get the xst tool
env.Tool('coregen')
env.Tool('xst')
env.Tool('ngd')
env.Tool('map')
env.Tool('par')
env.Tool('trace')
env.Tool('bitgen')
if debug == True:
d = env.Dictionary()
keys = d.keys()
keys.sort()
print "WSTHIS : %s" % str(d['ENV'])
#print "Tools: %s" % str(d["TOOLS"])
#for key in keys:
# print "\t%s: %s" % (key, str(d[key]))
print "coregen targets: %s" % xilinx.get_coregen_targets(env)
#Alias recognizable builder commands
env.Alias("coregen", xilinx.get_coregen_targets(env))
env.Alias("xst", xilinx.get_xst_targets(env))
env.Alias("ngdbuild", xilinx.get_ngd_targets(env))
env.Alias("map", xilinx.get_map_targets(env))
env.Alias("par", xilinx.get_par_targets(env))
env.Alias("trce", xilinx.get_trace_targets(env))
env.Alias("bitgen", xilinx.get_bitgen_targets(env))
coregen_files = env.coregen(xilinx.get_coregen_targets(env), None)
ngc_file = env.xst(xilinx.get_xst_targets(env), coregen_files)
ngd_file = env.ngd(xilinx.get_ngd_targets(env), ngc_file)
map_file = env.map(xilinx.get_map_targets(env), ngd_file)
par_file = env.par(xilinx.get_par_targets(env), map_file)
trace_file = env.trace(xilinx.get_trace_targets(env), par_file)
bitgen_file = env.bitgen(xilinx.get_bitgen_targets(env), par_file)
#Don't clean the cores unless the user explicitly asks for it
NoClean(xilinx.get_coregen_targets(env))