A few years ago, Philip Peter started a little pet project. He wanted to build his own processor. This really isn’t out of the ordinary – every few months you’ll find someone with a new project to build a CPU out of relays, logic chips, or bare transistors. Philip is a software developer, though, and while the techniques and theory of building hardware haven’t changed much in decades, software development has made leaps and bounds in just the past few years. He’s on a quest to build a CPU out of discrete components.
Search the Internet for some tips and tricks for schematic capture programs like KiCad and Eagle, and you’ll find some terrible design choices. If you want more than one copy of a very specific circuit on your board, you have to copy and paste. Circuit simulation is completely separate from schematic capture and PCB design, and unit testing – making sure the circuit you designed does what it’s supposed to do – is a completely foreign concept. Schematic capture and EDA suites are decades behind the curve compared to even the most minimal software IDE. That’s where Philip comes in. By his own admission, he reinvented VHDL badly, but he does have a few ideas that are worth listening to.
Philip is using Eagle to build his small processor – not that there’s anything wrong with that – but with the choice of EDA suite comes a 30-year history of updates to what is essentially a program written for DOS. That said, Eagle does have a lot of options for scripting common tasks, and combined with a few custom Python scripts to write those Eagle scripts, Phillip managed to do a lot with a little.
In designing a single module for his processor, Philip split this circuit up into even smaller modules. By defining the base units of the circuit, these modules could be tied together and automatically placed on a board. Eagle, of course, always adds unplaced components in a line going down the side. For a board with hundreds of components, merely organizing everything so a layout is possible can take up the majority of the design time. Philip scripted Eagle to do this automatically, something that should be applauded.
Taking a software development background to schematic capture and board design can go so much further than adding modules and objects to Eagle, though. Test-driven development is where it’s at, and Philip is designing his processor with the belief that eventually, he will mess something up. Software devs are humble like that.
The implementation of test-driven development is interesting, and something we haven’t seen in a hardware context before. He defines modules – an XOR, for example – as a series of tests. If input A is False, and input B is True, the output will be True. Philip is relying on SPICE, a simulator for analog hardware, to see if the circuits will pass the unit tests.
Schematic capture and board design is a very, very hard problem to solve. Eagle has been in development for almost 30 years, and it’s still not ideal. Altium has been around for even longer, and there are still problems and unintuitive ways of doing things. KiCad is still a baby at 25 years old, and the general assumption is that KiCad is getting there, but it isn’t for prime time yet.
What Philip has done is bring tools and techniques in from the software development world, producing something that is much, much better than what we have now. It’s more abstract, yes, but that’s never stopped anyone from putting enterprise Java on their resume.