Index: 07_io/export_spice/elect0.html =================================================================== --- 07_io/export_spice/elect0.html (nonexistent) +++ 07_io/export_spice/elect0.html (revision 7792) @@ -0,0 +1,40 @@ + + + +

target_spice: election of "node 0"

+

+

+A valid spice circuit must have a ground network, which is considered +potential 0. All other voltages are normally measured against this +potential. In spice terminology this is called node 0. +

+The plugin export_spice will look for a net that has the spice/gnd +attribute set. When found, this net is renamed to 0 on the output (but +not in the abstract model). +

+The target_spice plugin attempts to guarantee there is a spice/gnd net at +the end of the compilation process. First it looks through all nets to +find one that already has spice/gnd set during compilation (e.g. from the +concrete model). This gives the user a chance to explicitly select a gnd +net by setting a wirenet attribute. This is useful for circuits with +multiple different ground networks (digital ground, analog ground, power +ground, etc.) +

+If target_spice did not find a spice/gnd net, it will elect one and set +the spice/gnd attribute on the elected net. The election scores each net +and the net with the highest score wins. If the net name is "gnd" (not +case sensitive), it gets the highest score (and confidence). Else if it +contains "gnd" or "GND" (case sensitive), it gets the second highest +score. Else the score is proportional to the number of ports connected to +the net (in other words, it is assumed that the net with the most number +of connections is the best choice for gnd). When the code was not confident +in the choice, an error message is also generated, asking the user to +explicitly set spice/gnd. +

+In practice, for the simple cases, for majority of the boards, this works +without any network attribute, because there will be a net called "gnd" +or "GND", which will get the highest score with high confidence. If the +situation is more complex, the code will throw an error and the user should +add the spice/gnd attribute to a net. + + Index: 07_io/export_spice/raw.html =================================================================== --- 07_io/export_spice/raw.html (revision 7791) +++ 07_io/export_spice/raw.html (revision 7792) @@ -1,7 +1,7 @@ -

export_spice: raw spice simulation

+

target_spice: raw spice simulation

WARNING: at this stage this document is only a proposal; any detail @@ -134,7 +134,7 @@ spice/gnd if set, the given network would be the true ground, "node 0" in the spice netlist. Must not be set on multiple nets. If not set, target_spice - elects a "node 0" looking at net names. (The spice netlist format + elects a "node 0" looking at net names. (The spice netlist format requires one of the nets dedicated as "node 0" for gnd.) The value of this attribute does not matter.