@@ -70,7 +70,7 @@ def _build_ucf(named_sc, named_pc):
70
70
r += "\n " + "\n \n " .join (named_pc )
71
71
return r
72
72
73
- def _build_xst_files (device , sources , build_name , xst_opt ):
73
+ def _build_xst_files (device , sources , vincpaths , build_name , xst_opt ):
74
74
prj_contents = ""
75
75
for filename , language in sources :
76
76
prj_contents += language + " work " + filename + "\n "
@@ -81,13 +81,19 @@ def _build_xst_files(device, sources, build_name, xst_opt):
81
81
-top top
82
82
{xst_opt}
83
83
-ofn {build_name}.ngc
84
- -p {device}""" .format (build_name = build_name , xst_opt = xst_opt , device = device )
84
+ -p {device}
85
+ """ .format (build_name = build_name , xst_opt = xst_opt , device = device )
86
+ for path in vincpaths :
87
+ xst_contents += "-vlgincdir " + path + "\n "
85
88
tools .write_to_file (build_name + ".xst" , xst_contents )
86
89
87
- def _run_yosys (device , sources , build_name ):
90
+ def _run_yosys (device , sources , vincpaths , build_name ):
88
91
ys_contents = ""
92
+ incflags = ""
93
+ for path in vincpaths :
94
+ incflags += " -I" + path
89
95
for filename , language in sources :
90
- ys_contents += "read_{} {}\n " .format (language , filename )
96
+ ys_contents += "read_{}{} {}\n " .format (language , incflags , filename )
91
97
92
98
if device [:2 ] == "xc" :
93
99
archcode = device [2 :4 ]
@@ -212,10 +218,10 @@ def build(self, fragment, build_dir="build", build_name="top",
212
218
tools .write_to_file (v_file , v_src )
213
219
sources = self .sources + [(v_file , "verilog" )]
214
220
if mode == "xst" :
215
- _build_xst_files (self .device , sources , build_name , self .xst_opt )
221
+ _build_xst_files (self .device , sources , self . verilog_include_paths , build_name , self .xst_opt )
216
222
isemode = "xst"
217
223
else :
218
- _run_yosys (self .device , sources , build_name )
224
+ _run_yosys (self .device , sources , self . verilog_include_paths , build_name )
219
225
isemode = "edif"
220
226
ngdbuild_opt += "-p " + self .device
221
227
0 commit comments