Skip to content

Commit

Permalink
mibuild: support multiple specifications of include file and sources
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourdeauducq committed Apr 4, 2015
1 parent 357c807 commit 1d11895
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mibuild/altera/quartus.py
Expand Up @@ -85,7 +85,7 @@ def build(self, platform, fragment, build_dir="build", build_name="top",
named_sc, named_pc = platform.resolve_signals(vns)
v_file = build_name + ".v"
tools.write_to_file(v_file, v_src)
sources = platform.sources + [(v_file, "verilog")]
sources = platform.sources | {(v_file, "verilog")}
_build_files(platform.device, sources, platform.verilog_include_paths, named_sc, named_pc, build_name)
if run:
_run_quartus(build_name, quartus_path)
Expand Down
8 changes: 4 additions & 4 deletions mibuild/generic_platform.py
Expand Up @@ -184,8 +184,8 @@ def __init__(self, device, io, connectors=[], name=None):
if name is None:
name = self.__module__.split(".")[-1]
self.name = name
self.sources = []
self.verilog_include_paths = []
self.sources = set()
self.verilog_include_paths = set()
self.finalized = False

def request(self, *args, **kwargs):
Expand Down Expand Up @@ -229,7 +229,7 @@ def add_source(self, filename, language=None):
if language is None:
language = "verilog" # default to Verilog
filename = os.path.abspath(filename)
self.sources.append((filename, language))
self.sources.add((filename, language))

def add_sources(self, path, *filenames, language=None):
for f in filenames:
Expand All @@ -251,7 +251,7 @@ def add_source_dir(self, path, recursive=True):
self.add_source(filename, language)

def add_verilog_include_path(self, path):
self.verilog_include_paths.append(os.path.abspath(path))
self.verilog_include_paths.add(os.path.abspath(path))

def resolve_signals(self, vns):
# resolve signal names in constraints
Expand Down
2 changes: 1 addition & 1 deletion mibuild/xilinx/ise.py
Expand Up @@ -149,7 +149,7 @@ def build(self, platform, fragment, build_dir="build", build_name="top",
named_sc, named_pc = platform.resolve_signals(vns)
v_file = build_name + ".v"
tools.write_to_file(v_file, v_src)
sources = platform.sources + [(v_file, "verilog")]
sources = platform.sources | {(v_file, "verilog")}
if mode == "xst":
_build_xst_files(platform.device, sources, platform.verilog_include_paths, build_name, self.xst_opt)
isemode = "xst"
Expand Down
2 changes: 1 addition & 1 deletion mibuild/xilinx/vivado.py
Expand Up @@ -110,7 +110,7 @@ def build(self, platform, fragment, build_dir="build", build_name="top",
named_sc, named_pc = platform.resolve_signals(vns)
v_file = build_name + ".v"
tools.write_to_file(v_file, v_src)
sources = platform.sources + [(v_file, "verilog")]
sources = platform.sources | {(v_file, "verilog")}
_build_files(platform.device, sources, platform.verilog_include_paths, build_name,
self.bitstream_commands, self.additional_commands)
tools.write_to_file(build_name + ".xdc", _build_xdc(named_sc, named_pc))
Expand Down

0 comments on commit 1d11895

Please sign in to comment.