Creating / editing schematics

Launching the schematic editor from the GUI

The Structured Electronic Design Environment interfaces with both SLiCAP and NGspice. Although schematics for both applications may look similar, models and component attributes differ for both applications. SLiCAP is intended for symbolic analysis of linear continuous-time, dynamic circuits, whereas NGspice supports numeric analysis of nonlinear, time-variant, dynamic circuits. For this reason, The GUI uses different symbol sets and libraries for SLiCAP and NGspice. SLiCAP schematic files use the file extension .slicap_sch and NGspice schematics use .spice_sch as file extension.

The schematic edditor can be started as follows:

  1. From the main menu select File -> New SLiCAP Schematic

  2. From the main menu select File -> New NGspice Schematic

  3. From the main menu select File -> Open schematic

Below the screenshot after creating a new SLiCAP schematic.

../../_images/new_schematic.png

After saving it as “my_circuit.slicap_sch” it becomes visible in the Project panel (in the .sch folder):

../../_images/my_circuit.png

Launching the schematic editor from outside the GUI

From a Python session or Jupyter notebook (the usual way):

import SLiCAP as sl
sl.initProject("My Design")

sl.startSchematic()                                # empty editor; choose type from the File menu
sl.startSchematic(config='basic')                  # SLiCAP basic-symbol capture mode
sl.startSchematic(file='sch/mydesign.slicap_sch')  # open an existing file
sl.startSchematic(config='basic', file='sch/mydesign.slicap_sch')

The call returns immediately; the editor runs as an independent process alongside the Python session (schematic-only: no Instruction/Log panels).

config selects the capture mode. It sets the symbol library and restricts which schematic type may be created or opened:

config

Symbol set loaded

Schematic type

None (default)

chosen per schematic

both SLiCAP and NGspice allowed

'basic'

Symbols.slicap_sym only (basic IEC/SLiCAP symbols only)

SLiCAP only (NGspice disabled)

'slicap'

the complete SLiCAP library (all SVG files in the system symbols directory)

SLiCAP only (NGspice disabled)

'ngspice'

the NGspice symbol library

NGspice only (SLiCAP disabled)

In a restricted mode the entry of the other type, File ‣ New SLiCAP Schematic or File ‣ New NGspice Schematic, is greyed out. File ‣ Open schematic… lists only files of the permitted type.

file is the path to a schematic to open at startup; its type is inferred from the extension (.slicap_sch or .spice_sch). A canvas is shown only when a file is given — otherwise the editor opens empty and you create or open a schematic from the File menu (honouring the capture mode).

From the command line (for scripting or desktop shortcuts):

$ slicap                                                       # full editor, both types
$ slicap-schematics                                            # schematic-only editor, empty
$ slicap-schematics --config basic                             # basic SLiCAP mode, empty
$ slicap-schematics --config ngspice sch/mydesign.spice_sch    # open an NGspice file
$ python -m SLiCAP.schematic.main --schematic-only --config basic

Without a file the editor opens empty; use the File menu to create or open a schematic in the selected mode.

The main window

The schematic menu bar at a glance

By default each schematic is displayed in a separate tab, but each open schematic has its own panel with its own menu bar with actions on that schematic:

Menu

Contents

File

Save schematic (Ctrl+S), Save schematic as (Ctrl+Shift+S), Schematic properties, Export netlist (Ctrl+E), Export SVG, Export PDF, Print schematic (Ctrl+P), Drawing preferences.

Edit

Undo (Ctrl+Z), Redo (Ctrl+Y), Bring to front (Ctrl+Shift+]), Bring forward (Ctrl+]), Send backward (Ctrl+[), Send to back (Ctrl+Shift+[).

View

Fit (F), Zoom In (+), Zoom Out (-), Reset Zoom (Ctrl+0).

Circuit

What reaches the netlist: Symbol (S), Wire (W), Net Label (L), Junction (J), Library, New subcircuit symbol (see Hierarchical Blocks), Parameters, Define src / det / lg ref, Model definition.

Insert

Objects that follow the runs: Figure from design data, LaTeX from design data, LaTeX snippet file, Image.

Draw

Annotation by hand: Line, Rectangle, Ellipse, Polygon, Arc, Curve, Function curve, Text (T), Hyperlink, LaTeX text.

Document

Document properties, Border (B).

Tools

Rename Components, Load selected symbols from library, Update symbols from library, Import symbols from file.

Instruction

Create circuit object, Create / edit SLiCAP instruction and Transfer function (SLiCAP schematics). Create netlist, Create / edit NGspice instruction and Create / edit NGspice control section (NGspice schematics). See Instructions and Circuit Objects.

A poster has no Circuit, Tools or Instruction menu. Its Insert menu also places a schematic or another poster (see Posters).

Creating and opening schematics, and application-wide actions, live in the main window’s menu bar:

Menu

Contents

File

New project, Select project folder, Save project, Close project. New SLiCAP Schematic, New NGspice Schematic, Open schematic (Ctrl+O), New poster (see Posters), New symbol, Edit symbol (see The symbol editor), New Instruction file, Open instruction file. Preferences, Edit main configuration file. Exit (Ctrl+Q).

View

Show/hide the Project, Design data, Instructions and Log panels. Reset panel layout.

Instruction

Create / Edit Traces and Measurements, Axes and Figures. Create LaTeX snippet, Create RST (Sphinx) snippet (see Snippets). Create / Edit specifications. Update schematic images. Run (F5), Stop (F6).

Help

Show HTML Documentation (F1), Keyboard shortcuts, Create shortcut, Check for updates, About.

Help > Keyboard shortcuts lists every shortcut: those of the menus, and the keys the canvas handles itself, such as R to rotate, M to mirror, / to switch the corner of a wire, Del, Esc and Enter. The list is read from the program, so it always matches it.

Help > Create shortcut puts SLiCAP in the launcher of your system, with the icon of SLiCAP:

  • On Windows it makes a shortcut in the start menu and one on the desktop. To keep SLiCAP in the taskbar, right-click it in the start menu and choose Pin to taskbar.

  • On Linux it makes the entry slicap.desktop in ~/.local/share/applications. SLiCAP then appears in the applications overview. To keep it in the dock, right-click it there and choose Add to Favorites.

The shortcut starts SLiCAP with the Python environment that runs the GUI when you create it. In an Anaconda environment on Windows, the shortcut first activates that environment, as Anaconda’s own shortcuts do. When you start SLiCAP from another environment, create the shortcut again: it then replaces the old one.

Started from the shortcut, SLiCAP has no console window. Its messages go to the file gui.log in the folder SLiCAP of your home folder. Look there when SLiCAP does not start. The file is new at every start.

A first schematic in five steps

  1. Place a symbol. Open Circuit ‣ Symbol… (shortcut S), pick a resistor and click on the canvas to drop it. See Placing Symbols.

  2. Wire it up. Choose Circuit ‣ Wire (shortcut W) and click from one pin to the next. Unconnected pins show a small grey marker that disappears once a wire reaches them. See Wiring.

  3. Set values. Double-click a component to open its Properties dialog and enter a value (for example R_s for a resistance). See Component Properties.

  4. Mark source and detector. Use Circuit ‣ Define src / det / lg ref… to designate the independent source and the detector. Do this as the last step, with the schematic complete and saved: the dialog’s drop-down lists come from the parsed circuit, so elements added later are not offered until the dialog is reopened (see Net Labels, Ports & Ground).

  5. Save and export. File ‣ Save schematic writes the .slicap_sch file; File ‣ Export netlist… produces a .slicap_cir netlist for SLiCAP. See Netlist & Export.

A schematic can also be saved as a reusable subcircuit and placed as a block in other schematics; see Hierarchical Blocks.

Below an example of a SLiCAP schematic with default preferences and LaTeX rendering enabled.

../../_images/RCcircuit.png

LaTeX labels

With LaTeX rendering on, pdflatex and dvisvgm typeset the values and reference designators of the components. The editor renders them in the background:

  • A placed, edited or pasted component shows its labels as plain text at once. The typeset labels replace them when they are ready. Meanwhile the status bar says Rendering n LaTeX labels.

  • Opening a schematic, undo, redo, export and print wait until their labels are rendered, with the window responsive. After half a second a window says that LaTeX is rendering. Continue with plain text ends the wait.

  • MiKTeX may ask in a window of its own to install a missing package. That window can open behind the editor. The rendering waits for the answer.

  • A value whose LaTeX does not compile keeps its plain text.

The rendered labels are kept in the .cache sidecar, so the next opening renders nothing.

Sidecar files

A schematic is self-contained: everything it needs to look and behave the same on another machine travels next to it in sch/. Saving my_circuit.slicap_sch creates and maintains a small set of sidecar files with the same base name.

File

Contents

my_circuit.slicap_sch

The schematic itself (components, wires, labels, annotations) — the file you open and save.

my_circuit.ini

This schematic’s style (line widths, colours, fonts), so it always looks as it did when saved. See Preferences.

my_circuit.symbols

Frozen copies of every symbol the schematic uses, so it renders with the exact symbols it was drawn with. See Symbol Libraries.

my_circuit.cache

A cache of rendered LaTeX labels, so re-opening is fast. Created only if the schematic actually contains typeset expressions; safe to delete.

Why sidecar files

  • Portability — copy the .slicap_sch together with its .ini and .symbols to another computer and it looks and netlists identically.

  • Reproducibility — a figure in a book keeps its appearance even if the application’s default symbols or style change later.

  • No clutter — the render cache lives next to the schematic, not in a global folder that quietly grows over time. Deleting a project removes all its files together.

Note

The .ini and .symbols files are part of the project and should be kept (and version-controlled) with the schematic. The .cache directory is regenerated automatically and can be ignored or deleted.