Chapter 3. Spice4qucs subcircuits, macromodels and device libraries

3.1 Spice4qucs Subcircuits: with and without parameters

Subcircuits are a concept that has been part of established circuit simulation practice since the early days of computer aided circuit design. Today, all practical circuit simulators have subcircuits as part of their basic device compliment. This is not surprising because they form a natural way of breaking an electonic system down into a number of smaller self contained functional blocks. Spice4qucs supports all the features available with Qucs subcircuits. In a similar fashion to Qucs, the Ngspice, Xyce and SPICE OPUS circuit simulators allow subcircuits with or without parameters. However, an optional part of the Ngspice, Xyce and SPICE OPUS subcircuit netlist syntax that signifies that a parameter extension is present is not allowed (see section 3.1.2). As a starting point spice4qucs subcircuits without parameters are considered first. This introduction is followed by a detailed description of the structure, and netlist syntax, of subcircuits with one or more parameters.

3.1.1 Spice4qucs subcircuits without parameters

Figure 3.1 shows a Qucs subcircuit model for a 15MHz centre frequency band pass passive filter. Note that the three distinct parts of a subcircuit model without parameters are: (1) a circuit representing the model body with one or more input (Pin) and output (Pout) pins plus connected components selected from Qucs pre-defined components and user designed subcircuits ( there are no user defined subcircuits present in Figure 3.1), (2) a subcircuit symbol, and (3) a Qucs netlist giving a list of the internal components, their connection nodes and a wrapper which defines the subcircuit. The syntax of the subcircuit netlist listed in Figure 3.1 is only understood by Qucs and cannot be read without error by external SPICE simulators.

BPFCh3Fig1_EN

Figure 3.1 Qucs 15MHz centre frequency band pass passive filter subcircuit without parameters

A test bench circuit for simulating the band pass filter circuit shown in Figure 3.1 is given in Figure 3.2. This figure includes a plot of the small signal AC output voltage for a filter with 50 Ohm input and output matching resistors. Note the use of a node voltage probe and the signal name allocated by Qucs. Also note that the individual capacitor voltage and inductor current initial conditions are not set as they are not needed due to fact that the filter subcircuit is not DC biased. As a consequence the DC simulation icon shown in Figure 3.2 is not strictly necessary. However, its a good idea to add it automatically to AC simulations because circuits with semiconductor devices or other non-linear components must have their small signal AC properties calculated, at their DC bias conditions, prior to small signal AC simulation.

BPFCh3Fig2_EN

Figure 3.2 Qucs 15MHz centre frequency band pass passive filter test bench with 50 Ohm source and load matching

Figure 3.3 to Figure 3.5 present AC simulation results for the band pass filter generated with the Ngspice, Xyce and SPICEOPUS circuit simulators.

BPFCh3Fig3_EN

Figure 3.3 Band pass filter Ngspice test results and SPICE netlist for test bench circuit.

BPFCh3Fig4_EN

Figure 3.4 Band pass filter Xyce test results and SPICE netlist for test bench circuit.

BPFCh3Fig5_EN

Figure 3.5 Band pass filter SPICEOPUS test results and SPICE netlist for test bench circuit.

Most readers will probably have noticed that the SPICE netlists for the Ngspice and SPICEOPUS band pass filter test benches are identical except for file names. This is because Ngspice and SPICEOPUS both include implementations of the SPICE 3f5 Nutmeg post simulation data processing package that is distributed with their SPICE engines. These are not the same however, mainly because the SPICE OPUS development team have modified the original SPICE 3f5 Nutmeg package to firstly remove errors/bugs and secondly to improve its syntax. The extent to how this will affect the operation of spice4qucs is at this time unclear. If problems/bugs, due to implementation differences, surface in the future the spice4qucs Development Team will attempt to correct them as quickly as possible. The Xyce circuit simulator does not include a version of Nutmeg in its distribution package. This implies that Nutmeg style post simulation data processing is not possible with Xyce. However, to minimise the effects of this omission an extended form of the SPICE .PRINT statement has been implemented in Xyce, allowing algebraic expressions for data processing to be embedded in .PRINT statements. This topic and other aspects of Xyce post simulation data processing are covered in later sections of this help manual.

3.1.2 Spice4qucs subcircuits with parameters

Subcircuits which have component or physical parameter values set by a list of names and values attached to a schematic symbol add a significant “value added” feature to the subcircuit concept. This form of subcircuit can, for example, be used to represent manufacturers product variations which have identical circuits but require component values or device parameter values of differing value. Unfortunately, SPICE 3f5 only implements subcircuits without parameters. Recent generations of open-source GPL circuit simulators, including Ngspice, Xyce and SPICE OPUS, have been extended by their Development Teams to allow subcircuits with parameters. One consequence of this is that over time divergence of the SPICE subcircuit statement syntax has occurred amongst different circuit simulators. Spice4qucs implements a common subset of the published extended SPICE subcircuit syntax. This works well, but does have one disadvantage however, in that some published subcircuit netlists may require a small amount of editing before they will simulate with Spice4qucs. One code word often found in the SPICE extended subcircuit syntax is the term PARAMS:. This can occur in an X subcircuit call to signify a subcircuit with parameters. As this is optional in Ngspice, and indeed in other SPICE derived circuit simulators, it is not implemented in Spice4qucs.

Qucsator, Ngspice, Xyce and SPICEOPUS all allow parameters to be attached to subcircuit symbols and to be used in design equation calculations. As an introductory example Figure 3.6 illustrates a circuit schematic and user generated symbol for a simple Qucs harmonic generator composed of a fundamental AC signal and three sinusoidal harmonic components. Parameters \(f1\) to \(f4\) set the frequencies of the harmonics. The Qucs Equation block, at the subcircuit internal circuit level, is used to calculate the individual harmonic frequencies. In a similar fashion \(ph1\) to \(ph4\) represent the phases of the signal harmonics.

QucsHgen_EN

Figure 3.6 Qucs subcircuit sinusoidal harmonic signal generator: \(f1\) is the fundamental frequency and \(f2\) to \(f4\) the higher order harmonics; \(ph1\) to \(ph4\) the phases of the fundamental signal and its harmonics. For clarity long Qucs netlist lines have been spread over more than one line.

NgspiceHgen_EN

Figure 3.7 Ngspice subcircuit sinusoidal harmonic signal generator.

Figure 3.7 shows an Ngspice version of the Qucs sinusoidal harmonic generator illustrated in Figure 3.6. A casual look at these two subcircuit diagrams shows that they are not dissimilar. However, there are a number of subtle changes apparent from the diagrams. First it is important to realise that the Qucs and SPICE sinusoidal (sin) signal generator specifications are different; Qucs requires the signal phase and SPICE the signal delay to be specified as parameters. In Figure 3.7 extra equations to convert phase to time delay are added to Equation block Eqn1 inside subcircuit SPICEHarmonicGen. To ensure that Eqn1 variables, for example frequency \(f2\), are passed to the subcircuit component values as numerical values SPICE curly deliminator brackets, {...}, are placed round equation variable names. Finally, it is important to realize that the order of the variables in Equation blocks are important. Qucs allows them to be in any order because it arranges all entries into a sequence which ensures each variable can be allocated a numerical value before it is used in other equations. However, SPICE does not do the same but assumes that all variables included in the right hand side of an equation have been allocated a numerical value prior to being used in the calculation of the variable named on the left hand side of the same equation. To check that the Ngspice generated waveform is correctly generated a Fourier analysis of signal \(V(ngensig)\) is displayed on Figure 3.7. At frequencies above \(f4\) the phase values have no meaning. The simulated signal waveform obtained with SPICE OPUS was found to be similar to that obtained with NGSPICE, see Figue 3.8. Try simulating the sinusoidal harmonic generator waveform with SPICE OPUS to check this statement for your self.

XyceHgen_EN

Figure 3.8 Xyce subcircuit sinusoidal harmonic signal generator.

3.1.3 A second more complex example of Spice4qucs subcircuits with parameters

Variable assignment equations, defined in Qucs Equation Eqn blocks and embedded in a subcircuit, are converted by Spice4qucs into SPICE .PARAM statements. These are listed in the initial section of the SPICE-netlist of the circuit being simulated, or in the first section of a subcircuit netlist, allowing their values to be determined before the start of a simulation. With Qucs Equation Eqn blocks it is important to remember that the variables defined cannot be functions of circuit voltage or current or any other voltage/current dependent properties. Restrictions placed by Spice4qucs on the use of Qucs Equation Eqn blocks are considered in detail in Chapter 4. However, one fundamental rule that must be followed at all times is that Qucs simulation icons must not be placed inside a subcircuit.

The electrical equivalent circuit of a HC-49/U 8.86 MHz Quartz crystal resonator is shown in Figure 3.9. In this model the crystal resonator is represented as the RCL parallel electric network illustrated in the following two schematics:

  • quarz.sch — Quartz crystal resonator subcircuit; Figure 3.9.
  • quarz_test.schSpice4qucs test circuit; Figure 3.10.

These files can be found in the Qucs-S subdirectory examples\ngspice\.

Figure 3.9 shows the crystal resonator subcircuit. A brief introduction to the theory of crystal resonators can be found at https://en.wikipedia.org/wiki/Crystal_oscillator.

Quarz_SUBCKT_EN

Figure 3.9 Equivalent circuit of Quartz crystal resonator.

In the HC-49/U Quartz crystal resonator model the \(RCL\) network has two resonant frequencies:

a series resonance frequency \(f\), where

\[f=\frac{1}{2\pi\sqrt{L_{q}C_{q}}}\]

and a parallel resonance frequency \(f_{p}\), where

\[f_p=\frac{1}{2\pi\sqrt{L_{q}C_{q}}}\sqrt{1+\frac{C_{q}}{C_s}}\]

Transposing equation \(f\) yields an expression for the series capacitance \(C_q\), where

\[C_q=\frac{1}{4\pi^2f^2L_q^2}\]

This equation is placed in Qucs Equation Eqn1 block inside the Quartz crystal resonator subcircuit.

Performing an AC simulation with Ngspice and Xyce, using the test circuit given in Figure 3.10, yields the amplitude response data plotted in Figure 3.11, Ngspice transfer coefficient K (ac.k) and Xyce voltage ac.V(OUT).

Quarz_EN

Figure 3.10 Test circuit for Quartz crystal resonator.

Figure 3.11 indicates that the Ngspice and Xyce plotted results are identical. The only difference being that Xyce simulation result postprocessing is not implemented. Hence, only the Xyce output voltage can be plotted; this is done by choosing a logarithmic Y scale, then the Xyce plot effectively displays a scaled decibel output. The two resonant frequencies \(f\) and \(f_p\) are clearly visible on these plots.

Quarz_Sim_EN

Figure 3.11 Magnitude response of HC-49/U Quartz crystal.

Subcircuits are converted by Spice4qucs into SPICE .SUBCKT routines. The SPICE netlist for the Quartz crystal resonator test circuit, Figure 3.10, shown below illustrates how the Spice4qucs handles SPICE .PARAM, .SUBCIRCUIT and subcircuit X call statements, placing them in the correct position within the SPICE netlist of the circuit being simulated.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
* Qucs 0.0.19  /home/vvk/qucs/examples/ngspice/quarz_test.sch
* Qucs 0.0.19  /home/vvk/qucs/examples/ngspice/quarz.sch
.SUBCKT quarz _net0 _net1 f=8863k Lq=0.01406 Cs=6.5p 
.PARAM Cq={1/(4*3.1415926539^2*f^2*Lq)}
R1 _net0 _net1  50MEG
C2 _net0 _net1  {CS} 
R2 _net2 _net1  2
L1 _net3 _net2  {LQ} 
C1 _net0 _net3  {CQ} 
.ENDS
R1 out 0  1
V1 _net0 0 DC 0 SIN(0 1 1G 0 0) AC 1
R2 _net0 in  50
XSUB1  in out quarz f=8863K Lq=0.01406 Cs=6.5P
.control
set filetype=ascii
AC LIN 400 8800K 9000K 
let K=dB(V(out)/V(in))
write quarz_test_ac.txt v(in) v(out)  K
destroy all
exit
.endc
.END

3.2 Component and circuit libraries

Library components are supported in spice4qucs subsystem. You can use all library components. Some libraries have embedded original SPICE code of components. You should prefer to use these libraries to archive the best result with Spice simulation of Qucs schematics. The example of library component (IRFZ44 MOSFET from MOSFETS library) usage is examples/ngspice/irfz44_switch.sch

3.3 Using manufacturers component data libraries

Electronic components manufacturers often provide spice models of components in datasheets. You can attach these datasheet spice models using SPICE netlist component. You need to perform the following steps to use Spice-model from component datasheet. Spice netlist builder substitutes SPICE-models directly to output netlist without any conversions.

1. Extract Spice netlist text and save it as text file. You can use any extension for this file. Preferable are .ckt , .cir, .sp

2. Place on schematic component SPICE netlist and attach SPICE netlist nodes to component port using standard SPICE component properties dialog.

  1. Simulate schematic with Ngspice/Xyce.

It’s need to note that SPICE-netlist of component must not be ended by .END directive. In this case simulator exits after it reads .SUBCKT routine and simulation cannot be executed.

The example of spice model usage (LM358 opamp) is shown in the Figure 3.12

LM358_EN

Figure 3.12 AC Simulation of LM358 opamp with Ngspice.

Here is the netlist of LM358 spice-model. Model can be found in LM358 datasheet.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
* from http://www.ti.com/lit/zip/sloj045
* LM358 OPERATIONAL AMPLIFIER "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS RELEASE 4.01 ON 09/08/89 AT 10:54
* (REV N/A)      SUPPLY VOLTAGE: +/-5V
* CONNECTIONS:   NON-INVERTING INPUT
*                | INVERTING INPUT
*                | | POSITIVE POWER SUPPLY
*                | | | NEGATIVE POWER SUPPLY
*                | | | | OUTPUT
*                | | | | |
.SUBCKT LM358    1 2 3 4 5
*
C1   11 12 5.544E-12
C2    6  7 20.00E-12
DC    5 53 DX
DE   54  5 DX
DLP  90 91 DX
DLN  92 90 DX
DP    4  3 DX
EGND 99  0 POLY(2) (3,0) (4,0) 0 .5 .5
FB    7 99 POLY(5) VB VC VE VLP VLN 0 15.91E6 -20E6 20E6 20E6 -20E6
GA    6  0 11 12 125.7E-6
GCM   0  6 10 99 7.067E-9
IEE   3 10 DC 10.04E-6
HLIM 90  0 VLIM 1K
Q1   11  2 13 QX
Q2   12  1 14 QX
R2    6  9 100.0E3
RC1   4 11 7.957E3
RC2   4 12 7.957E3
RE1  13 10 2.773E3
RE2  14 10 2.773E3
REE  10 99 19.92E6
RO1   8  5 50
RO2   7 99 50
RP    3  4 30.31E3
VB    9  0 DC 0
VC 3 53 DC 2.100
VE   54  4 DC .6
VLIM  7  8 DC 0
VLP  91  0 DC 40
VLN   0 92 DC 40
.MODEL DX D(IS=800.0E-18)
.MODEL QX PNP(IS=800.0E-18 BF=250)
.ENDS


3.4 Usage of unmodified SPICE Libraries

3.4.1 SpiceLibComp device

You can use an unmodified SPICE libraries with new SpiceLibComp device. This component could be found at the File components group. This component have three properties:

  • File is full SPICE library file (usually *.lib, *.cir, or *.sp files) path. You can use unmodified library here.
  • Device is SUBCKT entry name that represents desired device. Every component is defined as subcircuit and identified by .SUBCKT entry name. This property holds device name. You need to fill this property manually.
  • SymPattern is symbol pattern for device. You can select one of predefined symbol patterns or use automatic pattern. Automatic pattern is simple rectangular symbol with pins.

Let’s consider SPICE library structure. There exists a SPICE library file ad822.cir that contains AD822 model. Here is library source code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.SUBCKT AD822 1 2 99 50 25
*
* INPUT STAGE & POLE AT 5 MHZ
R3 5 99 2456
R4 6 99 2456
CIN 1 2 5E-12
C2 5 6 6.48E-12
I1 4 50 108E-6
IOS 1 2 1E-12
EOS 7 1 POLY(1) (12,98) 100E-6 1
J1 5 2 4 JX
J2 6 7 4 JX
GB1 50 2 POLY(3) (2,4) (2,5) (2,50) 0 1E-12 1E-12 1E-12
GB2 50 7 POLY(3) (7,4) (7,5) (7,50) 0 1E-12 1E-12 1E-12
*
* GAIN STAGE & POLE AT 13.4 HZ
EREF 98 0 (30,0) 1
R5 9 98 2.313E6
C3 9 25 32E-12
G1 98 9 (6,5) 4.07E-4
V1 8 98 0
V2 98 10 -1
D1 9 10 DX
D2 8 9 DX
*
* COMMON-MODE GAIN NETWORK WITH ZERO AT 1 KHZ
R21 11 12 1E6
R22 12 98 100
C14 11 12 159E-12
E13 11 98 POLY(2) (2,98) (1,98) 0 0.5 0.5
*
* POLE AT 10 MHZ
R23 18 98 1E6
C15 18 98 15.9E-15
G15 98 18 (9,98) 1E-6
*
* OUTPUT STAGE
ES 26 51 POLY(1) (18,98) 1.72 1
RS 26 22 500
V3 23 51 1.03951
V4 21 23 1.36
C16 20 25 2E-12
C17 24 25 2E-12
RG1 20 97 1E8
RG2 24 97 1E8
Q1 20 20 97 PNP
Q2 20 21 22 NPN
Q3 24 23 22 PNP
Q4 24 24 51 NPN
Q5 25 20 97 PNP 20
Q6 25 24 51 NPN 20
VP 96 97 0
VN 51 52 0
EP 96 0 POLY(1) (99,0) 0.01 1
EN 52 0 POLY(1) (50,0) -0.015 1
R25 30 99 63.5E3
R26 30 50 63.5E3
FSY1 99 0 VP 1
FSY2 0 50 VN 1
*
* MODELS USED
*
.MODEL JX NJF(BETA=7.67E-4 VTO=-2.000 IS=1E-12)
.MODEL NPN NPN(BF=120 VAF=150 VAR=15 RB=2E3 RE=4 RC=200)
.MODEL PNP PNP(BF=120 VAF=150 VAR=15 RB=2E3 RE=4 RC=900)
.MODEL DX D(IS=1E-15)
.ENDS AD822

This library example contains only one model defined by one subcircuit entry, but you can use any library containing any amount of device models.

Let’s use AD822 opamp model. Create new schematic and place SpiceLibComp device on schematic (Figure 3.13). Select ad822.cir file in the first property. Then fill ad822 (device name) in the second property.

You can either create an automatic component symbol, either use one of the predefined patterns. At current state only opamp3t and opamp5t patterns are available. These patterns represents three- and five-terminal opamps respectively. Symbol patterns are Qucs XML files. They are placed in the share/qucs/symbols subdirectory of the Qucs installation root. These files have *.sym extension. Symbol pattern format will be considered further.

SPICE netlist builder performs automatic port assignment for subcircuit pins. If automatic symbol is used symbol pin names will be automatically filled from the .SUBCKT entry definition. See Figure 3.13 for example of the automatic pin assignment.

If symbol pattern is used, the first .SUBCKT entry port will be automatically mapped to the first symbol port, etc. Symbol port sequence is defined in the symbol pattern file (*.sym) in Port description lines.

AD822_lib_EN

Figure 3.13 LM358 opamp library model usage with SpiceLibComp device

3.4.2 Symbol pattern files format description

Let’s consider symbol files format. Symbols have *.sym extension and are placed in share/qucs/symbols subdirectory of the Qucs installation tree. Qucs automatically scans content of this subdirectory and displays all found valid symbols in drop-down list in the third property (SymPattern) of the SpiceLibComp device. User can select any symbol for new SPICE library device. It’s need to create a new symbol file and place it into symbols directory to add new symbols to the existing Qucs installation.

Let’s consider symbol file format. Symbols have Qucs XML schematic format without header. An example of symbol file (five-terminal opamp) is shown in the listing below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<Symbol>
<Line -20 -40 0 80 #000080 2 1>
<Line -20 -40 60 40 #000080 2 1>
<Line -20 40 60 -40 #000080 2 1>
<Line 40 0 20 0 #000080 2 1>
<Line -40 -20 20 0 #000080 2 1>
<Line -40 20 20 0 #000080 2 1>
<Line -15 20 10 0 #000000 2 1>
<Line -10 -25 0 10 #ff0000 0 1>
<Line -15 -20 10 0 #ff0000 0 1>
<Line 10 -20 0 -20 #000080 2 1>
<Line 10 20 0 20 #000080 2 1>
<.PortSym 10 40 4 0>
<.PortSym 10 -40 3 0>
<.PortSym -40 20 2 0>
<.PortSym -40 -20 1 0>
<.PortSym 60 0 5 180>
<.ID 30 24 OP>
</Symbol>

Automatic symbol files preparation is not yet implemented, but you can use Qucs schematic editor to create new symbol files. You may use the following sequence to create new symbol:

  • Create Qucs subcircuit. Subcircuit may be empty. Place desired ports on it;
  • Attach symbol to it using switching to symbol mode by F9 keystroke. Wire subcircuit ports to symbol and paint symbol outline.
  • Save subcircuit, open it with any test editor and copy-paste symbol code form it into the symbol file.

Please pay attention to the proper port mapping. Let’s consider port definition line format:

<.PortSym 10 -40 3 0>

This port definition consists of five space separated fields. The fourth field (3) contains port number. This port number should match SPICE .SUBCKT port number (not port name!) to proper component wiring. You may need to edit this field manually.

For example AD822 has the following definition in our library:

.SUBCKT AD822 1 2 99 50 25

Subcircuit node list follows after the subcircuit name ( AD822 ). Subcircuit nodes will be mapped to component port in the following sequence:

  • Node 1 — to Port 1
  • Node 2 — to Port 2
  • Node 99 — to Port 3
  • Node 50 — to Port 4
  • Node 25 — to Port 5

3.5 Usage of the whole SPICE library

Qucs-S supports usage of the whole SPICE libraries. Such libraries will be visible in the QucsLib tool and left-side Library dock. Library modification will be not required, but user may need to attach components symbols as resource files.

Let’s consider how to use it. SPICE library again will be treated as a set of .SUBCKT entries. You should give *.lib extension an existing SPICE library and put in into $HOME/.qucs/user_lib or system Qucs library directory (for example /usr/share/qucs-s/library for Unix). Then you can get access to this newly added SPICE library via QucsLib tool or from the left-side dock. You will see its name and component list (Figure 3.14).

SPICELIB_EN

Figure 3.14 An example of a SPICE library view in the Qucs library manager.

Every .SUBCKT found is considered as a single component. It will be shown in the library manager and it will be available for drag’n’drop. Subcircuits are available via an existing SpiceLibComp component.

Default symbol will be created, if there is no symbol attached to component. But you can attach user symbol to every component. Symbol file (Qucs XML) should be placed at the library_name subdirectory. For example, you should create opamps subdirectory for opamps.lib file and put all necessary symbol files int it. This location is used also for other resources such as XSPICE CodeModel sources (*.mod and *.ifs files). Symbol file *.sym format is considered in the previous section. Two symbol types are implemented:

1. Default symbol for all components in library. It should be placed at library_name.sym file. For example opamps.sym will be treated as the default symbol for opamps.lib library. 2. Symbol for every component (component_name.sym file). For example, LM358.sym will be mapped to LM358 component.

Default symbol will be substituted, if component symbol file is not found.

Please keep in mind that SPICE subcircuit names are case-insensitive, but symbol file names may be case-sensitive for some specific platforms. In other words ad822.sym may not work for AD822 component. But AD822.sym will be attached properly.

You can look at SPICE library example with attached symbols here: https://github.com/ra3xdh/qucs_spicelib Clone this repository and copy ad822.lib file and ad822 subdirectory into $HOME/.qucs/user_lib directory. This library contains one component (AD822 opamp).

Let’s consider library and resource files tree:

qucs_spicelib/
├── ad822
│      └── ad822.sym
└── ad822.lib

As you can see, resources are placed into ad822 subdirectory. It contains one default symbol file ad822.sym that is placed in resource subdirectory.

3.6 Libraries blacklisting

Every library may consist of simulator-incompatible components. For example XSPICE devices will not work with Xyce backend. And Qucsator microwave devices will not work with any of SPICE.

Library blacklisting serves to hide simulator incompatible libraries in Qucs-S library manager view. User will not see such libraries. This prevents simulator compatibility issue.

There are three *.balcklist files in the system Qucs-S library directory (for example $QUCSDIR/share/qucs-s/library/). All files have plain text format and contain a list of simulator-incompatible library files with extension in the current directory. File entries are newline-separated. These libraries will be blacklisted and will be not shown in the library manager if appropriate simulator is selected as default.

Here is blacklist files list:

  • ngspice.blacklist — The list of Ngspice-incompatible libraries;
  • xyce.blacklist — The list of XYCE-incompatible libraries;
  • qucs.blacklist — The list of Qucsator-incompatible libraries;

For example, let’s consider contents of the qucs.blacklist file:

AnalogueCM.lib
Cores.lib
Transformers.lib
Xanalogue.lib

All of these libraries contain SPICE-only components (XSPICE analogue blocks) and will not work with Qucsator.

back to the top