cicsim 0.2.2__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {cicsim-0.2.2 → cicsim-0.3.0}/PKG-INFO +67 -9
  2. {cicsim-0.2.2 → cicsim-0.3.0}/README.md +59 -5
  3. cicsim-0.3.0/cicsim/__init__.py +42 -0
  4. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cdsconf.py +1 -8
  5. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cicsim.py +85 -48
  6. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdresults.py +98 -39
  7. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdrun.py +6 -7
  8. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdrunng.py +135 -58
  9. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdsummary.py +1 -2
  10. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdwave.py +3 -1
  11. cicsim-0.3.0/cicsim/cmdwave_pg.py +3962 -0
  12. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/command.py +17 -0
  13. cicsim-0.3.0/cicsim/mcp_server.py +493 -0
  14. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/ngraw.py +3 -7
  15. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/plot.py +14 -13
  16. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/simcalc.py +0 -5
  17. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/spec.py +0 -1
  18. cicsim-0.3.0/cicsim/spiceparser.py +112 -0
  19. cicsim-0.3.0/cicsim/theme.py +108 -0
  20. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/wavebrowser.py +4 -1
  21. cicsim-0.3.0/cicsim/wavefiles.py +935 -0
  22. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/wavegraph.py +20 -10
  23. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim.egg-info/PKG-INFO +67 -9
  24. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim.egg-info/SOURCES.txt +2 -0
  25. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim.egg-info/entry_points.txt +1 -1
  26. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim.egg-info/requires.txt +8 -3
  27. {cicsim-0.2.2 → cicsim-0.3.0}/pyproject.toml +9 -3
  28. cicsim-0.2.2/cicsim/__init__.py +0 -25
  29. cicsim-0.2.2/cicsim/cmdwave_pg.py +0 -2188
  30. cicsim-0.2.2/cicsim/spiceparser.py +0 -80
  31. cicsim-0.2.2/cicsim/wavefiles.py +0 -226
  32. {cicsim-0.2.2 → cicsim-0.3.0}/LICENSE +0 -0
  33. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdarchive.py +0 -0
  34. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdip.py +0 -0
  35. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdsimdir.py +0 -0
  36. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdsimdirng.py +0 -0
  37. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/cmdspider.py +0 -0
  38. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim/pivot.py +0 -0
  39. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim.egg-info/dependency_links.txt +0 -0
  40. {cicsim-0.2.2 → cicsim-0.3.0}/cicsim.egg-info/top_level.txt +0 -0
  41. {cicsim-0.2.2 → cicsim-0.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cicsim
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: Custom IC Creator Simulation Tools
5
5
  Author-email: Carsten Wulff <carsten@wulff.no>
6
6
  License: MIT
@@ -20,14 +20,18 @@ Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: numpy
22
22
  Requires-Dist: pandas
23
+ Requires-Dist: pyarrow
23
24
  Requires-Dist: jinja2
24
25
  Requires-Dist: matplotlib
25
26
  Requires-Dist: click
26
27
  Requires-Dist: pyyaml
27
28
  Requires-Dist: tabulate
28
- Provides-Extra: pg
29
- Requires-Dist: PySide6; extra == "pg"
30
- Requires-Dist: pyqtgraph; extra == "pg"
29
+ Requires-Dist: rich
30
+ Requires-Dist: tqdm
31
+ Provides-Extra: wave
32
+ Requires-Dist: cicwave; extra == "wave"
33
+ Provides-Extra: mcp
34
+ Requires-Dist: mcp[cli]; extra == "mcp"
31
35
  Dynamic: license-file
32
36
 
33
37
 
@@ -69,6 +73,15 @@ This is a script package I use to control ngspice, it can
69
73
  | 0.1.19 | Wave viewer overhaul: measurement cursors (A/B) with delta readout, scroll-wheel zoom, keyboard shortcuts, engineering notation on axes (EngFormatter), Export PDF, legend toggle, regex search tooltip, Help menu. Fixed pyproject.toml license for Python 3.8. Added unit tests |
70
74
  | 0.2.0 | New pyqtgraph backend (`--backend pg`): hierarchical wave browser, automatic dual Y-axes, GPU-accelerated rendering, closeable tabs, analysis functions (FFT/PSD, Histogram, Differentiate, X vs Y). Fixed AC analysis complex data plotting |
71
75
  | 0.2.1 | Multi-format file support: CSV, TSV, Excel, JSON, Parquet, Feather, HDF5, Pickle, and more. `--sheet` option for Excel files. String/categorical axis support with rotated labels. Gradient (dy/dx) and slope in cursor readout. Double-click to plot. Regex signal picker for X vs Y |
76
+ | 0.2.2 | cicwave: fixed file selection, added zoom/line-width/font-size controls, statistics readout, session save/load, pivot support, dark theme, plot style selector, matplotlib export |
77
+ | 0.2.3 | cicwave: light/dark theme toggle, session and pivot documentation |
78
+ | 0.2.4 | cicwave: toggle wave visibility on double-click in browser |
79
+ | 0.2.5 | cicwave: fixed grid in light mode, improved zoom performance, fixed font warning |
80
+ | 0.2.6 | cicwave: drag-and-drop files, file menu, improved A/B cursor readout and X vs Y picker. Added GitHub release workflow |
81
+ | 0.2.7 | `cicsim run`: added `--threads` for parallel simulations, `--progress` for tqdm progress bar, `--timeout` to kill hung sims, rich terminal results table. Bug fixes: uninitialized error state, float parse errors in log, silent measurement failures, dead code removed. CI: dependabot, ruff lint on PRs, pinned action versions, automated PyPI publish |
82
+ | 0.2.8 | cicwave: lazy file loading (header-only on open) and pyarrow CSV reader for ~5× faster bulk loads, `--glob` option (repeatable, recursive), display-time downsampling and OpenGL acceleration for smoother zoom with many curves, right-drag rubber-band zoom, automatic unit detection from column suffixes (`_MHz`, `[dBm]`, `(V)`, ...), proper x/y axis labels on plot-all |
83
+ | 0.2.9 | cicwave: LitePoint `.iqvsa` IQ capture support; Windows desktop shortcut generator (`scripts/make-cicwave-shortcut.ps1`); `cicwavew` GUI entry point (no console window when launched from a shortcut); `File -> Export Data...` (Ctrl+E) writes plotted traces to CSV / TSV / Parquet / Feather / HDF5, honouring the current x-zoom |
84
+ | 0.3.0 | The `cicwave` command moved to the standalone cicwave package; `cicsim wave` still delegates to it. MCP server for results and raw files |
72
85
 
73
86
 
74
87
  # Install this module
@@ -90,11 +103,11 @@ Head over to [Sky130nm tutorial](https://analogicus.com/aic2026/sky130nm_tutoria
90
103
 
91
104
  # Get started with waveform viewer
92
105
 
93
- A standalone `cicwave` command is available that defaults to the pyqtgraph
94
- backend. It is equivalent to `cicsim wave --backend pg`.
106
+ The waveform viewer is the separate [cicwave](https://github.com/wulffern/cicwave)
107
+ package.
95
108
 
96
109
  ``` bash
97
- # Standalone command (defaults to pg backend)
110
+ python3 -m pip install cicwave
98
111
  cicwave output_tran/tran_SchGtTtKffVh_*
99
112
 
100
113
  # Or via cicsim subcommand
@@ -102,7 +115,8 @@ cicsim wave output_tran/tran_SchGtTtKffVh_* # tkinter backend
102
115
  cicsim wave --backend pg output_tran/tran_SchGtTtKffVh_* # pyqtgraph backend
103
116
  ```
104
117
 
105
- Supported file formats: `.raw` (ngspice), `.csv`, `.tsv`, `.txt`, `.xlsx`,
118
+ Supported file formats: `.raw` (ngspice), `.vcd`, `.prn` (Xyce),
119
+ `.iqvsa` (LitePoint VSA capture), `.csv`, `.tsv`, `.txt`, `.xlsx`,
106
120
  `.xls`, `.ods`, `.json`, `.parquet`, `.feather`, `.h5`, `.hdf5`, `.pkl`,
107
121
  `.pickle`, `.html`, `.xml`, `.fwf`, `.dta`, `.sas7bdat`, `.sav`.
108
122
 
@@ -110,10 +124,38 @@ Supported file formats: `.raw` (ngspice), `.csv`, `.tsv`, `.txt`, `.xlsx`,
110
124
  # Open CSV / Excel files
111
125
  cicwave data.csv
112
126
  cicwave data.xlsx --sheet "Sheet2"
127
+
128
+ # Open many files via a glob (works on PowerShell too; supports **)
129
+ cicwave --glob "results/*.csv"
130
+ cicwave --glob "out/**/*.raw"
113
131
  ```
114
132
 
133
+ Files are opened lazily (header-only) and parsed with `pyarrow`, so dropping
134
+ hundreds of large CSV files into the viewer is fast. Column-name unit
135
+ suffixes like `_MHz`, `[dBm]`, `(V)` are detected automatically and used
136
+ for axis labels and engineering-notation tick formatting.
137
+
115
138
  ![](wave.png)
116
139
 
140
+ ## Windows desktop shortcut
141
+
142
+ To launch `cicwave` without opening a terminal, generate a Windows
143
+ shortcut from the repo:
144
+
145
+ ``` powershell
146
+ # From the repo root
147
+ powershell -ExecutionPolicy Bypass -File scripts\make-cicwave-shortcut.ps1
148
+ # -> creates scripts\cicwave.lnk; drag it to Desktop / Start menu / taskbar.
149
+
150
+ # Or drop it straight onto the Desktop:
151
+ powershell -ExecutionPolicy Bypass -File scripts\make-cicwave-shortcut.ps1 -OnDesktop
152
+ ```
153
+
154
+ The script prefers `cicwavew.exe` (the GUI wrapper, no console window)
155
+ over `cicwave.exe` and uses `cicsim/cicwave.ico` as the icon. Pass
156
+ `-WithConsole` if you want the shortcut to launch the console build
157
+ (useful for seeing startup log output).
158
+
117
159
  ## Wave viewer keyboard shortcuts
118
160
 
119
161
  | Key | Action |
@@ -125,12 +167,16 @@ cicwave data.xlsx --sheet "Sheet2"
125
167
  | `R` | Reload all waves |
126
168
  | `L` | Toggle legend |
127
169
  | `Ctrl+O` | Open file |
128
- | `Ctrl+P` | Export PDF |
170
+ | `Ctrl+P` | Export PDF / PNG / SVG |
171
+ | `Ctrl+E` | Export plotted data (CSV / TSV / Parquet / Feather / HDF5) |
129
172
  | `Ctrl+N` | New plot tab (pg) |
130
173
  | `Ctrl+W` | Close current tab (pg) |
131
174
  | `Ctrl+Q` | Quit |
132
175
  | Scroll | Zoom x-axis |
133
176
  | Shift+Scroll | Zoom y-axis |
177
+ | Right-drag | Rubber-band zoom rectangle (pg) |
178
+ | Shift+Right-drag | Pan x-axis (pg) |
179
+ | Ctrl+Right-drag | Pan y-axis (pg) |
134
180
 
135
181
  ## Analysis functions (pg backend, right-click menu)
136
182
 
@@ -168,6 +214,13 @@ Commands:
168
214
  summary Generate simulation summary for results
169
215
  template Run an IP template with <options> YAML file
170
216
  wave Open waveform viewer
217
+
218
+ Key options for run:
219
+ --threads N Run N simulations in parallel
220
+ --progress Show tqdm progress bar instead of interleaved logs
221
+ --timeout N Kill any simulation that runs longer than N seconds
222
+ --sha / --no-sha Skip re-running simulations whose input files haven't changed
223
+ --count N Run each corner N times (Monte Carlo)
171
224
  ```
172
225
 
173
226
  A standalone command is also available:
@@ -178,8 +231,13 @@ Usage: cicwave [OPTIONS] [FILES]...
178
231
  Waveform viewer (standalone). Defaults to the pyqtgraph backend.
179
232
 
180
233
  Options:
234
+ --glob TEXT Glob pattern (repeatable, supports ** for recursion)
181
235
  --x TEXT Specify x-axis
182
236
  --backend [tk|pg] GUI backend (default: pg)
183
237
  --sheet TEXT Sheet name for Excel files
238
+ --pivot TEXT Pivot spec file (YAML/JSON)
239
+ --pivot-info Print pivot dimensions and exit
240
+ --session TEXT Load session file (.cicwave.yaml)
241
+ --export TEXT Export plot to file (PDF/PNG/SVG) and exit
184
242
  --help Show this message and exit.
185
243
  ```
@@ -37,6 +37,15 @@ This is a script package I use to control ngspice, it can
37
37
  | 0.1.19 | Wave viewer overhaul: measurement cursors (A/B) with delta readout, scroll-wheel zoom, keyboard shortcuts, engineering notation on axes (EngFormatter), Export PDF, legend toggle, regex search tooltip, Help menu. Fixed pyproject.toml license for Python 3.8. Added unit tests |
38
38
  | 0.2.0 | New pyqtgraph backend (`--backend pg`): hierarchical wave browser, automatic dual Y-axes, GPU-accelerated rendering, closeable tabs, analysis functions (FFT/PSD, Histogram, Differentiate, X vs Y). Fixed AC analysis complex data plotting |
39
39
  | 0.2.1 | Multi-format file support: CSV, TSV, Excel, JSON, Parquet, Feather, HDF5, Pickle, and more. `--sheet` option for Excel files. String/categorical axis support with rotated labels. Gradient (dy/dx) and slope in cursor readout. Double-click to plot. Regex signal picker for X vs Y |
40
+ | 0.2.2 | cicwave: fixed file selection, added zoom/line-width/font-size controls, statistics readout, session save/load, pivot support, dark theme, plot style selector, matplotlib export |
41
+ | 0.2.3 | cicwave: light/dark theme toggle, session and pivot documentation |
42
+ | 0.2.4 | cicwave: toggle wave visibility on double-click in browser |
43
+ | 0.2.5 | cicwave: fixed grid in light mode, improved zoom performance, fixed font warning |
44
+ | 0.2.6 | cicwave: drag-and-drop files, file menu, improved A/B cursor readout and X vs Y picker. Added GitHub release workflow |
45
+ | 0.2.7 | `cicsim run`: added `--threads` for parallel simulations, `--progress` for tqdm progress bar, `--timeout` to kill hung sims, rich terminal results table. Bug fixes: uninitialized error state, float parse errors in log, silent measurement failures, dead code removed. CI: dependabot, ruff lint on PRs, pinned action versions, automated PyPI publish |
46
+ | 0.2.8 | cicwave: lazy file loading (header-only on open) and pyarrow CSV reader for ~5× faster bulk loads, `--glob` option (repeatable, recursive), display-time downsampling and OpenGL acceleration for smoother zoom with many curves, right-drag rubber-band zoom, automatic unit detection from column suffixes (`_MHz`, `[dBm]`, `(V)`, ...), proper x/y axis labels on plot-all |
47
+ | 0.2.9 | cicwave: LitePoint `.iqvsa` IQ capture support; Windows desktop shortcut generator (`scripts/make-cicwave-shortcut.ps1`); `cicwavew` GUI entry point (no console window when launched from a shortcut); `File -> Export Data...` (Ctrl+E) writes plotted traces to CSV / TSV / Parquet / Feather / HDF5, honouring the current x-zoom |
48
+ | 0.3.0 | The `cicwave` command moved to the standalone cicwave package; `cicsim wave` still delegates to it. MCP server for results and raw files |
40
49
 
41
50
 
42
51
  # Install this module
@@ -58,11 +67,11 @@ Head over to [Sky130nm tutorial](https://analogicus.com/aic2026/sky130nm_tutoria
58
67
 
59
68
  # Get started with waveform viewer
60
69
 
61
- A standalone `cicwave` command is available that defaults to the pyqtgraph
62
- backend. It is equivalent to `cicsim wave --backend pg`.
70
+ The waveform viewer is the separate [cicwave](https://github.com/wulffern/cicwave)
71
+ package.
63
72
 
64
73
  ``` bash
65
- # Standalone command (defaults to pg backend)
74
+ python3 -m pip install cicwave
66
75
  cicwave output_tran/tran_SchGtTtKffVh_*
67
76
 
68
77
  # Or via cicsim subcommand
@@ -70,7 +79,8 @@ cicsim wave output_tran/tran_SchGtTtKffVh_* # tkinter backend
70
79
  cicsim wave --backend pg output_tran/tran_SchGtTtKffVh_* # pyqtgraph backend
71
80
  ```
72
81
 
73
- Supported file formats: `.raw` (ngspice), `.csv`, `.tsv`, `.txt`, `.xlsx`,
82
+ Supported file formats: `.raw` (ngspice), `.vcd`, `.prn` (Xyce),
83
+ `.iqvsa` (LitePoint VSA capture), `.csv`, `.tsv`, `.txt`, `.xlsx`,
74
84
  `.xls`, `.ods`, `.json`, `.parquet`, `.feather`, `.h5`, `.hdf5`, `.pkl`,
75
85
  `.pickle`, `.html`, `.xml`, `.fwf`, `.dta`, `.sas7bdat`, `.sav`.
76
86
 
@@ -78,10 +88,38 @@ Supported file formats: `.raw` (ngspice), `.csv`, `.tsv`, `.txt`, `.xlsx`,
78
88
  # Open CSV / Excel files
79
89
  cicwave data.csv
80
90
  cicwave data.xlsx --sheet "Sheet2"
91
+
92
+ # Open many files via a glob (works on PowerShell too; supports **)
93
+ cicwave --glob "results/*.csv"
94
+ cicwave --glob "out/**/*.raw"
81
95
  ```
82
96
 
97
+ Files are opened lazily (header-only) and parsed with `pyarrow`, so dropping
98
+ hundreds of large CSV files into the viewer is fast. Column-name unit
99
+ suffixes like `_MHz`, `[dBm]`, `(V)` are detected automatically and used
100
+ for axis labels and engineering-notation tick formatting.
101
+
83
102
  ![](wave.png)
84
103
 
104
+ ## Windows desktop shortcut
105
+
106
+ To launch `cicwave` without opening a terminal, generate a Windows
107
+ shortcut from the repo:
108
+
109
+ ``` powershell
110
+ # From the repo root
111
+ powershell -ExecutionPolicy Bypass -File scripts\make-cicwave-shortcut.ps1
112
+ # -> creates scripts\cicwave.lnk; drag it to Desktop / Start menu / taskbar.
113
+
114
+ # Or drop it straight onto the Desktop:
115
+ powershell -ExecutionPolicy Bypass -File scripts\make-cicwave-shortcut.ps1 -OnDesktop
116
+ ```
117
+
118
+ The script prefers `cicwavew.exe` (the GUI wrapper, no console window)
119
+ over `cicwave.exe` and uses `cicsim/cicwave.ico` as the icon. Pass
120
+ `-WithConsole` if you want the shortcut to launch the console build
121
+ (useful for seeing startup log output).
122
+
85
123
  ## Wave viewer keyboard shortcuts
86
124
 
87
125
  | Key | Action |
@@ -93,12 +131,16 @@ cicwave data.xlsx --sheet "Sheet2"
93
131
  | `R` | Reload all waves |
94
132
  | `L` | Toggle legend |
95
133
  | `Ctrl+O` | Open file |
96
- | `Ctrl+P` | Export PDF |
134
+ | `Ctrl+P` | Export PDF / PNG / SVG |
135
+ | `Ctrl+E` | Export plotted data (CSV / TSV / Parquet / Feather / HDF5) |
97
136
  | `Ctrl+N` | New plot tab (pg) |
98
137
  | `Ctrl+W` | Close current tab (pg) |
99
138
  | `Ctrl+Q` | Quit |
100
139
  | Scroll | Zoom x-axis |
101
140
  | Shift+Scroll | Zoom y-axis |
141
+ | Right-drag | Rubber-band zoom rectangle (pg) |
142
+ | Shift+Right-drag | Pan x-axis (pg) |
143
+ | Ctrl+Right-drag | Pan y-axis (pg) |
102
144
 
103
145
  ## Analysis functions (pg backend, right-click menu)
104
146
 
@@ -136,6 +178,13 @@ Commands:
136
178
  summary Generate simulation summary for results
137
179
  template Run an IP template with <options> YAML file
138
180
  wave Open waveform viewer
181
+
182
+ Key options for run:
183
+ --threads N Run N simulations in parallel
184
+ --progress Show tqdm progress bar instead of interleaved logs
185
+ --timeout N Kill any simulation that runs longer than N seconds
186
+ --sha / --no-sha Skip re-running simulations whose input files haven't changed
187
+ --count N Run each corner N times (Monte Carlo)
139
188
  ```
140
189
 
141
190
  A standalone command is also available:
@@ -146,8 +195,13 @@ Usage: cicwave [OPTIONS] [FILES]...
146
195
  Waveform viewer (standalone). Defaults to the pyqtgraph backend.
147
196
 
148
197
  Options:
198
+ --glob TEXT Glob pattern (repeatable, supports ** for recursion)
149
199
  --x TEXT Specify x-axis
150
200
  --backend [tk|pg] GUI backend (default: pg)
151
201
  --sheet TEXT Sheet name for Excel files
202
+ --pivot TEXT Pivot spec file (YAML/JSON)
203
+ --pivot-info Print pivot dimensions and exit
204
+ --session TEXT Load session file (.cicwave.yaml)
205
+ --export TEXT Export plot to file (PDF/PNG/SVG) and exit
152
206
  --help Show this message and exit.
153
207
  ```
@@ -0,0 +1,42 @@
1
+ #from .spectrewriter import *
2
+ from .spiceparser import *
3
+ from .spec import *
4
+ from .command import *
5
+ from .cdsconf import *
6
+
7
+ import importlib.util
8
+
9
+ #- Each import is guarded individually so a missing optional dep (e.g. ``rich``)
10
+ #- doesn't silently skip later modules. Previously a single try/except wrapping
11
+ #- the whole block meant that a missing ``rich`` (used by ``cmdresults``) hid
12
+ #- ``ngraw`` and broke ``.raw`` loading in the wave viewer on machines without
13
+ #- the full set of optional deps installed (e.g. macOS dev installs).
14
+ for _modname in (
15
+ "simcalc",
16
+ "cmdip",
17
+ "cmdspider",
18
+ "cmdresults",
19
+ "cmdsimdir",
20
+ "cmdsimdirng",
21
+ "cmdrun",
22
+ "cmdrunng",
23
+ "cmdsummary",
24
+ "cmdarchive",
25
+ "ngraw",
26
+ "plot",
27
+ ):
28
+ try:
29
+ _mod = __import__(__name__ + "." + _modname, fromlist=["*"])
30
+ for _attr in getattr(_mod, "__all__", None) or [
31
+ a for a in dir(_mod) if not a.startswith("_")
32
+ ]:
33
+ globals()[_attr] = getattr(_mod, _attr)
34
+ except ModuleNotFoundError:
35
+ #- Allow lightweight use of parser/spec helpers without optional data deps.
36
+ pass
37
+
38
+ if importlib.util.find_spec("tkinter"):
39
+ try:
40
+ from .cmdwave import *
41
+ except ModuleNotFoundError:
42
+ pass
@@ -114,7 +114,7 @@ class CdsConfig(cs.Command):
114
114
  with open(filename,"r") as fi:
115
115
  ys = yaml.safe_load(fi)
116
116
 
117
- if(ys == None):
117
+ if ys is None:
118
118
  return
119
119
 
120
120
  if(self.config is None):
@@ -158,13 +158,6 @@ class CdsConfig(cs.Command):
158
158
  logger.error(f"Argument cadence->{key} is not specified, specify either on command line or in config file")
159
159
 
160
160
 
161
- def getShortName(self,corner):
162
- sname = ""
163
- for c in corner:
164
- c = c.replace(",","")
165
- sname += c
166
- return sname
167
-
168
161
  def getPermutations(self,corner):
169
162
  data = []
170
163
  for c in corner:
@@ -29,12 +29,11 @@
29
29
  import yaml
30
30
  import click
31
31
  import sys
32
- import re
33
32
  import os
33
+ import glob as _glob
34
34
  import cicsim as cs
35
35
  from cicsim.command import setup_logging
36
36
  import importlib
37
- import pandas as pd
38
37
  import matplotlib.pyplot as plt
39
38
 
40
39
 
@@ -67,12 +66,15 @@ def cli(ctx,color):
67
66
  @click.option("--ignore/--no-ignore", default=False,is_flag=True, help="Ignore error checks")
68
67
  @click.option("--sha/--no-sha", default=None, help="Check SHA of input files")
69
68
  @click.option("--replace",default=None, help="YAML file with replacements for netlist")
69
+ @click.option("--threads", default=1, help="Number of parallel simulation threads")
70
+ @click.option("--progress/--no-progress", default=False, help="Show progress bar instead of interleaved logs")
71
+ @click.option("--timeout", default=None, type=int, help="Timeout in seconds per simulation (default: no limit)")
70
72
  @click.pass_context
71
- def run(ctx,testbench,run,corner,count,name,ignore,sha,replace):
73
+ def run(ctx,testbench,run,corner,count,name,ignore,sha,replace,threads,progress,timeout):
72
74
  """Run a ngspice simulation of TESTBENCH
73
75
  """
74
76
 
75
- r = cs.CmdRunNg(testbench,run,corner,name,count,sha)
77
+ r = cs.CmdRunNg(testbench,run,corner,name,count,sha,threads=threads,progress=progress,timeout=timeout)
76
78
  r.loadReplacements(replace)
77
79
 
78
80
  r.run(ignore)
@@ -91,7 +93,11 @@ def archive(ctx,name,runfiles):
91
93
 
92
94
  @cli.command()
93
95
  @click.argument("files",nargs=-1)
94
- @click.option("--x",default=None,help="Specify x-axis")
96
+ @click.option("--glob","globs",multiple=True,
97
+ help="Glob pattern (repeatable). Supports ** for recursion. "
98
+ "Useful on shells like PowerShell that don't auto-expand.")
99
+ @click.option("--x", default=None,
100
+ help="X-axis column; else CICWAVE_X / CICSIM_X_AXIS; else saved default (pg); else auto")
95
101
  @click.option("--backend",default="tk",type=click.Choice(["tk","pg"]),
96
102
  help="GUI backend: tk (tkinter+matplotlib) or pg (PySide6+pyqtgraph)")
97
103
  @click.option("--sheet",default=None,help="Sheet name for Excel files (default: first sheet)")
@@ -99,7 +105,7 @@ def archive(ctx,name,runfiles):
99
105
  @click.option("--pivot-info",is_flag=True,default=False,help="Print pivot dimensions and exit")
100
106
  @click.option("--session",default=None,help="Load session file (.cicwave.yaml)")
101
107
  @click.option("--export",default=None,help="Export plot to file (PDF/PNG/SVG) and exit")
102
- def wave(files,x,backend,sheet,pivot,pivot_info,session,export):
108
+ def wave(files,globs,x,backend,sheet,pivot,pivot_info,session,export):
103
109
  """Open waveform viewer.
104
110
 
105
111
  Interactive waveform viewer for SPICE simulation results (.raw files).
@@ -130,8 +136,9 @@ def wave(files,x,backend,sheet,pivot,pivot_info,session,export):
130
136
  Mouse (pg backend):
131
137
  Scroll Zoom x-axis
132
138
  Shift+Scroll Zoom y-axis
133
- Shift+Right-drag Zoom x-axis
134
- Ctrl+Right-drag Zoom y-axis
139
+ Right-drag Zoom to rubber-band rectangle
140
+ Shift+Right-drag Pan x-axis
141
+ Ctrl+Right-drag Pan y-axis
135
142
  Left-drag Pan
136
143
 
137
144
  \b
@@ -157,14 +164,58 @@ def wave(files,x,backend,sheet,pivot,pivot_info,session,export):
157
164
  --session plot.cicwave.yaml Load saved session
158
165
  --export plot.pdf Export to file and exit (no GUI)
159
166
  --session s.yaml --export out.pdf Restore session and export
160
- """
161
167
 
168
+ \b
169
+ Globs:
170
+ --glob 'data/*.csv' Repeatable, supports ** for recursion
171
+ --glob '**/*.raw' Useful on PowerShell which doesn't
172
+ auto-expand patterns
173
+ """
174
+ files = _expand_glob_patterns(files, globs)
162
175
  _run_wave(files, x, backend, sheet, pivot, pivot_info,
163
176
  session_path=session, export_path=export)
164
177
 
165
178
 
179
+ def _resolve_wave_x_from_cli_env(cli_x):
180
+ """Apply --x, else CICWAVE_X / CICSIM_X_AXIS environment variables."""
181
+ if cli_x:
182
+ return cli_x
183
+ v = os.environ.get("CICWAVE_X") or os.environ.get("CICSIM_X_AXIS")
184
+ if v and str(v).strip():
185
+ return str(v).strip()
186
+ return None
187
+
188
+
189
+ def _expand_glob_patterns(files, patterns):
190
+ """Merge positional ``files`` with files matched by --glob ``patterns``.
191
+
192
+ Each pattern is expanded with ``glob.glob(..., recursive=True)`` so that
193
+ ``**`` works. Order: positional first, then each pattern in order. Files
194
+ are de-duplicated while preserving first-seen order. Patterns that match
195
+ nothing are reported on stderr but not fatal.
196
+ """
197
+ out = []
198
+ seen = set()
199
+ for f in files:
200
+ if f not in seen:
201
+ seen.add(f)
202
+ out.append(f)
203
+ for pat in patterns or ():
204
+ matches = sorted(_glob.glob(pat, recursive=True))
205
+ if not matches:
206
+ print("warning: --glob '%s' matched no files" % pat,
207
+ file=sys.stderr)
208
+ continue
209
+ for m in matches:
210
+ if m not in seen:
211
+ seen.add(m)
212
+ out.append(m)
213
+ return tuple(out)
214
+
215
+
166
216
  def _run_wave(files, x, backend, sheet, pivot_spec=None,
167
217
  pivot_info_flag=False, session_path=None, export_path=None):
218
+ x = _resolve_wave_x_from_cli_env(x)
168
219
  if pivot_spec:
169
220
  from cicsim.pivot import load_spec, pivot_info, apply_pivot
170
221
  from cicsim.wavefiles import WaveFile
@@ -186,13 +237,34 @@ def _run_wave(files, x, backend, sheet, pivot_spec=None,
186
237
 
187
238
  if backend == "pg":
188
239
  try:
189
- from cicsim.cmdwave_pg import CmdWavePg
240
+ # Delegate to standalone cicwave package for PyQtGraph backend
241
+ import cicwave.cli
242
+ # Convert arguments to match cicwave CLI expectations
243
+ cicwave_args = []
244
+ if files:
245
+ cicwave_args.extend(files)
246
+ if x:
247
+ cicwave_args.extend(['--x', x])
248
+ if sheet:
249
+ cicwave_args.extend(['--sheet', sheet])
250
+ if pivot_spec:
251
+ cicwave_args.extend(['--pivot', pivot_spec])
252
+ if pivot_info_flag:
253
+ cicwave_args.append('--pivot-info')
254
+ if session_path:
255
+ cicwave_args.extend(['--session', session_path])
256
+ if export_path:
257
+ cicwave_args.extend(['--export', export_path])
258
+
259
+ # Use cicwave's internal _run_wave_pg function directly
260
+ from cicwave.cli import _run_wave_pg
261
+ _run_wave_pg(files, x, sheet, pivot_spec, pivot_info_flag, session_path, export_path)
262
+ return
190
263
  except ImportError as e:
191
- print("Error: pyqtgraph backend requires PySide6 and pyqtgraph")
192
- print("Install with: pip install PySide6 pyqtgraph")
264
+ print("Error: PyQtGraph backend requires cicwave package")
265
+ print("Install with: pip install cicwave")
193
266
  print(f" ({e})")
194
267
  sys.exit(1)
195
- c = CmdWavePg(x)
196
268
  else:
197
269
  if not importlib.util.find_spec("tkinter"):
198
270
  print("Error: Could not find tkinter. Install python3-tk")
@@ -222,41 +294,6 @@ def _run_wave(files, x, backend, sheet, pivot_spec=None,
222
294
  c.run()
223
295
 
224
296
 
225
- @click.command()
226
- @click.argument("files", nargs=-1)
227
- @click.option("--x", default=None, help="Specify x-axis")
228
- @click.option("--backend", default="pg", type=click.Choice(["tk", "pg"]),
229
- help="GUI backend (default: pg)")
230
- @click.option("--sheet", default=None, help="Sheet name for Excel files (default: first sheet)")
231
- @click.option("--pivot", default=None, help="Pivot spec file (YAML/JSON)")
232
- @click.option("--pivot-info", is_flag=True, default=False, help="Print pivot dimensions and exit")
233
- @click.option("--session", default=None, help="Load session file (.cicwave.yaml)")
234
- @click.option("--export", default=None, help="Export plot to file (PDF/PNG/SVG) and exit")
235
- def cicwave(files, x, backend, sheet, pivot, pivot_info, session, export):
236
- """Waveform viewer (standalone).
237
-
238
- Shortcut for 'cicsim wave --backend pg'. Opens the pyqtgraph-based
239
- waveform viewer by default.
240
-
241
- Supports: .raw, .csv, .tsv, .xlsx, .json, .parquet, .feather, .h5,
242
- .pkl, and more.
243
-
244
- \b
245
- Pivot:
246
- --pivot spec.yaml Reshape data using pivot spec before viewing
247
- --pivot-info Print unique values per pivot dimension and exit
248
-
249
- \b
250
- Session:
251
- --session plot.cicwave.yaml Load saved session
252
- --export plot.pdf Export to file and exit (no GUI)
253
- --session s.yaml --export out.pdf Restore session and export
254
- """
255
- _run_wave(files, x, backend, sheet, pivot, pivot_info,
256
- session_path=session, export_path=export)
257
-
258
-
259
-
260
297
  @cli.command()
261
298
  @click.argument("testbench")
262
299
  @click.argument("corner",nargs=-1)