multisim2kicad 0.1.0 → 0.2.0
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.
- package/README.md +102 -2
- package/dist/cli.js +2044 -39
- package/dist/db/symbols.d.ts +6 -2
- package/dist/emit/kicad-sch.d.ts +18 -1
- package/dist/index.js +2044 -39
- package/dist/ir/types.d.ts +24 -0
- package/dist/parse/dchip.d.ts +110 -0
- package/dist/parse/ms-hierarchy.d.ts +5 -1
- package/dist/parse/sim-settings.d.ts +35 -0
- package/dist/parse/spice.d.ts +303 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -84,6 +84,97 @@ Shared supply pins of multi-section parts (an op-amp's V+/V- on every
|
|
|
84
84
|
section) stay connected the way Multisim wires them. One schematic unit maps to 10 mil so everything sits on a
|
|
85
85
|
KiCad grid.
|
|
86
86
|
|
|
87
|
+
Simulation: the converted schematic runs in KiCad's simulator (ngspice).
|
|
88
|
+
Each part's SPICE model from the design goes into `<design>.lib` next to
|
|
89
|
+
the schematic. The part points at it through KiCad's `Sim.*` fields, which
|
|
90
|
+
map its pins to the model's nodes in Multisim's order.
|
|
91
|
+
|
|
92
|
+
- Resistors, capacitors and inductors use KiCad's built-in models.
|
|
93
|
+
- Sources, diode models and other one-off cases get a small wrapper
|
|
94
|
+
subcircuit holding exactly the lines Multisim would netlist.
|
|
95
|
+
- KiCad leaves power symbols out of simulation, but Multisim's VCC / VDD
|
|
96
|
+
symbols are real sources. Each supply net therefore gets a
|
|
97
|
+
simulation-only source symbol (`SUP1`, ...; not in the BOM, not on the
|
|
98
|
+
board), parked to the right of the root sheet.
|
|
99
|
+
- Parts Multisim has no model for (most ICs and connectors) are marked
|
|
100
|
+
"exclude from simulation".
|
|
101
|
+
- A few Multisim-only SPICE constructs are rewritten for ngspice:
|
|
102
|
+
`.mergenodes`, `TABLE ... USELIM`, and the interactive potentiometer
|
|
103
|
+
(fixed at its saved setting).
|
|
104
|
+
- PSpice forms ngspice lacks are translated: `sdt()` (integral) becomes an
|
|
105
|
+
XSPICE integrator, `E`/`G ... LAPLACE {in} {H(s)}` an XSPICE `s_xfer`
|
|
106
|
+
block (plus a delay line for an `e^(-sT)` factor; numeric coefficients
|
|
107
|
+
only), and subcircuit parameters named like functions (`max`, `min`) are
|
|
108
|
+
renamed. A `FREQ` response-table source has no exact equivalent: its part
|
|
109
|
+
is excluded, with a warning.
|
|
110
|
+
- Digital parts simulate with ngspice's XSPICE gates. Each digital pin
|
|
111
|
+
gets the ideal analog/digital bridge from its Multisim interface model.
|
|
112
|
+
- Multisim's `d_chip` behavioural logic (most 74xx and 4000-series MSI
|
|
113
|
+
parts: counters, decoders, comparators, registers, latches, multiplexers)
|
|
114
|
+
is compiled into an XSPICE subcircuit. Each table output becomes a
|
|
115
|
+
`d_lut` truth table, and each state flag a `d_dff` with its clocked and
|
|
116
|
+
asynchronous rows. The 74LS161, 74LS74, 74LS85, 74LS138, 74LS47, 74150,
|
|
117
|
+
4511 and 40192 were checked against their datasheets in ngspice. Timing is
|
|
118
|
+
simplified: each output gets its slowest listed delay, and setup / hold
|
|
119
|
+
checks are dropped.
|
|
120
|
+
- Circuit parameters become a `.param` simulator directive on their sheet.
|
|
121
|
+
Part values that use them stay expressions.
|
|
122
|
+
- A part's expression can read another part's current (`I(Vsensor1)`) or a
|
|
123
|
+
net by name (`V(pri)`), as in Multisim's flat netlist. The part that owns
|
|
124
|
+
the current or sits on the net gets a probe: a behavioural source copying
|
|
125
|
+
the value onto a shared (`.global`) node, which the expression reads.
|
|
126
|
+
Coupled inductors that are separate parts (`K1 L4 L5 0.9`) become a `K`
|
|
127
|
+
line in a text directive on the root sheet.
|
|
128
|
+
- Tri-state and bidirectional pins (bus buffers and transceivers: 74xx125,
|
|
129
|
+
240, 244, 245, 373, ...) work on shared buses. Each output that can go
|
|
130
|
+
high-Z gets an enable signal from the chip's tables, and the enable drives
|
|
131
|
+
the pin's output switch. Multisim's own high-Z sensing (`dac_hiz`) has no
|
|
132
|
+
ngspice equivalent.
|
|
133
|
+
- Parts whose model needs something ngspice doesn't have are excluded,
|
|
134
|
+
with a warning: `chirp()` sources, `d_vhdl`, other Multisim-only code
|
|
135
|
+
models, PSpice `FREQ` tables.
|
|
136
|
+
- A digital input left unconnected reads low, as in XSPICE (some of NI's
|
|
137
|
+
counter demos leave `~LOAD` open, so they load instead of counting).
|
|
138
|
+
- Schmitt-trigger inputs (74xx14 and friends) keep their hysteresis: an
|
|
139
|
+
XSPICE `hyst` block ahead of the input bridge. Multisim's interactive
|
|
140
|
+
digital constant is a fixed logic level at its saved state. Ideal digital
|
|
141
|
+
outputs have a 1 mOhm series resistance, so an output tied to a source or
|
|
142
|
+
to another output still solves.
|
|
143
|
+
- Vendor models' capacitor `IC=` values seed the operating point
|
|
144
|
+
(`.nodeset`), as PSpice uses them; PWM controller latches need that.
|
|
145
|
+
|
|
146
|
+
- The design's simulation settings come along as a text directive on the
|
|
147
|
+
root sheet: Multisim's SPICE options (its default `rshunt=1e12`, which
|
|
148
|
+
lets designs with floating nets simulate, and any tolerances the designer
|
|
149
|
+
set) and the analysis Multisim has results for (transient, else Fourier,
|
|
150
|
+
else AC, else operating point), so KiCad's Run does what Multisim did. A
|
|
151
|
+
Fourier analysis comes across as its transient plus a note with the
|
|
152
|
+
fundamental. Other analyses it ran (noise, sweeps, ...) are listed in a
|
|
153
|
+
comment.
|
|
154
|
+
- A design driven by LabVIEW co-simulation gets a warning: those inputs
|
|
155
|
+
are undriven in KiCad.
|
|
156
|
+
|
|
157
|
+
Checked on NI's own Multisim 13 sample circuits: none fail to parse, and
|
|
158
|
+
156 carry an analysis Multisim ran; 145 of those run to completion in
|
|
159
|
+
KiCad's ngspice as converted. Of the other 11:
|
|
160
|
+
- 2 are meant to fail: NI's "Overcoming Simulation Challenges" demos, whose
|
|
161
|
+
notes say to watch the convergence failure.
|
|
162
|
+
- 3 are LabVIEW co-simulations, driven by a LabVIEW VI that isn't in the
|
|
163
|
+
design.
|
|
164
|
+
- 1 saves a 5000-second transient at a 0.1 ms step.
|
|
165
|
+
- 5 are switching converters on which ngspice's transient gives up
|
|
166
|
+
("timestep too small") where Multisim's solver does not.
|
|
167
|
+
|
|
168
|
+
192 of the 200 solve their operating point. The rest are converters whose
|
|
169
|
+
own analysis skips it, and one co-simulation.
|
|
170
|
+
|
|
171
|
+
The project's simulator compatibility is set to PSpice, because Multisim's
|
|
172
|
+
vendor models use PSpice syntax (`IF()`, `R ... TC a b`).
|
|
173
|
+
|
|
174
|
+
A board whose ICs have no model leaves those nets floating; Multisim's
|
|
175
|
+
`rshunt` option (carried over) usually lets it simulate anyway. A large
|
|
176
|
+
digital board may still need models for its ICs.
|
|
177
|
+
|
|
87
178
|
An EW component database becomes KiCad libraries named after it. That is
|
|
88
179
|
a Multisim database project (`.prj` / `.usr`), or NI's master database
|
|
89
180
|
`MSCOMP_S.PRD` that Multisim installs under
|
|
@@ -99,8 +190,17 @@ redistribute the output.
|
|
|
99
190
|
chip's GND / VCC, on an extra power unit), with its Footprint pointing into
|
|
100
191
|
`<name>.pretty` when the database holds the package (otherwise the
|
|
101
192
|
package name is kept as an `EW_Package` field)
|
|
102
|
-
|
|
103
|
-
|
|
193
|
+
- `<name>.spice/<family>.lib`: the SPICE models of the database's
|
|
194
|
+
simulated parts, one file per family. Each symbol's `Sim.*` fields point
|
|
195
|
+
into it through `${KIPRJMOD}`. That works when the libraries sit in the
|
|
196
|
+
project folder; if you install them globally, fix the path. A part
|
|
197
|
+
with several sections (a quad op-amp) is one subcircuit across all its
|
|
198
|
+
units. Parts without a model, and the few whose template needs values
|
|
199
|
+
Multisim only sets on a placed part, are excluded from simulation. Set
|
|
200
|
+
the project's simulator compatibility to PSpice (Simulator > Settings).
|
|
201
|
+
|
|
202
|
+
The symbol and footprint libraries are registered in the project's lib
|
|
203
|
+
tables.
|
|
104
204
|
`plans/converter.md` tracks these.
|
|
105
205
|
|
|
106
206
|
## Checking results
|