build/sim/Verilator: Skip .hex in sources.

Useful to use platform.add_source to add/copy .hex files.
This commit is contained in:
Florent Kermarrec 2022-10-24 18:21:10 +02:00
parent af445e93dd
commit 611b84ccee
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@
import os
import sys
import subprocess
from pathlib import Path
from shutil import which
from migen.fhdl.structure import _Fragment
@ -132,9 +133,12 @@ def _generate_sim_config(config):
def _build_sim(build_name, sources, jobs, threads, coverage, opt_level="O3", trace_fst=False):
makefile = os.path.join(core_directory, 'Makefile')
cc_srcs = []
for filename, language, library, *copy in sources:
if Path(filename).suffix not in [".hex"]:
cc_srcs.append("--cc " + filename + " ")
build_script_contents = """\
rm -rf obj_dir/
make -C . -f {} {} {} {} {} {} {}