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