You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requested in #133: enable CodeRAG over SystemVerilog (HDL) projects. Rather than adopting a separate index format (Kythe), SystemVerilog fits the existing tree-sitter pipeline used for every other supported language.
Approach
Add SystemVerilog as a first-class tree-sitter language, following the pattern of existing languages:
Add a SystemVerilog tree-sitter grammar (e.g. tree-sitter-systemverilog) and register it in codebase_rag/parser_loader.py.
Add a SupportedLanguage.SYSTEMVERILOG entry plus file extensions (.sv, .svh, .v) and a LanguageSpec in codebase_rag/language_spec.py mapping HDL constructs to graph nodes:
modules/packages/interfaces/programs as containers/classes
module declarations, functions, tasks as functions/methods
module instantiations and function/task calls as CALLS
import/package references as IMPORTS
a SystemVerilog FQNSpec for qualified-name scoping
Add a test suite mirroring the existing test_<lang>_* style (structure/containment oracle, functions, imports, instantiation/call edges).
HDL semantics differ from general-purpose languages (modules, instances, ports, always blocks); the initial scope is structural extraction + instantiation/call edges, with type/connectivity inference as later work.
Motivation
Requested in #133: enable CodeRAG over SystemVerilog (HDL) projects. Rather than adopting a separate index format (Kythe), SystemVerilog fits the existing tree-sitter pipeline used for every other supported language.
Approach
Add SystemVerilog as a first-class tree-sitter language, following the pattern of existing languages:
tree-sitter-systemverilog) and register it incodebase_rag/parser_loader.py.SupportedLanguage.SYSTEMVERILOGentry plus file extensions (.sv,.svh,.v) and aLanguageSpecincodebase_rag/language_spec.pymapping HDL constructs to graph nodes:CALLSimport/package references asIMPORTSFQNSpecfor qualified-name scopingtest_<lang>_*style (structure/containment oracle, functions, imports, instantiation/call edges).Notes