Configuration¶
The server uses a hierarchical configuration system, layering configs in this order:
~/.slang/server.json${workspaceFolder}/.slang/server.json(should be in source control)${workspaceFolder}/.slang/local/server.json(.slang/localshould be ignored by source control)
Each option value overrides the value set in previous configs. The exception for this is lists, which are appended.
Config Options¶
All configuration options are optional and have sensible defaults. In VSCode, there are completions and hovers for server.json files. For other editors, you may be able to associate the config schema with these config files to get these features.
index¶
-
Type:
list[IndexConfig]interface IndexConfig { /** Directories to index */ dirs?: string[] /** Directories to exclude; only supports single directory names and applies to all path levels */ excludeDirs?: string[] | null }Which directories to index; By default it indexes the entire workspace. It's highly recommended to configure this for your repo, especially if there are generated build directories and non-hardware directories that can be skipped.
flags¶
-
Type:
stringFlags to pass to slang.
It's recommended to keep your slang flags in a flag file, that way it can be shared by both CI and the language server. Another nice setup is having
slang.fcontain your CI flags, then haveslang-server.finclude that file (via-f path/to/slang.f), along with more warnings inslang-server.f. That way more pedantic checks will show as yellow underlines in your editor.Example:
"-f path/to/slang_flags.f"
indexingThreads¶
-
Type:
integerDefault:
0(auto-detect)Thread count to use for indexing. When set to 0, automatically detects the optimal number of threads based on system capabilities.
parsingThreads¶
-
Type:
integerDefault:
8Thread count to use for parsing SystemVerilog files for compilations.
build¶
-
Type:
stringBuild file to automatically open on start.
Example:
"./build/compile.f"
buildPattern¶
-
Type:
string(glob pattern)Build file pattern used to find a
.ffile given the name of a waveform file. For example,/tmp/{}.fstwithbuilds/{}.flooks forbuild/foo.fto load the compilation. This is also used to look for.ffiles in the VSCode client when selecting a.ffile.Example:
"builds/{}.f"
wcpCommand¶
-
Type:
stringWaveform viewer command where
{}will be replaced with the WCP port.Example:
"surfer --wcp-initiate {}"
Example Configuration¶
{
"flags": "-f tools/slang/slang-server.f",
"indexGlobs": ["./src/**/*.sv", "./tb/**/*.sv"],
"excludeDirs": ["build", "obj_dir"],
"indexingThreads": 4,
"parsingThreads": 8,
"build": "./scripts/compile.f",
"wcpCommand": "surfer --wcp-initiate {}"
}