Menu

#855 ngspice's script interpreter shouts everything back in lowercase

v1.0 (example)
open
nobody
None
5
2026-08-09
2026-08-09
No

Found by Claude Code

When you feed ngspice a script file instead of typing at its prompt, it converts every literal token on the line to lowercase before acting on it — even the values you assign with setcs, which exists specifically to preserve case. Type the same commands interactively and case survives, so this only bites automated flows.

That breaks vlnggen, the script ngspice ships to turn a Verilog file into an XSPICE code-model .so. It builds verilator command lines and C++ scanning patterns that are case-sensitive in at least four places: the --Mdir flag, --prefix Vlng, its scan of Vlng.h for VL_IN/VL_OUT/VL_INOUT declarations, and the VL_DATA(...) lines it writes into inputs.h/outputs.h/inouts.h. It dies on the very first verilator invocation with %Error: Invalid option: --mdir.... Net effect: on ngspice-46 the shipped Verilog co-simulation generator cannot run at all. We replaced it with tools/cosim/build_cosim_so.sh, which does the same four steps in plain sh.

Discussion


Log in to post a comment.