How mikepopoloski/slang works
Project type and purpose
• slang is a compiler‐style library and toolchain for SystemVerilog. It provides:
• A core C++ library for lexing, parsing, semantic analysis, diagnostics, and elaboration of SystemVerilog code
• A standalone command-line executable (“slang”) for compile/lint workflows
• Python bindings (pyslang) that expose core functionality to Python
• A suite of auxiliary tools (reflect, rewriter, tidy, hier, threadtest) built on the core library
• Unit and regression tests validating the core and tools
• Purpose: serve as a fast, robust front end for editors, linters, simulators, synthesis tools, or standalone code-analysis utilities.
File structure
• Top‐level CMake files drive building:
• CMakeLists.txt, CMakePresets.json, cmake/…
• /slang & source/… – core C++ library modules (driver, parsing, syntax, AST, analysis, diagnostics, numeric, text, util)
• bindings/python – pybind11‐style wrappers exposing C++ APIs to Python
• tools/… – individual small executables built against the library
• pyslang/… – Python package structure (docs, examples, tests)
• tests/… – C++ unit tests (gtests) and SV regression files
• external/… – header‐only dependencies (thread pool, expected, Boost‐style containers, IEEE VPI headers)
• scripts/… – codegen and ancillary maintenance scripts
• docs/… – Doxygen/Doxygen-inspired API and user manuals
README for architecture clues
• Core modules: lexing, parsing, type checking, elaboration
• Executable entry point for CLI workflows
• Python “ScriptSession” and “SyntaxTree” API abstractions
• Use cases: syntax checking, AST JSON dump, editor server, code generation
Final checklist
• Core library sub-modules and compiler pipeline stages
• How each executable or tool depends on the core library
• Build system orchestrating all targets
• External dependencies and code-gen scripts if relevant