How to read xml netlists?

Hello!
I have very little knowledge about electronics, but I need to understand fitzing xml netlists for a project.

I have installed Fritzing Version 0.9.6 (b ) 64 [Qt 5.15.2] on my computer and studied some example files as well as compared them to their netlists.

I think that a net is a group of connectors that belong together - either because they are connected, or because they have the same name (and therefore connect to the same part) is this correct?

Here is an except of the netlist i got for the Arduino > digital > output > Blink example.

<net>
  <connector name="cathode" id="connector0">
   <part title="Red (633nm) LED" label="LED" id="20170"/>
  </connector>
  <connector name="GND" id="connector57">
   <part title="Arduino Uno (Rev3)" label="Arduino1" id="18460860"/>
  </connector>
  <connector name="GND" id="connector88">
   <part title="Arduino Uno (Rev3)" label="Arduino1" id="18460860"/>
  </connector>
  <connector name="GND" id="connector89">
   <part title="Arduino Uno (Rev3)" label="Arduino1" id="18460860"/>
  </connector>
 </net>

By comparing with the breadboard view in Fritzing, I found that the cathode of the LED is connected to GND (57). Does that mean that if two connectors that do not have the same name (in this case “cathode” and “GND” are listed directly under each other in the same net they are connected?

But why are there the other GND connectors still in the net?
Simply because they have the same function/name as GND (57)?

And how would I read a net with more elements, like this? (taken from a netlist of the CosmicRayGun example (Fritzing starter Kit > Cosmic Ray Gun))

<net>
  <connector id="pin1G" name="pin1G">
   <part title="Half breadboard" id="17307170" label="Breadboard2"/>
  </connector>
  <connector id="pin1J" name="pin1J">
   <part title="Half breadboard" id="17307170" label="Breadboard2"/>
  </connector>
  <connector id="pin1F" name="pin1F">
   <part title="Half breadboard" id="17307170" label="Breadboard2"/>
  </connector>
  <connector id="pin1I" name="pin1I">
   <part title="Half breadboard" id="17307170" label="Breadboard2"/>
  </connector>
  <connector id="pin1H" name="pin1H">
   <part title="Half breadboard" id="17307170" label="Breadboard2"/>
  </connector>
  <connector id="connector56" name="D13/SCK">
   <part title="Arduino Uno (Rev3)" id="18304270" label="Arduino"/>
  </connector>
  <connector id="connector1" name="Pin 1">
   <part title="1kΩ Resistor" id="1683300" label="R8"/>
  </connector>
  <connector id="connector0" name="leg0">
   <part title="Pushbutton" id="4014780" label="S1"/>
  </connector>
 </net>

How do I recognize which ones are connected and which ones are not connected to anything here?

We do not have the sketch file you started from to verify, but I think I can explain how all of those connectors show up in the single netlist.

From your description, the LED cathode is connected to one of the GND pins of the Arduino board. Breadboard does not “directly” show it (no wires), but all of the Arduino board GND pins are connected together inside the board. That is represented as a “bus” in the Fritzing part. That is not related to the name that you see for the connectors. Ground connectors all tend to have the same name, but it is the bus (plus wires) that determine what goes into the net. You can see the result of than in Fritzing by click and hold on one of the connectors (including intermediate connectors like the holes on a breadboard that the ‘path’ pass through). That will highlight all of the joined connectors (the net) in yellow.

1 Like

Thank you very much, that makes sense to me and fits with the sketchfile.
Is there any way to see from the netlist which connector connects to which other connector? For the “GND” connectors it possibly does not matter, but is this true for the CosmicRay gun?
Is the netlist.xml enough to see what connects to what?

The data in the net list is enough to “electrically” identify the connectors. Usually the part title and label are enough to match the physical components. I think it possible (bad idea, probably an error) to have the same label on different parts, which would mean that the id is needed to uniquely identify the part. That is not directly visible.

If you are processing the net list with a program, flag as a big warning if 2 entries have the same title and label, but different id values. I would ‘fix’ that by generating new (unique) labels, so that tltle + label is unique. If the intent is to be able create a schematic (or other) diagram from the net list. If the intent is to feed the net list to a simulator, the id will keep it unique.

1 Like

Think ‘simple-minded’


Say you have two LED’s, Two Resistors and Two Switches

Not at all necessary for something this simple but, it will clarify for you:

Led1, R1 and Switch1 are on one Circuit (say a 5v power)

Led2, R2 and Switch2 are on another Circuit (say a 3.3v power)

Naturally, both are connected to GND via the Resistors.

Thus, you would Label the Traces as needed. The final Netlist will identify them as part of the proper Net. Note: I didn’t pay attention to which I dragged and connected to but, you get the idea
 Ignore that I didn’t Pull them to Ground, as a real circuit wasn’t the point
 (normally, I’d pull them to GND for switching
)

Screenshots


Snippet of XML Netlist

1 Like