Friday, April 28, 2023

Problems importing Eagle projects into KiCad

This time last year ago I tried importing my Eagle project for the i4004 Scratchpad board into KiCad. My reasoning was that I'm now much more familiar with KiCad's user interface than Eagle's, and the KiCad PCB router has features not available in Eagle v7. (Later versions of Eagle have improved the router, but I'm not paying Autodesk $70/month to rent it.)

It took a few experiments to get KiCad's importer to produce results I liked, but eventually I checked the results into my version control system (I use Git). Then I began fixing the few visual problems I noted (some of these have been fixed in KiCad v7). Then I got busy with other things again and, well, you know how these things go.

A few weeks ago someone posted to the KiCad forum that he was having problems importing an Eagle project. I did some more experiments importing some other Eagle projects and was able to help him through many of his issues, most of which were misunderstandings of the difference between KiCad and Eagle. However, one serious problem remained. KiCad has a tool that lets you cross-probe between symbols and nets in the schematic and footprints and tracks on the board. This is a critical feature, but it only worked with a small number of nets and tracks in an imported Eagle project. Further experiments exposed a serious flaw in the Eagle schematic importer.

Eagle supports schematics with multiple sheets. This is convenient when a schematic is too large to fit comfortably on one sheet. However, Eagle doesn't support hierarchical schematics. All Eagle nets are global to all sheets. This is very different than KiCad, where nets are local to a sheet unless explicitly made global by applying a global label to the net.

When KiCad imports an Eagle schematic, it only creates global labels for the nets that connect on multiple sheets; all other net names are dropped. However, the imported board retains all the net names assigned by Eagle. Since the cross-probing tool depends on matching net names, the result is that only inter-sheet connections and certain supply nets can be cross-probed.

If you're starting with an Eagle schematic and create the board in KiCad this is may not be a problem. However, if you've already created the board in Eagle, or explicitly named nets in your Eagle schematic, this may be a huge issue for you. Because I wanted to maintain the same net names used in the i4004 simulator, all of my nets have explicit net names. Losing these net names is a non-starter for me.

I reported this bug to the KiCad development team (Issue #14620) and proposed several possible solutions. However, I don't expect to see a fix for this any time soon.

Thus I've reluctantly abandoned my plan to use KiCad for further development of the i4004 CPU recreation. Instead, I've started working on the Scratchpad board using Eagle v7 again.