Quartus: handle vh and svh files

Signed-off-by: Karol Gugala <kgugala@antmicro.com>
This commit is contained in:
Karol Gugala 2020-12-20 11:53:08 +01:00
parent 7fccf9fcd0
commit 7f6af0a437

View file

@ -99,7 +99,16 @@ def _build_qsf(device, ips, sources, vincpaths, named_sc, named_pc, build_name,
for filename, language, library in sources: for filename, language, library in sources:
if language == "verilog": language = "systemverilog" # Enforce use of SystemVerilog if language == "verilog": language = "systemverilog" # Enforce use of SystemVerilog
tpl = "set_global_assignment -name {lang}_FILE {path} -library {lib}" tpl = "set_global_assignment -name {lang}_FILE {path} -library {lib}"
qsf.append(tpl.format(lang=language.upper(), path=filename.replace("\\", "/"), lib=library)) # Do not add None type files
if language is not None:
qsf.append(tpl.format(lang=language.upper(), path=filename.replace("\\", "/"), lib=library))
# Check if the file is a header. Those should not be explicitly added to qsf,
# but rather included in include search_path
else:
if filename.endswith(".svh") or filename.endswith(".vh"):
fpath = os.path.dirname(filename)
if fpath not in vincpaths:
vincpaths.append(fpath)
# Add ips # Add ips
for filename in ips: for filename in ips: