FreePCB User Guide |
Version 1.2 |
5. PCB Layout (continued)
5.14 Importing Netlist Files
5.141 Netlist Files
After a new project is created, parts and nets can added to it by importing a netlist file. This file is usually produced by a schematic editor, but you can create it by hand if necessary.
A sample netlist file is shown below. This file will be used later in the tutorial (see Section 7. Tutorial). It was produced by a schematic editor called Orcad Capture, in PADS-PCB format. This is a common format, and most schematic editors support it. Most importantly, FreePCB can read it.
*PADS-PCB*
*PART*
C1 CHIP_D
C2 C1206
C3 CHIP_B
C4 CHIP_B
D1 CHIP_B
JP1 5X2HDR-100
JP2 5X2HDR-100
JP3 5X2HDR-100
JP4 5X2HDR-100
JP5 3X2HDR-100
JP6 1X2HDR-100
R1 C1206
R2 C1206
R3 C1206
U1 28DIP300
U2 dip14
U3 TO-220
Y1 8DIP300
*NET*
*SIGNAL* N00834
U2.4 JP1.9
*SIGNAL* GND
U2.7 C2.2 U3.3 C1.2 U1.19 Y1.4 JP5.3 JP4.10
JP4.4 R2.2 C4.2 JP1.10 JP1.5 R1.2 C3.2 U1.8
JP6.2 JP3.3 JP2.3 JP3.10 JP3.4 JP3.6 JP3.8 JP2.10
JP2.8 JP2.2 JP2.4 JP2.6 JP3.2
*SIGNAL* N01846
Y1.5 U1.9
*SIGNAL* VCC
U2.14 Y1.8 JP5.2 U3.2 C1.1 U1.20 JP1.8 JP1.3
*SIGNAL* N02621
U2.6 U1.21
*SIGNAL* N02594
U2.3 U1.22
*SIGNAL* N02122
JP2.1 U1.18
*SIGNAL* N01526
JP4.6 U1.15
*SIGNAL* N01538
JP4.8 U1.14
*SIGNAL* N02277
U1.17 JP3.1
*SIGNAL* N00797
JP1.4 U2.1
*SIGNAL* N00534
D1.1 JP6.1
*SIGNAL* N01300
U1.27 JP5.5
*SIGNAL* N01342
U1.28 JP5.4
*SIGNAL* N01384
JP5.1 U1.1
*SIGNAL* N00809
U2.5 JP1.7 U1.23
*SIGNAL* N03791
C3.1 R1.1 JP2.7 U1.3
*SIGNAL* N01292
U2.2 U1.24 JP1.2
*SIGNAL* N03798
C4.1 R2.1 JP3.7 U1.2
*SIGNAL* N04614
U1.13 JP3.5
*SIGNAL* N04589
JP2.5 U1.12
*SIGNAL* N06956
C2.1 U3.1 R3.2
*SIGNAL* N07325
R3.1 D1.2
*END*
The listing is fairly self-explanatory. In the *PART*
section of the file,
there is a line for each part, containing a reference designator (such as "U1
") and a package
identifier (such as "28DIP300
"). In the *NET*
section, each net starts with the *SIGNAL*
keyword, followed by the
name of the net. All of the pins in the net are then listed on subsequent lines.
In order for FreePCB to assign footprints, the package identifier for each part must match a footprint in one of the FreePCB libraries. Since there is no universal standard for package identifiers, you will probably have to assign these explicitly.
Basically, there are 3 ways to do this:
Option 1 is definitely the way to go if you think that you might make changes to your schematic after you start routing the board, and want to import those changes into FreePCB.
Important note: For FreePCB to find the footprints referenced in the netlist file, the libraries containing those footprints must be in the default library folder for the project (usually ..\lib). If you are using footprints from libraries in other folders, such as ..\lib_contrib or ..\lib_extra, you should move those libraries into ..\lib before importing the netlist file. If you forget to do this, you can always assign the footprints later, using the Project > Parts... dialog.
5.142 Importing Netlist Files into a Project
To import a netlist file, select File > Import netlist.... This will pop up the following dialog.
Select the netlist file by navigating to the correct folder (if necessary) and clicking on the file name. I usually move or copy the netlist file into the project folder before importing it, but this is not necessary. Using the radio buttons, you can choose to import only the parts from the file, only the nets, or both. You can also select the file format (although currently only the PADS-PCB format is supported). Then click OK.
If you are importing the netlist file into an empty project, without existing parts or nets, the file will load immediately. Otherwise, the Import Options dialog will appear, as shown below. This dialog determines how FreePCB handles conflicts that may arise when importing a netlist file into a project that already contains parts and/or nets. This situation usually arises when you are using a schematic editor. For example, suppose that after importing your initial netlist and laying out some or all of the PCB, you make some changes in the schematic and wish to import those changes. With the the default settings shown below, any parts, footprints or nets in the project that don't match the new netlist file will be changed or deleted, and the project will exactly match the netlist file. Most of the time, this will be what you want.
However, suppose that you have added some parts to the project (such as mounting holes, for example) that aren't in your netlist file, and you have connected them to a net. Then you might want to select For parts in project but not in netlist file: Keep parts and connections to nets so that you won't lose these parts and connections. Or, if you changed some of the footprints after importing the netlist, you might want to select For parts with different footprints in project and netlist file: Keep footprints so that you don't revert back to the old footprints after the import. If you have added nets and wish to keep them, you might select For nets in project that are not in netlist file: Keep nets.
You should use these options carefully as they may cause unexpected results. For example, if you inadvertently change a net name in the schematic editor and then import the netlist with the Keep nets option selected, you will wind up with 2 nets with different names, with all of the pins in the new net except for any pins that were in the old net but not in the new one. Also, you will lose all of the routing on the new net (see note below). Or if you changed the reference designator of a part in the schematic editor and you select one of the Keep parts options, you will wind up with a duplicate part.
Important note: When importing a netlist file into a project that is already routed, FreePCB tries to preserve as much of the routing as possible as long as the net names haven't changed. If you change the name of a net in your netlist file, you will lose all of the routing on this net, UNLESS you also change the name of the net in FreePCB before importing the netlist file.
Once you have selected the Import Options, click OK. The netlist file will load and all of the new parts will be placed in the layout window to the left of the origin. To see them, you can select All Parts from the View menu (or press the "Home" key), which will adjust the layout window to make all of the parts visible, as shown below.
If FreePCB is unable to match any of the package identifiers with footprints from its libraries, the following message will appear.
Note that the footprint for U2 is shown as "??????", indicating that FreePCB was unable to find a footprint with the identifier "dip14". A footprint can be assigned to this part by selecting it and clicking the Edit Selection button, which pops up the Add/Edit Part dialog, shown below.
You can assign a footprint to U2 by expanding the library files in the dialog until you find the footprint that you want, and then clicking on it to copy it into the Footprint field of the dialog, as shown below. If you know the name of the footprint, you can just enter it directly.
U2 should now have a footprint in the layout window, placed at whatever position you set in the dialog (X = 0, Y = 0 in the example above).
5.143 Exporting Netlist Files
You can export a netlist file from a project using the File > Export netlist... menu selection. In the resulting file, the package for each part will be set to the name of the actual footprint that was used in the project.