VHDL Block Instantiator
Workspace-wide VHDL completion helper for entity instantiation.
Features
- Completion items for entities discovered from workspace
.vhd/.vhdl files
- Optional workspace-wide entity discovery from all
.vhd/.vhdl files
- Instantiation snippet insertion (
entity <lib>.<name> + parsed generic/port maps)
- Optional auto insertion of
library <lib>; if missing
- Command palette helper:
VHDL Block Instantiator: Insert Block
- Command palette refresh:
VHDL Block Instantiator: Refresh Entity Cache
Settings
vhdlBlockInstantiator.libraryName (legacy compatibility setting)
vhdlBlockInstantiator.autoInsertLibrary (default: true)
vhdlBlockInstantiator.workspaceLibraryName (fallback, default: work)
vhdlBlockInstantiator.scanWorkspaceEntities (default: true)
vhdlBlockInstantiator.scanCacheSeconds (default: 30)
vhdlBlockInstantiator.scanMaxFiles (default: 4000)
vhdlBlockInstantiator.searchRoots (default: ["**/sources"])
vhdlBlockInstantiator.searchExcludeGlob (default: **/{.git,node_modules,.hg,.svn,dist,out,build,sim}/**)
vhdlBlockInstantiator.leavePortsOpen (default: false) — Leave port/generic maps unfinished (open) instead of filling placeholders
vhdlBlockInstantiator.addDefinitionsAsComments (default: false) — Include port and generic definitions as comments in the snippet
Library naming: the extension scans Vivado TCL files (add*_files.tcl, create_project.tcl) for explicit file-to-library assignments. If a file is not found in any TCL map, it defaults to vhdlBlockInstantiator.workspaceLibraryName (default: work).
TCL mapping: when enabled, the extension first scans Vivado TCL add-files scripts (for example add_system_pkg_lib_files.tcl) and uses those explicit file-to-library assignments. Top-level-directory inference is used only as a fallback.
vhdlBlockInstantiator.useTclLibraryMap (default: true)
vhdlBlockInstantiator.libraryMapTclGlob (default: {add*_files.tcl,create_project.tcl})
Recommended workspace filter for your case:
vhdlBlockInstantiator.searchRoots: ["**/sources"]
vhdlBlockInstantiator.searchExcludeGlob: **/{.git,node_modules,.hg,.svn,dist,out,build,sim}/**
Quickpick Features
When using the Insert Block command, the quickpick now shows:
- Entity name as the main label
- Library name as the description (searchable by typing library name)
- Port and generic counts as detail
- Filter by entity name, library name, or both
Example: type system_pkg_lib to filter entities from that library, or generic_sp_rom to find the entity.
Snippet Options
leavePortsOpen: When enabled, generates instantiation with port/generic maps left unfilled (no comments unless addDefinitionsAsComments is also true):
my_entity_i : entity work.my_entity
generic map (
WIDTH => ,
DEPTH =>
)
port map (
clk => ,
rst => ,
data =>
);
addDefinitionsAsComments: When enabled (with or without leavePortsOpen), includes type definitions as inline comments:
-- With leavePortsOpen=false (default):
my_entity_i : entity work.my_entity
generic map (
WIDTH => WIDTH , --integer
DEPTH => DEPTH --positive
)
port map (
clk => clk , --std_logic
rst => rst , --std_logic
data => data --std_logic_vector(11 downto 0)
);
-- With leavePortsOpen=true:
my_entity_i : entity work.my_entity
generic map (
WIDTH => , --integer
DEPTH => --positive
)
port map (
clk => , --std_logic
rst => , --std_logic
data => --std_logic_vector(11 downto 0)
);
Note: addDefinitionsAsComments can be combined with leavePortsOpen for different comment styles.