Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions idma.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ VERILATOR ?= verilator
VLOGAN ?= vlogan
VSIM ?= vsim

# Provision a local uv venv when the generator deps are not already available.
IDMA_VENV_PY := $(IDMA_ROOT)/.venv/bin/python
ifeq ($(shell $(PYTHON) -c 'import mako' >/dev/null 2>&1 && echo ok),ok)
else ifeq ($(shell $(IDMA_VENV_PY) -c 'import mako' >/dev/null 2>&1 && echo ok),ok)
PYTHON := $(IDMA_VENV_PY)
export PATH := $(IDMA_ROOT)/.venv/bin:$(PATH)
else ifeq ($(shell command -v uv >/dev/null 2>&1 && echo ok),ok)
$(info iDMA: provisioning the generator environment (uv sync --locked) ...)
_idma_uv_sync := $(shell cd $(IDMA_ROOT) && uv sync --locked 1>&2 || echo FAIL)
ifeq ($(_idma_uv_sync),FAIL)
$(error iDMA: 'uv sync --locked' failed; see output above)
endif
PYTHON := $(IDMA_VENV_PY)
export PATH := $(IDMA_ROOT)/.venv/bin:$(PATH)
else
$(error iDMA RTL generation needs 'uv' (https://docs.astral.sh/uv) on PATH, or a venv with the pyproject.toml deps activated)
endif

# Shell
SHELL := /bin/bash

Expand Down
Loading