build/osfpga: Add include_path support.

This commit is contained in:
Florent Kermarrec 2022-05-24 17:11:01 +02:00
parent 3bf5c11928
commit a67cd6e442
1 changed files with 9 additions and 6 deletions

View File

@ -26,7 +26,7 @@ def _build_sdc(clocks, vns, build_name):
# Script ------------------------------------------------------------------------------------------- # Script -------------------------------------------------------------------------------------------
def _build_tcl(name, device, files, build_name): def _build_tcl(name, device, files, build_name, include_paths):
tcl = [] tcl = []
# Create Design. # Create Design.
@ -38,7 +38,9 @@ def _build_tcl(name, device, files, build_name):
tcl.append(f"set_macro {macro}") tcl.append(f"set_macro {macro}")
# Add Include Path. # Add Include Path.
# TODO. tcl.append("add_include_path ./")
for include_path in include_paths:
tcl.append(f"add_include_path {include_path}")
# Add Sources. # Add Sources.
for f, typ, lib in files: for f, typ, lib in files:
@ -108,10 +110,11 @@ class OSFPGAToolchain:
# Generate build script (.tcl) # Generate build script (.tcl)
script = _build_tcl( script = _build_tcl(
name = platform.devicename, name = platform.devicename,
device = platform.device, device = platform.device,
files = platform.sources, files = platform.sources,
build_name = build_name, build_name = build_name,
include_paths = platform.verilog_include_paths,
) )
# Run # Run