Skip to content

build: efinix: fix backend defaults, project generation, and toolchain detection.#2440

Merged
enjoy-digital merged 4 commits intomasterfrom
efinix-backend-review-fixes
Apr 2, 2026
Merged

build: efinix: fix backend defaults, project generation, and toolchain detection.#2440
enjoy-digital merged 4 commits intomasterfrom
efinix-backend-review-fixes

Conversation

@enjoy-digital
Copy link
Copy Markdown
Owner

This fixes the issues found during review of the Efinix build backend integration.

  • apply Efinity default map/pnr/pgm parameters consistently in both CLI and direct Python build flows
  • forward infer-sync-set-reset into generated Efinity project settings
  • preserve non-header source library assignments in generated Efinity project XML
  • fix SEU auto-mode generation so WAIT_INTERVAL is emitted when requested
  • detect the Efinity installation from either LITEX_ENV_EFINITY or tools exposed on PATH
  • share Efinity environment loading across the backend, platform, and programmer code paths
  • add focused unit coverage for the Efinix backend plumbing and generator behavior

Programmatic Efinix builds were still starting from empty efx_map and
efx_pnr parameter dictionaries, so the Efinity 2025.2 work_dir
workaround only took effect for CLI flows using build_argdict().

Share the default parameter construction between build() and
build_argdict() so both entry points get the same map, pnr and pgm
defaults. Also forward infer-sync-set-reset, which was parsed but never
emitted into the generated project settings.

Add focused unit tests for the CLI argdict and direct build() path.
The Efinix project XML was forcing every non-header design file into the
default library, which breaks non-default VHDL library layouts. Header
files still need the default bucket, but regular Verilog and VHDL
sources should keep the library selected by the platform.

Also fix SEU auto-mode generation to look up wait_interval as a dict key.
The previous hasattr() check was always false, so WAIT_INTERVAL never
reached the generated interface script.

Extend the focused Efinix unit tests to cover both cases.
The Efinix platform and programmer claimed PATH-based discovery worked,
but both code paths hard-required LITEX_ENV_EFINITY and duplicated the
setup.sh environment parsing logic.

Introduce a shared helper that resolves the Efinity root from either
LITEX_ENV_EFINITY or common PATH-exposed tools, and reuse it from the
platform, programmer and backend build flow. While touching the
programmer, stop relying on process-global EFINITY_HOME and use the
resolved toolchain path directly for bridge images.

Extend the focused Efinix unit tests to cover PATH fallback and shared
environment loading.
@enjoy-digital enjoy-digital merged commit 7c79c4d into master Apr 2, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant