Skip to content

Commit

Permalink
cli: add support for docker builds
Browse files Browse the repository at this point in the history
this is handy for using vivado on macOS
  • Loading branch information
anuejn committed Jan 5, 2024
1 parent fb568aa commit d7504db
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion naps/soc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import datetime
import inspect
import sys
import os
import shlex
import hashlib
from pathlib import Path
from shutil import rmtree
Expand Down Expand Up @@ -158,7 +160,15 @@ def cli(top_class, runs_on, possible_socs=(None,)):

# build the gateware
timer.start_task("vendor toolchain build")
build_products = build_plan.execute_local(gateware_build_dir)

if "NAPS_BUILD_DOCKER_IMAGE" in os.environ:
docker_image = os.environ["NAPS_BUILD_DOCKER_IMAGE"]
docker_args = shlex.split(os.environ["NAPS_BUILD_DOCKER_ARGS"])
build_products = build_plan.execute_local_docker(
root=gateware_build_dir, image=docker_image, docker_args=docker_args
)
else:
build_products = build_plan.execute_local(gateware_build_dir)

# we write the cache key file in the end also as a marking that the build was successful
cache_key_path.write_text(elaborated_repr)
Expand Down

0 comments on commit d7504db

Please # to comment.