Skip to content

Set FPGA top entity from the project explorer and restore the top entity indicator#249

Merged
hendrikmennen merged 3 commits into
mainfrom
copilot/enhancement-set-toplevel-entity
Jun 24, 2026
Merged

Set FPGA top entity from the project explorer and restore the top entity indicator#249
hendrikmennen merged 3 commits into
mainfrom
copilot/enhancement-set-toplevel-entity

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Since the top entity rework, the top entity could only be set through project settings, and the file containing it was no longer visually identifiable. This adds a context-menu shortcut to set the top entity and reinstates the indicator overlay with a new meaning.

Changes

  • UniversalFpgaProjectManager — HDL files (.vhd, .vhdl, .v, .sv) now expose a Set Top Entity submenu with one entry per entity/module declared in the file (extracted via the file's INodeProvider). Selecting one sets topEntity and saves; the active entity is marked with a check icon.
  • Top entity indicator — re-added the overlay, now marking the file that contains the top entity rather than the entity itself, matching the name-based topEntity model.
  • UniversalFpgaProjectRoot.TopEntityFilePath — new runtime-only (non-persisted) cache resolving topEntity → owning file via FpgaService.GetAllTopEntitiesAsync. The manager recomputes it on project load/reload and subscribes to topEntity changes, so the indicator stays correct regardless of where the top entity is changed (context menu, settings, pin planner).
  • UniversalProjectRoot.InvalidateAllModifications() — reusable helper to re-run entry modification handlers across all loaded entries when project-wide state changes.
  • Docs — corrected a stale topEntityFile reference and documented the new behavior.

Notes for reviewers

  • The submenu is populated asynchronously (entity extraction is async); the menu item is created with an empty ObservableCollection and filled on the UI thread once parsing completes.
  • The indicator does not refresh when a top-entity file is later toggled as a test bench / compile-excluded (only topEntity changes and reloads trigger recomputation) — an intentional edge-case trade-off to avoid re-scanning on unrelated property changes.

Co-authored-by: hendrikmennen <25281882+hendrikmennen@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance project explorer to set toplevel entity Set FPGA top entity from the project explorer and restore the top entity indicator Jun 22, 2026
Copilot AI requested a review from hendrikmennen June 22, 2026 10:14
@hendrikmennen hendrikmennen marked this pull request as ready for review June 24, 2026 09:27
@hendrikmennen hendrikmennen merged commit f20c564 into main Jun 24, 2026
1 check 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.

2 participants