I recently had a situation where an unwanted connection was accidentally added to a schematic. ERC wouldn’t have caught it because it happened to connect an input to an output.
This made me wonder: is there a way to compare schematic files and display the electrical differences so they can be reviewed?
The bullseye would be a Kicad button/tool/plugin that says, “Compare schematic files.” I then tell it which two files to compare and it lists the electrical differences between the files. Then I can review them & make sure nothing bad happened.
BTW, I’m not referring to a simple ‘diff’ command that just compares two files line by line. That wouldn’t work because you could have two schematics that are electrically identical, yet not the same on a line-by-line basis. One example would be if the page was laid out differently: the component location coordinates wouldn’t be the same. Another would be if the schematic was populated in a different order: connections for U1 might be on lines 1-8 in the first file, but on lines 61-68 in the second file.
I suppose I could write some code myself, but coding isn’t my forte. It would probably take me so long that it wouldn’t justify the effort. Plus I suspect it’s a pretty big undertaking with some unanticipated complexities.
Hey - thanks for the heads-up about the existence of this tool. I was going to install it & try it but had problems. I’m on Ubuntu 20. I did the best I could but kept getting installation errors - “switch initialisation failed…”
That said, the latest Github commit for the tool is from Nov 2021, so apparently folks are still using/updating the tool. So that was good news.
I kept at it a bit and was finally able to install the tool. The problem turned out to be a lack of C compiler on my machine. I installed gcc and once I did, the rest of the installation seemed to go OK.
Unfortunately, the tool isn’t working as they describe. Supposedly I should see a view with green changes where things have been added, and red changes where things have been deleted. Instead It’s basically showing everything as green. So something isn’t quite right yet. Not sure how much more time I can put into troubleshooting it. But again, thanks for the heads-up that the tool even exists.
You can Compare two text-based documents using LibreOffice’s Writer (it’s their Text app).
Kicad files are Text-Based so, not a problem to compare.
Below Example of comparing two Schematics (Eeschema).
In Libre Writer, open one of the Doc’s, then, Edit>Track_Changes>Compare (open the next Doc) and you’ll see what to do… (clicking the items in the panel shows what you want to see…
Hey thanks for the suggestion. I appreciate it. I gave it a try. It seems like it might be helpful if you’re comparing two schematics that are nearly identical, but if you’ve got lots of changes - some wanted and some unwanted - it would be hard to sort through them.
I do appreciate the suggestion though. Thank you. I wasn’t familiar with Libre Writer & didn’t know this feature existed.
Once you get the two versions loaded, via the menu, you’ll have more options for reviewing the changes… not perfect… BUT, you can Record your own (things to do) and make it a Macro for future work… And, editing the Macro, you can add a host of things to do/review…
Another way to compare changes is to export a netlist of both versions and do a diff on those. If you want to try this, then start by figuering out which netlist format works best for this. Schematic Editor / File / Export / Netlist and then either KiCad, Orcad, CadStar, Spice.