14.5. Intermediate Netlist structure

14.5. Intermediate Netlist structure

This sample gives an idea of the netlist file format.

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <export version="D">
  3. <design>
  4. <source>F:\kicad_aux\netlist_test\netlist_test.sch</source>
  5. <date>29/08/2010 21:07:51</date>
  6. <tool>eeschema (2010-08-28 BZR 2458)-unstable</tool>
  7. </design>
  8. <components>
  9. <comp ref="P1">
  10. <value>CONN_4</value>
  11. <libsource lib="conn" part="CONN_4"/>
  12. <sheetpath names="/" tstamps="/"/>
  13. <tstamp>4C6E2141</tstamp>
  14. </comp>
  15. <comp ref="U2">
  16. <value>74LS74</value>
  17. <libsource lib="74xx" part="74LS74"/>
  18. <sheetpath names="/" tstamps="/"/>
  19. <tstamp>4C6E20BA</tstamp>
  20. </comp>
  21. <comp ref="U1">
  22. <value>74LS04</value>
  23. <libsource lib="74xx" part="74LS04"/>
  24. <sheetpath names="/" tstamps="/"/>
  25. <tstamp>4C6E20A6</tstamp>
  26. </comp>
  27. <comp ref="C1">
  28. <value>CP</value>
  29. <libsource lib="device" part="CP"/>
  30. <sheetpath names="/" tstamps="/"/>
  31. <tstamp>4C6E2094</tstamp>
  32. <comp ref="R1">
  33. <value>R</value>
  34. <libsource lib="device" part="R"/>
  35. <sheetpath names="/" tstamps="/"/>
  36. <tstamp>4C6E208A</tstamp>
  37. </comp>
  38. </components>
  39. <libparts/>
  40. <libraries/>
  41. <nets>
  42. <net code="1" name="GND">
  43. <node ref="U1" pin="7"/>
  44. <node ref="C1" pin="2"/>
  45. <node ref="U2" pin="7"/>
  46. <node ref="P1" pin="4"/>
  47. </net>
  48. <net code="2" name="VCC">
  49. <node ref="R1" pin="1"/>
  50. <node ref="U1" pin="14"/>
  51. <node ref="U2" pin="4"/>
  52. <node ref="U2" pin="1"/>
  53. <node ref="U2" pin="14"/>
  54. <node ref="P1" pin="1"/>
  55. </net>
  56. <net code="3" name="">
  57. <node ref="U2" pin="6"/>
  58. </net>
  59. <net code="4" name="">
  60. <node ref="U1" pin="2"/>
  61. <node ref="U2" pin="3"/>
  62. </net>
  63. <net code="5" name="/SIG_OUT">
  64. <node ref="P1" pin="2"/>
  65. <node ref="U2" pin="5"/>
  66. <node ref="U2" pin="2"/>
  67. </net>
  68. <net code="6" name="/CLOCK_IN">
  69. <node ref="R1" pin="2"/>
  70. <node ref="C1" pin="1"/>
  71. <node ref="U1" pin="1"/>
  72. <node ref="P1" pin="3"/>
  73. </net>
  74. </nets>
  75. </export>

14.5.1. General netlist file structure

The intermediate Netlist accounts for five sections.

  • The header section.
  • The components section.
  • The lib parts section.
  • The libraries section.
  • The nets section.

The file content has the delimiter <export>

  1. <export version="D">
  2. ...
  3. </export>

14.5.2. The header section

The header has the delimiter <design>

  1. <design>
  2. <source>F:\kicad_aux\netlist_test\netlist_test.sch</source>
  3. <date>21/08/2010 08:12:08</date>
  4. <tool>eeschema (2010-08-09 BZR 2439)-unstable</tool>
  5. </design>

This section can be considered a comment section.

14.5.3. The components section

The component section has the delimiter <components>

  1. <components>
  2. <comp ref="P1">
  3. <value>CONN_4</value>
  4. <libsource lib="conn" part="CONN_4"/>
  5. <sheetpath names="/" tstamps="/"/>
  6. <tstamp>4C6E2141</tstamp>
  7. </comp>
  8. </components>

This section contains the list of components in your schematic. Each component is described like this:

  1. <comp ref="P1">
  2. <value>CONN_4</value>
  3. <libsource lib="conn" part="CONN_4"/>
  4. <sheetpath names="/" tstamps="/"/>
  5. <tstamp>4C6E2141</tstamp>
  6. </comp>

libsource

name of the lib where this component was found.

part

component name inside this library.

sheetpath

path of the sheet inside the hierarchy: identify the sheet within the full schematic hierarchy.

tstamps (time stamps)

time stamp of the schematic file.

tstamp (time stamp)

time stamp of the component.

Note about time stamps for components

To identify a component in a netlist and therefore on a board, the timestamp reference is used as unique for each component. However KiCad provides an auxiliary way to identify a component which is the corresponding footprint on the board. This allows the re-annotation of components in a schematic project and does not loose the link between the component and its footprint.

A time stamp is an unique identifier for each component or sheet in a schematic project. However, in complex hierarchies, the same sheet is used more than once, so this sheet contains components having the same time stamp.

A given sheet inside a complex hierarchy has an unique identifier: its sheetpath. A given component (inside a complex hierarchy) has an unique identifier: the sheetpath + its tstamp

14.5.4. The libparts section

The libparts section has the delimiter <libparts>, and the content of this section is defined in the schematic libraries. The libparts section contains

  • The allowed footprints names (names use jokers) delimiter <fp>.
  • The fields defined in the library delimiter <fields>.
  • The list of pins delimiter <pins>.
  1. <libparts>
  2. <libpart lib="device" part="CP">
  3. <description>Condensateur polarise</description>
  4. <footprints>
  5. <fp>CP*</fp>
  6. <fp>SM*</fp>
  7. </footprints>
  8. <fields>
  9. <field name="Reference">C</field>
  10. <field name="Valeur">CP</field>
  11. </fields>
  12. <pins>
  13. <pin num="1" name="1" type="passive"/>
  14. <pin num="2" name="2" type="passive"/>
  15. </pins>
  16. </libpart>
  17. </libparts>

Lines like <pin num=”1” type=”passive”/> give also the electrical pin type. Possible electrical pin types are

Input

Usual input pin

Output

Usual output

Bidirectional

Input or Output

Tri-state

Bus input/output

Passive

Usual ends of passive components

Unspecified

Unknown electrical type

Power input

Power input of a component

Power output

Power output like a regulator output

Open collector

Open collector often found in analog comparators

Open emitter

Open emitter sometimes found in logic

Not connected

Must be left open in schematic

14.5.5. The libraries section

The libraries section has the delimiter <libraries>. This section contains the list of schematic libraries used in the project.

  1. <libraries>
  2. <library logical="device">
  3. <uri>F:\kicad\share\library\device.lib</uri>
  4. </library>
  5. <library logical="conn">
  6. <uri>F:\kicad\share\library\conn.lib</uri>
  7. </library>
  8. </libraries>

14.5.6. The nets section

The nets section has the delimiter <nets>. This section contains the “connectivity” of the schematic.

  1. <nets>
  2. <net code="1" name="GND">
  3. <node ref="U1" pin="7"/>
  4. <node ref="C1" pin="2"/>
  5. <node ref="U2" pin="7"/>
  6. <node ref="P1" pin="4"/>
  7. </net>
  8. <net code="2" name="VCC">
  9. <node ref="R1" pin="1"/>
  10. <node ref="U1" pin="14"/>
  11. <node ref="U2" pin="4"/>
  12. <node ref="U2" pin="1"/>
  13. <node ref="U2" pin="14"/>
  14. <node ref="P1" pin="1"/>
  15. </net>
  16. </nets>

This section lists all nets in the schematic.

A possible net contains the following.

  1. <net code="1" name="GND">
  2. <node ref="U1" pin="7"/>
  3. <node ref="C1" pin="2"/>
  4. <node ref="U2" pin="7"/>
  5. <node ref="P1" pin="4"/>
  6. </net>

net code

is an internal identifier for this net

name

is a name for this net

node

give a pin reference connected to this net