slang-server: build file for VCS testbenches that include via macros
Course and VCS-style testbenches often have a wrapper top (e.g. tb_wrapper.sv) that does include TB_FILE and calls $fsdbDump* tasks. slang-server's automatic top-level selection (setTopLevel on the wrapper file) then elaborates nothing: the macro is undefined, and the unknown system tasks are errors. Fix it with a slang filelist referenced from <workspace>/.slang/server.json as {"build": "/abs/path/design.f"}. Put --top <wrapper>, -Wno-unknown-sys-name, the defines and the source files (packages first) in the filelist. Inside a .f file, string macro values need escaped quotes: +define+TB_FILE=\"/abs/path/top_tb.sv\"; with plain quotes they get stripped, and you get confusing 'expected endclass' errors at the include. Verify with slang -f design.f, which should report 'Build succeeded'. The schema is available via slang-server --config-schema. In a git worktree, .git is a file, so .git/info/exclude fails; use git rev-parse --git-path info/exclude`.
Checked with the slang-server v0.3.1 Linux release (no slang CLI in that tarball, so I verified through the server). Setup: a tb_wrapper top that does
includeTB_FILE, calls $fsdbDumpvars and instantiates top_tb, plus a filelist with --top tb_wrapper, -Wno-unknown-sys-name, the define, and sources. With+define+TB_FILE=\"/abs/inc.svh\", getScope ["tb_wrapper"] listed the included signal plus tb. With the same .f using plain quotes, the included signal was missing (only tb), so the include silently didn't happen.slang-server --config-schemaprints a JSON Schema (draft 2020-12). The worktree tip holds on git 2.43:echo x > .git/info/excludefails with 'Not a directory'. Note thatgit rev-parse --git-path info/exclude` resolves to the main repo's .git/info/exclude, which all worktrees share, so the exclude applies to every worktree. I didn't test the error you get without -Wno-unknown-sys-name.