Skip to content

Conversation

@BekdoucheAmine
Copy link

Description

This PR introduces a TCL-based solution to automatically generate the VS Code VHDL Language Server configuration file (.vhdl_ls.toml) directly from the OSVVM build process.

Implementation

  • Added Scripts/VendorScripts_GenerateVhdlLsToml.tcl
  • Added GenerateVhdlLsToml procedure for VHDL LS integration in Scripts/StartUp.tcl
  • Reuses the OSVVM vendor script mechanism (vendor_analyze_vhdl)
  • Hooks into the standard build flow
  • Collects analyzed VHDL files per library
  • Generates .vhdl_ls.toml grouped by [libraries.<name>] in the user workspace
  • Non-intrusive: does not change existing build behavior
[libraries.osvvm]
files = [
    '<OSVVM_ROOT>/osvvm/IfElsePkg.vhd',
    '<OSVVM_ROOT>/osvvm/OsvvmTypesPkg.vhd',
    ... 
    '<OSVVM_ROOT>/osvvm/OsvvmContext.vhd',
  ]
  
[libraries.OSVVM_Common]
files = [
    '<OSVVM_ROOT>/Common/src/ModelParametersPtPkg.vhd',
    ... 
    '<OSVVM_ROOT>/Common/src/OsvvmCommonContext.vhd',
  ]
  
[libraries.osvvm_uart]
Files = [
    '<OSVVM_ROOT>/UART/src/UartTbPkg.vhd',
    ... 
    '<OSVVM_ROOT>/UART/src/UartRx.vhd',
  ]
  
# ... remaining libraries omitted for brevity ...

Usage

source ../OsvvmLibraries/Scripts/StartUp.tcl
GenerateVhdlLsToml ../OsvvmLibraries

This will:

  • Run the OSVVM build flow
  • Capture analyzed VHDL files per library
  • Generate/update .vhdl_ls.toml
  • Restore the default OSVVM script behavior

Notes

@BekdoucheAmine
Copy link
Author

Hi @JimLewis I've implemented what we discussed in Issue #72. I'll look into VHDL LS and check if relative paths can be used within the .toml file and I'll get back to you.

@BekdoucheAmine
Copy link
Author

A variable can be added to the GenerateVhdlLsToml to indicate where the .toml file should be stored.

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