From 7f6af0a437ce442692f34756d12c6c3a54ed6675 Mon Sep 17 00:00:00 2001 From: Karol Gugala Date: Sun, 20 Dec 2020 11:53:08 +0100 Subject: [PATCH] Quartus: handle vh and svh files Signed-off-by: Karol Gugala --- litex/build/altera/quartus.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/litex/build/altera/quartus.py b/litex/build/altera/quartus.py index ad8e2e2c2..70711f252 100644 --- a/litex/build/altera/quartus.py +++ b/litex/build/altera/quartus.py @@ -99,7 +99,16 @@ def _build_qsf(device, ips, sources, vincpaths, named_sc, named_pc, build_name, for filename, language, library in sources: if language == "verilog": language = "systemverilog" # Enforce use of SystemVerilog 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 for filename in ips: