 My name is Casper and I am here to talk to you about designing PCBs that's printed circuit boards with code So just a little bit about me. I'm a freelance electronic engineer and software developer and Here pictured here two of my current projects one's a virtual reality chair controller another is a Braille ebook reader and I love writing code and I love Open source and especially open source electronics people coming together working on something all of from all over the globe really inspires me, so You notice I said I love electronics and I love code But I don't actually enjoy designing electronics or that much I get very frustrated with the design tools and this is how typically you Design a printed circuit board you have your schematic tool on one side Where you define your components in the connections between them and then you move over to your layout tool Where you then route those connections and place your components So if you're designing digital hardware if you're designing something to be run-and-run FPGA you can actually use schematic entry as well But hardware description languages were invented in the 80s and that's pretty much how We largely now design digital circuits Because schematic entry for this sort of tasks Becomes very confusing This is a little puzzle I found if you go to the URL there you can get it and you can try and solve it So we use code to describe logic circuits because it's much easier to manage the complexity So these are known as hardware description languages This is a bit of very long there Who or is it yes it is so if you're doing Schematics and especially with high paint pin count components such as FPGA is our schematics are really just There's a lot of labels and they jump all over the place And it's kind of hard to follow what's going on really and it's very tedious to you know Defined hundreds of connections that just kind of go in parallel. So That's the motivation but behind exploring the space of using code to To define To define net lists from or to do to make schematics. So can we use HDL's fan lock circuits? well there's actually Analog and mixed signal extensions to the the popular HDL's Verilog A was defined in 1993 and it was then merged into AMS Which stands for analog and mixed signal in in 2000 There's also Analog and mixed signal extension for VHDL And there's another one that I came across in a paper from 1999 Called the circuit description language though. I couldn't find any implementation of it So the focus of these is simulation and verification really so rather than just do pure schematic entry You are describing the behavior of your circuit and you know need to know a lot of details about the behavior of your components so What we want well what I want anyway is something to Do schematic entry to do create net lists? rather than Analog simulation Because it's a lot less work So I came across this which is called the PCB hardware description language, and this is a project from 2011 It has quite a clean syntax for defining Devices and their connections. There's some more advanced features that kind of didn't fit on this slide here but There's there's a kind of slice notation to do connections in parallel and of and you can It has a sort of a native module system. So you have all your different circuits spread across different files So it's a new language Which has its pros and cons? You get a clean syntax But it's not as expressive as a general purpose language This is a compiler. It's written in Java and it can open net lists for quite a few different PCB design tools It does some natively and then there's some translation software for others It also has an eclipse plug-in so you can write descriptions with the help of an ID door. I didn't manage to try this yet The next one I came across is Skiddle. So this is Python There's a bit of operator overlating going on here So even if you're used to reading Python, you might be a bit confused but it's essentially a set of classes to help you design circuits and You can do the rest of your design in the chi-cat layout too There's another recent one which another recent kind of embedded domain space specific language for designing circuits in Python, which is PyCircuit and This is also this is quite influx at the moment. So this slide kind of went out of date in the last few days on the example of how The circuit is defined there and It has some very interesting experimental features So one of it one of that one of those ideas is to break your components up into into different sub-functions and then define connections on those and it also does Footprint definitions and layout So phdl skiddle and PyCircuit the the The pros of it really you that you've you can define something once and reuse it That's the idea of it and you can use for loop slice notation and other programming features to speed up the design process There's some issues with it. So it's hard to visualize what's going on from code to your actual net list or your circuit Circuit definitions can still be very tedious. So It's hard to associate footprints and then make sure those footprints are right make sure Your connections are all right and if you if there's any mistake in there It can be quite it could would be quite hard to debug So I'm gonna address some of these Visualization so even though I find drawing schematics quite tedious I like to read them and I like to refer to them. They're really really useful Visual tool so I Was experimenting a bit with trying to add visualizations to some of these languages and I contributed this to skiddle. So this is Graph viz graph if you don't know graph viz, it's a brilliant program where you can program programmatically define your graphs and so So I tried to make this look kind of similar to schematic so you know what's going on But it's obviously it's not a schematic, but it has similarities and we haven't really tried to scale this up yet but This is kind of the initial experiment Pi circuit already has a graphics output as well Which the creator and David Craven did The reason this looks like this is because in pie circuit you can do layout as well So there's a plan or there's initial implementation of a sort of interactive viewer where you can click on Your nodes on the graph and then it highlights what's going on in your layout So quite recently I came across this project called netlist SVG and that takes your yosis So your your Output from very long and it tries to Well, it it draws quite Quite good quite I was I'm really impressed with these schematics that it comes up with This is using clay. Yes, or well very soon It's going to be using something the the successor which is elk. Yes, so that's the eclipse layout kernel And that uses very similar algorithms to what's being used in graph is to lay out these graphs So me and the crates and you'll tell you have been experimenting a bit with used using this for analog and mixed signal schematics and these are some of the initial kind of products of that experimentation and Well, it's not exactly what people would draw. It's quite readable and I'm I'm fairly happy with it something to notice about it is that the the flow of it has to be defined So your your schematics will generally flow using this from They'll flow up up to down and and left to right So as we scale this up, it'll be interesting to see if that actually doesn't make I think it will make schematics much more readable because all this all schematics defined in this way will flow in the same direction and Will be easier to follow It'll be interesting to see how to scale this up for hierarchical schematics So I'm really looking forward to experimenting more with us So kind of on the second point that it's still quite tedious to actually define your circuits even in code I Created something called electro grammar, which is currently a JavaScript module to pass electronic component descriptions So the idea here is that as Electronic hobbyists or engineers we already use quite a specific language to quite a restricted language to describe what our circuits and the components so If we if we take advantage of that what people already know we could get a Use that for as a programmatic input as well So as it as I said, this is a JavaScript module I'm working on a Python port to contribute to that that to these other Domain specific languages in Python So I've been playing with this idea of also kind of Creating another another domain specific language possibly in JavaScript Which just to confirm at what's law which is everything that can be written in JavaScript will be written in JavaScript So My goals with this would be to make it easier to design a reason about such circuits and use static analysis to make it very hard to create bugs and Where the JavaScript is the best? Choice if for that goal, I'm not sure yet. So maybe at some point we will switch language and Yes, I'd love to have an interactive editor where you can visualize your circuit with something something like a net list SVG and Edit the code at the same time So you're probably wondering a bit whether you should use these projects to define circuits and I don't know. I think if you're interested in the idea, you should definitely try it out I wouldn't use it for anything important yet So phdl was created and it's I think well when I tried it It's it's it works for previous versions of ego and not newest so I think There's it hasn't seen much use so there's been some bit short skittle. I would say is alpha I don't I'm sort of just coming up with these terms here that these are not official kind of from the creators and My own experience. I haven't even got started yet. So I've glossed over a bit The layout and footprints but there's there's domain-specific languages as well for creating footprints and layouts kikad.mootree is one for kikad and I haven't tried it, but it looks pretty good actually and people do use it quite a bit In PyCircuit There's also a language in it for creating footprints and There's some experimental layout and routing using SMT solvers Yeah, I also created an experiment about a year ago to mix a racket scheme and kikad s expressions The kikad s expression format into an editor though that hasn't seen much work lately So I Guess the question is Just to step back a bit what what what do we want to achieve by making hardware design? more like software and really we want to be able to We want to be able to have a fast iteration cycles and iterate on our design so that we we get to somewhere quicker a We want to use programming constructs for a faster and better design process So I've kind of talked a lot about that already and really that we want modularity and reusability So There I haven't covered much of that, but all of these languages really have module systems so that you can reuse bits of code and and hook into them and Yeah, you hopefully make use of other people's work and kind of collaborate in that way And I'd be a miss to mention not to mention my own project here, which is a website a service to Kind of a registry for for electronic designs, so my hope here is really that That this can become a collaborative space for people to reuse other people's circuits So I think I finished a bit earlier I Really want to thank all the creators of all these projects because really largely I'm presenting other people's works and kind of my thoughts on top of that so Brent Nelson And and others that have created phdl Dave Vanderboot on Skiddle and David Craven on PyCircuit and Neil Turley for net listed as for G's and of course all the contributors to graphers and elk that make this kind of experimentation possible While we go now to The Q&A the signal I angel signals that the internet has no questions So please line up at the microphones if you have any questions for our speaker cos bar There is someone already ready at microphone number two, please Which of the solutions is most robust if you want to do also simulations, or is it possible maybe to export it to a spice or something? There I Don't know. I think if you want to do simulation You should look into the the verilogs and every HDL solutions and possibly or one you probably don't want to write spice directly Microphone number four, please Can you say something about the process process of the placement of the circuitry? So the interface to the spice is one and very interesting aspect, but on the other end I want to have an interface For the actual placing of the components. Did you think about this? Yeah, so Yeah So for both pH well for PhDL you really export to orchard or ego or then use the translation program to Translate it to another program So you then you do your layout in in those programs the same for Skittle you export to python Sorry to kikad and then do your layout in kikad pie circuits any only one really Experimenting with doing layout programmatically Yeah Microphone number three, please Are your experiments with? Netlist SVG skins published anywhere so that we can build on that and yeah work on our own stuff Yeah, yeah, they emerged into netlist SVG It's it's not only my work. It's Neil Turley working on it as well We're kind of both experimenting on it It's just being merged into the master branch of netlist SVG and all the all the links are in the far plan Does that include the stuff to interface it with the other programming languages you listed above? No, well, that's kind of Largely imaginary at this point. So what we need to do is up post our put net Yo says net lists and then use net list SVG For that it's it seems pretty straightforward to once we get around to it, I think okay There is someone at the microphone number four Okay, so my question is Do you think it would be possible to create automatic router constraint pass paste that could actually work? for placement of the elements I I Don't know we I find the the experiments that are being done on PySrc a really interesting Whether they're actually gonna lead somewhere. I don't know Yeah, I can't comment much more on that unfortunately Thank you. I think thank you for the talk as well Signal Angel are there any more questions? There are no more questions from the internet and I think you also run out of questions So cost both thank you again for the talk and please give him a warm round of applause. Thank you very much