56
Environment variables and files
Environment variables change where BetterSPICE looks for things. The desktop app reads them from your user environment when it starts.
56.1For users and integrators
| Variable | Meaning | Default |
|---|---|---|
BSPICE_NGSPICE | ngspice.dll, or the folder containing it. | Next to the app, or vendor\ngspice\bin. |
BSPICE_PSPICE | pspice.exe or its folder. 0 or off turns PSpice off. | Found from the registry, C:\Cadence\PSpiceTI, and C:\Cadence, C:\Program Files\Cadence, C:\OrCAD. |
BSPICE_PSPICE_TRACES | The most traces saved per PSpice run. | 4 for PSpice for TI, unlimited otherwise. |
BSPICE_PORT | The AI agent control port, for the app and the agent. | 47800 |
BSPICE_AGENT_NAME | The agent's name shown in the app. | The name the agent reports. |
BSPICE_EXAMPLES | The folder of example circuits. | examples next to the app. |
BSPICE_PARTS | The folder of part files for the command line. | parts, searched upward. |
BSPICE_MODELS | Folders, separated by semicolons, searched first for the vendor model library. | The repository, %APPDATA%\BetterSPICE\models, the working folder. |
BETTERSPICE_CATALOG | The model catalogue folder. | ui\public\catalog, searched upward. |
BSPICE_THREADS | Threads for bspice and the app’s native engines: auto or a number. 1 is sequential. --threads and the app’s Threads menu override it. | auto: every core but one. |
BSPICE_LOAD_THREADS | Threads for the device load of one run: a number. Without it a run uses up to 4 when its device load takes more than about 9 µs a step, else one. The result is the same on any number. | automatic |
BSPICE_NO_FMA | 1 makes the math library take its plain path on processors with AVX2 and FMA too. The result is the same bits, only slower. For checks. | off |
SPICE_LIB_DIR | Where ngspice finds its code models. | Set from the ngspice folder. |
56.2For debugging
| Variable | Meaning |
|---|---|
BSPICE_NGSPICE_ECHO | Print every ngspice output line to standard error. |
BSPICE_PSPICE_KEEP | Keep the PSpice run folders. |
BSPICE_PSPICE_DEBUG | Print PSpice's dialogs when it hangs. |
BSPICE_PSPICE_TIMEOUT | Seconds per circuit when the catalogue is checked in PSpice (60). |
BSPICE_MODELS_DEBUG, BSPICE_MODELS_DUMP | Folders to keep failing, or all, test decks of the catalogue check. |
BSPICE_SEARCH_DEBUG | A file for the log of the pin search. |
BSPICE_RESOLVE_TRACE | Trace how model dependencies are found. |
BSPICE_VENDOR_DUMP | A folder for verify-vendor decks. |
56.3Files the desktop app keeps
| In %APPDATA%\BetterSPICE | Purpose |
|---|---|
agent-token | The AI agent key, made at the first start. |
betterspice.log | The log, restarted at 1 MB with the previous kept as .old. |
recent.json | Recent files. A damaged one is kept as recent.json.bad. |
window.json | Window size and position. |
autosave-discarded | Written by Don't save, so the autosave copy isn’t recovered. |
parts\ | My parts. |
models\ | An optional place for the vendor model library. |
56.4Browser storage
| Key | Purpose |
|---|---|
bs.layout | Pane sizes. |
bs.currentSpeed | The current dot speed. |
bspice.autosave.v1 | Autosave copies of unsaved circuits. |
bs.partWizard.v1 | Part Wizard progress. |
bspice.agentRelay, bspice.agentPort | The browser version's agent relay: off, and its port. |