MacroFab Engineering Podcast #160
Al Williams returns to the podcast for the fourth time! This time to discuss the importance of circuit simulation and what it can teach engineers.
Stephen brings up alternative uses for assembly layers in PCB design and Parker uses OctoPrint!
Al Williams returns to talk about FPGAs (Field Programmable Gate Arrays) and how to get started.
Visit our Public Slack Channel and join the conversation in between episodes!
Parker is an Electrical Engineer with backgrounds in Embedded System Design and Digital Signal Processing. He got his start in 2005 by hacking Nintendo consoles into portable gaming units. The following year he designed and produced an Atari 2600 video mod to allow the Atari to display a crisp, RF fuzz free picture on newer TVs. Over a thousand Atari video mods where produced by Parker from 2006 to 2011 and the mod is still made by other enthusiasts in the Atari community.
In 2006, Parker enrolled at The University of Texas at Austin as a Petroleum Engineer. After realizing electronics was his passion he switched majors in 2007 to Electrical and Computer Engineering. Following his previous background in making the Atari 2600 video mod, Parker decided to take more board layout classes and circuit design classes. Other areas of study include robotics, microcontroller theory and design, FPGA development with VHDL and Verilog, and image and signal processing with DSPs. In 2010, Parker won a Ti sponsored Launchpad programming and design contest that was held by the IEEE CS chapter at the University. Parker graduated with a BS in Electrical and Computer Engineering in the Spring of 2012.
In the Summer of 2012, Parker was hired on as an Electrical Engineer at Dynamic Perception to design and prototype new electronic products. Here, Parker learned about full product development cycles and honed his board layout skills. Seeing the difficulties in managing operations and FCC/CE compliance testing, Parker thought there had to be a better way for small electronic companies to get their product out in customer's hands.
Parker also runs the blog, longhornengineer.com, where he posts his personal projects, technical guides, and appnotes about board layout design and components.
Stephen Kraig began his electronics career by building musical oriented circuits in 2003. Stephen is an avid guitar player and, in his down time, manufactures audio electronics including guitar amplifiers, pedals, and pro audio gear. Stephen graduated with a BS in Electrical Engineering from Texas A&M University.
Special thanks to whixr over at Tymkrs for the intro and outro!
Welcome to the macro fab engineering podcast. I'm your guest al Williams.
And we are your hosts Parker, Dolman.
And Steven Gregg.
This is episode 160. So before we get started a quick self motive announcement before we jump into the podcast, did you know that we can go from one to 1000 plus units with macro fab? Did you also know that we do full turnkey PCB assembly, including Build Box fulfillment and shipment to your end customers? That's right. There are two easy ways to get started. You can either log in and upload your EDA tool files directly to Get instant quotes, or email sales@mcwrap.com for quotes on larger quantities and specialty boards.
So L Williams is probably best known for being one of the authors behind Hackaday, a website that features electronic projects, and other things that appeal to people interested in computers, electronics and technology. He's also a ham radio operator, author of many books, and has worked on everything from underwater technology to the International Space Station. And just about everything in between.
Also, ao Williams was on previous podcasts episodes 57 and 94. So go check those out. If you're new to the podcast. Owl, what have you been up to since then?
Well, I'll tell you I'm suffering from what doctors called Pony syndrome. You know, I'm a little hoarse. But if you will bear with Billy on the Yeah, that's sort of set the tone for the whole podcast.
Yeah, it's all downhill from here.
Well, you know, I think last time we talked, we were just starting to work up on Hackaday. IO, which, you know, you mentioned Hackaday, Hackaday. Io is kind of our project site. So, you know, you can think of it as like GitHub, but for hardware projects. And, you know, we've started doing the FPGA boot camps, we call them on there, I've really been interested in those because people are really working through those at an amazing clip, we've got a few more left to do, that will be coming out later this year. But essentially, we start with boot camp zero, which is just, you know, basic logic. I mean, it's not even FPGA related. It's AND gates and OR gates and flip flops, Boolean algebra, yeah, all that stuff. And then we work into doing stuff with the really inexpensive lattice FPGA ice stick. But it'll work with a lot of other things, too. There's only one of those boot camps that's really specific. And so we go all the way up, I think there's six of them out now. And there's actually seven or eight in the can. And they just haven't all been released yet. But we go all the way up to state machines, and building a UART, from scratch that actually has some novel features to it, just because I didn't want to do yet another copy of the UART that you always see floating around. So that's actually been very exciting, a lot of work. But it's been really, really interesting, and kind of plays into a lot of the things that I'm kind of interested in that being, you know, FPGAs, and how do we better educate people? And how do we document stuff? So,
and that's on hackaday.io? Correct?
That is, yeah, if you search even on Hackaday, because we've done posts about it, too, you'll find it, but if you look for Hackaday bootcamp, FPGA bootcamp, you'll you'll find it.
Yeah, I think we talked about that last time was, what kind of FPGA you were going to go with? And I think you just said the ice stick, which is a lattice?
Yeah, I mean, it's been around for a while. And it's very inexpensive. It's really easy to get through the channel. But you know, there's a lot of different boards that have been coming out. It's really interesting. And one of the things I've thought about is if we get enough popularity, to support it, as we may branch out some of those that are specific to different boards. You know, I'm always kind of struck, I think we kind of talked about this on one of the previous podcasts. I mean, people use FPGAs differently, right? So just like you can't say, Well, I'm an electrical engineer, and then that kind of describes exactly what you do, right? Because some electrical engineers do power distribution, and some do micro circuits and some do PC board layouts. And RF was the same way with the FPGAs. Right? I mean, I think some people were using it to design what you use to design with logic, right, like we just talked about, I think there's people like me who like to play with CPU architectures, which, yeah, that's technically logic, but it's kind of, you know, a different step of logic, right? There's a little different discipline to that. And then I think there's people who just grab IP and basically build up custom microprocessors with them. We're seeing a whole division of that sort of thing with like, the zinc, you know, so you're not really designing your own CPU. You're just kind of making, you know, taking a CPU that's either in silicon or, or in, you know, IP, which has intellectual property, right. Think of it like software module for an FPGA and combining that with other pieces of IP. So you say oh, now I have a processor that's got Three PWM outputs and four pulse captures, because that's exactly what I needed.
You can put in your own peripherals, right?
Right. And you know, you configure your memory, how you like you configure your IO, how you like. And you've got basically one part number in inventory. And of course, you can even reconfigure with that's pretty advanced. But it turns out, I think the boards now are really starting to get in where you can kind of delineate them on who they're for. So the ice stick is kind of what I think of as an ice like, FPGA. It's really just a breakout board for a chip. And yeah, I think it's got like four LEDs on it or something. But that's about it. We talked a little bit last time, but that up do we know, which is essentially looks like a basic stamp with the same kind of chip on it is actually a slightly better chip, but it's, it's compatible. So on the bootcamps, you can actually use the up to we know, and I think it's like 10 bucks. I mean, really inexpensive. There's tiny FPGA, we did a really cool two part in Hackaday, on the that Max 1000 board that it's actually from aero, but really, I think a German company trends, or somebody actually is the design behind it. It's got an Intel FPGA on it, which you know, was Altera, and we did the of course, you know, we're doing this audio, so you can't see I'm waving my hand back and forth, we did the persistence of vision, widget with the LEDs on it. So as you move back and forth, it would say whatever you wanted it to say, that's another one, it's got a few little minor IO devices on it. But primarily, it's a, you know, it's just a breakout boards, obviously, it's got an accelerometer on it for that purpose. If you look at Digilent, you know, they've got the C mod, which are the same kind of thing. They're like little basic stamp form factor, cross between PC board, and I see. So those are really good for people just doing, you know, I just want to replace a whole bunch of logic chips, or I want to learn about logic. But we also see the dev boards like did you once got a bunch that are more for people, fielding CPUs, where you've got a board, you know, it's got LEDs on it LED displays, it's got switches, some of them have, you know, network adapters, or, you know, things that you would put on a computer essentially, right, you probably don't need a NIC and a serial port for your your logic circuits, but you do for your CPU. And it's really surprising how inexpensive some of those are. I was just looking this morning, you know, some of the older boards that have smaller chips on them, and maybe some limitations, you can get those for $40. I mean, it's really amazing. So the idea that, you know, it used to be this was some $50,000 buy in to get into this business, it really isn't anymore. And then you got the CPU ones like ZedBoard, pink Xibo, you know, those are great, if you're really going to go with the route of saying, Well, I want an ARM CPU. And then I just want to customize it, I want to add a custom instruction, I want to add, you know, hardware multiplier and some PWM outputs or something like that. Those are really good. And the vendors are really getting scary good at kind of bringing all that infrastructure together so that you really just kind of build your CPU, right, your software, you're all in one environment. And that just all kind of works. So that's pretty cool. So did you ever use your you had an ice stick? Right? Did it ever come out of the package? Or is it like half the stuff I have and just sits in the package? Do I get rid of it?
I'll let you in on a really cool little secret. So at the end of our last podcast with with Al Williams, which was episode 94. Just I think the day after Parker handed me his ice stick, which was still in the package. And it is now out of the package. Oh, and it has been out of the package for a total of three or four days, something, something like that. So I have I put it up on top of my speaker that sits next to my computer, so I can look at it and be like, I need to do an FPGA, something I don't know. But I'm certainly gonna go check out the boot camps. And actually, you know, what they were kind of brings up with what you were talking about there, that the string of information you just gave, there seems like a really fantastic cross section of here's bottom to top in a way of what someone might be interested in. Is that reflected in boot camps?
Well, I mean, we're kind of moving at the level where you're doing the logic design, you know, we're not covering CPU design today. I'm not saying we wouldn't get there. But at the moment, we're not doing that. It's just we're a long way from there, I think be the the trick to that. As far as the CPU oriented ones, that's almost not FPGA design, right? That's really your you become a user of somebody else's FPGA designs in that case. So we really haven't covered that very much either. Although obviously, you know, crawl, walk, run, you know, you got to start somewhere. And I think no matter how you approach it, you do want some fundamental understanding of what's happening. So I think the boot camps are a good intro and you might not go past a boot camp three, if you really just want to jump over and start gathering IP for people and more integrating it. Some of the later ones might not be that interesting. But I think if you're trying to do a CPU, there's certainly where you're going to start. If you're just doing digital logic, I think that's certainly a, you know, there's a great path through there. And
also learning like just the fundamentals of like, either VHDL, or Verilog is pretty important, even if you're just doing IP gathering, so to speak.
Yeah, cuz you still gotta increment integrate it. And, you know, it's interesting, you mentioned that, because that's one of the things that's been on my mind lately is, you know, we've got, I prefer Verilog. I don't think that's a big secret. Although sometimes I have people paying me that I have to do VHDL. And that's okay, I can do that, too. But there's all these newer languages out now, right? There's spinal HDL. And I don't know, there's three or four others that I see occasionally write posts on Hackaday about. And it's interesting, because it's clear that there's people who have innovative ideas about how to make this easier, how to make it work better. And the problem is professionally, I don't know that anybody cares, right? I mean, it'd be like, if you could invent a better language than C, it's really hard to say, Okay, well, we're gonna start using my language, you know, Parker Lang or whatever. Okay, nobody's heard of it. There's no support for it. yawn, right? No one cares. And so it makes you wonder how many great ideas are just stuck away and those kinds of products. And so one of my things on my stack of things to do? You know, because I have the stack of boards. Also, it's like in outbox, here, where I've got the left is the stuff I want to get to, and the rights, the stuff that's gonna get given away for a school or something. But, you know, I want to kind of go look at some of those and see, well, what are the what's the unique differences in those languages that maybe we ought to be learning from, and maybe that comes out in the next spec of Verilog. Or maybe you do go evangelize it, because it's a lot better. And there's some reason for that. But it's a hard sell, you know, it's a hard sell to go to people who've been entrenched in that some of those languages actually generate VHDL or Verilog, on the back end anyway. So then you might argue, well, I could just sell it as well, I'm gonna use this tool to generate the verilog. So that might be possible. But again, so then is it worth it? Right? What's the value proposition? And I don't know the answer to that. I really, don't you guys ever use any of those odd ones?
I've used on a language before that's not FPGA related. I'm actually a big fan of parallaxes spin code. That might be kind of like the most popular microcontroller code that's not C, or C++, even though like what micro Python is getting pretty big. And apparently rust is on microcontrollers now as well.
Yeah. So yeah. And a lot of people are very militantly in love with rust. Yes.
Yeah. Nothing wrong with that. It's just, uh, that's I just liked how spin handles, you know, writing the software out.
So yeah. Well, you know, the interesting thing about spin and the propeller in general is it's kind of a trade, right? You say, Okay, I'm not gonna give you interrupts but I'm gonna give you processors that can just go wait on things. And I'll give you multiple processors. So it's kind of an interesting idea. I'm always surprised. We don't see more. I mean, there have been some really interesting things done with that. But I always think there should have been more things done with that. And I think like I say, it goes back to the fact that it's kind of a niche, right? It's not, it's not as mainstream as some of the other things.
Yeah, it's it's on the parallax propeller is one of those. It's a very unusual microcontroller architecture, which you don't really see a lot of different ones out there. Like you don't see you got, you know, your regular Harvard. And what's the other one?
risk or whatever?
Well, you got risks this great. So yeah, I mean, yeah, everything's either Harvard or shared memory data, and it runs through but yeah, the these guys had some different ones chip, Gracie, obviously, that was his brainchild, right. And the whole idea behind spin was that you had these multiple processors, sharing resources. And so it obviates the need for interrupts to get real time performance. And I don't know if they, you know, I mean, they've done a great job of promoting that in certain markets. And of course, they open sourced some of it last year, I think, so that you can actually get some of their designs and actually work on them. I don't know how many people were really doing anything with that either. But it's one of those things that always seems like there ought to be more being done with it.
You can actually run their code on an FPGA to emulate a I guess it's technically not an emulation since you're actually configuring gates. You can run a parallax propeller, the first one on an FPGA. The that's one thing is Oh, We're not seeing those, we don't see a lot of microcontroller architectures out there that are truly different, like how the parallax propeller is. But with an FPGA, you can basically make whatever you want if you wanted to.
Well, and you know, that's kind of my thing, right? So I don't remember if we've talked about that before or not. But, you know, years back, I did the one instruction wonder. And so it's literally a CPU 32 bit CPU with one instruction. And that that's actually kind of fun. It's, it's one of those things where I thought I had invented that. And then after Digital Research, it was like, Oh, wait, somebody else had thought of it a long time ago, I just reinvented it. It's called a transfer triggered architecture. And it's one of several different kinds of one instruction computers you can do. So if you go look up, Dr. Dobbs ran all that, then I think it's still out on open cores, I think I've got it on open cores are one of those sites, but look up one instruction wonder. And that's that was my attempt at a neat architecture, actually have a fourth compiler for it. So you can actually program it and high level language never did take the agony it takes to port A C compiler, but it would have supported it. I mean, it's certainly robust enough to support the GCC port. If I had the patience to do that. Every time I read the documentation on porting GCC to something, I want to hang myself, it's really bad.
That's why you just have other people do it for you.
Well, that's what grad students are for. Right. But you know, it's interesting. There's a couple of I oughta revisit that, because there's been a lot of change in that space now, right where you've got, you know, LCC was out and now there's what is the what's the other one, the one that clang has done on clangs on top of I can't remember now. But there's a couple of more sane portable C compilers now that don't have all the legacy baggage GCC has, you know, we did an article on that for Hackaday, probably three or four years ago, about, you know, what's hard about designing a CPU. And it turns out, it's not hard to design a CPU, it's hard to design, all the ancillary stuff that you need to get a usable ecosystem around it. So you need an assembler, and you need a compiler, and you need a debugger, and you need linker linkers, and libraries and all that stuff. So you know, your choices are, if you're just experimenting, what a lot of people will do is say, Oh, I'll duplicate this ARM chip, or I'll duplicate this AVR chip, and then I can use their tools. But I mean, commercially, that's a good way to invite a lawsuit. So you can't do that. But if you're going to do it yourself, it's a lot of work.
Yeah, I remember when we were in school, my VLSI class, we use an arm to core, and we basically device designed everything around it. And that way we could actually, you know, we had a coding environment to actually use it later, down the road.
Yeah. And, you know, one of the things that I think gets missed a lot is that if you're just in this, for the education part of it, you don't have to have any hardware at all, you know, you can actually simulate all this stuff really well. And that kind of had a bad rap for a long time. Because when your PC was slow, you know, your CPU would take overnight to simulate, you know, few 1000 instructions. But the CPU power you have now is so fantastic, that you really can get a lot done in simulation. Now, it's never really a replacement for real life. I know we talked about EDA playground. And that's one of the things we do in the boot camps. By the way, as we use EDA playground, although you don't have to use it, you can just use Icarus, which is another simulator. But that means that you can be reading the the boot camp in the browser and you have another browser window open and you're working on your simulation and write your code and see in the output that goes along with that. So there's links that take you into EDA playground with the entire set up already ready for you. So that means you don't have to figure out how to install things. And well, does this work on macOS? And does it you know, doesn't matter if you've got a web browser? That's, you know, reasonably modern? It'll work?
You mean, it's not going to work with Netscape?
I don't know. Maybe not. But yeah, the your your textbook is what links links, it's not going to work with links. But it was interesting. Since we've talked last there's a we did a post on this for Hackaday. Which of course I keep saying that, but that's because that's my life, right as generating academic posts. At that, workshop.com Have you guys seen that one? I have not. So it's interesting. It looks like the site's been around for a while, where it's one of these kind of fantasy video game computer type things right where you go in and you can kind of code your video games, but they've recently added support for FPGA and you can actually go in there and say, Okay, I want to do some FPGA code and you can see the logic traces and you can also generate things on the To the fantasy virtual screen, if you will. And there's a lot of great examples. So you know, there's the balls bouncing and stuff like that. So if you ever thought, Well, gee, okay, I kind of read through some Verilog stuff and, and I get the syntax, but how would I actually go do something real with it? Well, there's some pretty good video game examples worked out on that site. So I was very impressed with that. I mean, it's not very practical. And I'm sure some people would turn their nose up at it, because it's not professional. It's video games yadda yadda. But I thought it was really a great effort to do things and get kind of make that more accessible.
I'm, I'm looking at the page now. And I actually pretty excited about the, it's not the FPGA one, but it's the Atari 2600. They've got a basically, you can program Atari 2600 in the browser. And basically, it simulates it with an emulator in your browser, so you don't even need the hardware there, which is kind of amazing. And makes it a lot easier.
They have, they have a section here on on the front page, it says hardware design, and it talks about porting your code over to a lattice ice stick and connecting it to a CRT. So if you want to take your code, and actually play it on, you know, an OLED TV, I guess you could do that. That's That's fantastic.
I think it's funny how they say legacy, CRT or TV. I don't know, those are technically the same thing.
Maybe maybe we need to reconsider our Zork game on a FPGA.
So you know, records made a comeback, right? The LP records. So you think maybe in 1520 years, there's gonna be some cult of people saying, Ooh, but those glass TVs they look better, there's,
I hope not cuz I just tossed out my last CRT monitor about a week ago.
So So I remember one of the guys at macro fab his his son actually had them pull their old TV out of the attic because its latency was better for playing Smash Brothers on so you know, button clicked to action was faster on an old CRT.
I think I'm gonna go trademark hollow state monitor just for when that happens. Right. There you go. So but the other thing that's interesting on the simulation side, by the way, and I'm kind of surprised we don't see more of this was you don't see it done much. But you know, all the Verilog interpreters for simulation, have that PLI VPI interface. So if you had some people, because I hear people say, Well, I can't really simulate stuff, because I have this complex, external world I have to hook to so I have to go hook up to that. But with those interfaces, you can write that complicated external world in C or C++ or Python, or there's there's bindings for all sorts of things. Now, I was looking the other day, that was something I'd never even heard of. And, you know, so there's a lot of things you can do in simulation without buying any piece of hardware at all. And I think things like this eight bit workshop, that's a really good example of that, right? I could sit and do a whole video game, like you say, on the Atari or in Verilog, or, you know, whatever. And I can see it work, I can play it even. And I don't have to do anything. I don't have to install any software. I don't have to buy any hardware. It's all in the browser. It's pretty awesome. And I'm surprised we don't see more of that with PLI VPI, to get people doing these external things and simulation, instead of having to go out and say, Well, I'm gonna go try to troubleshoot my stuff on the breadboard. You know, that's
actually a good idea. There is I'm gonna guess, with this PLI VPI stuff you can like, because a lot of stuff I use FPGAs for is like converting data, like video data from one format to another format. And I guess if you, I mean, you just have to capture what your inputs are. And then just feed that into your simulation at that point. I want to guess the supports data stream?
Yeah, you could do that. I don't have to
look into that.
I mean, like, for example, even debugging, you could do that with like a spreadsheet. Right. You could have something that just shot data through out of the spreadsheet into your simulation.
Yeah, a boot camp off that on that would be nice.
Yeah, I was thinking about that. Yeah, I was actually thinking about that. That's probably not the next one. But that one might be further down the pipe. So yeah, yeah. So there's a lot of interesting stuff over there on Hackaday IO. I mean, obviously, the boot camps are something we specifically, you know, foster and do ourselves. But you know, that's mostly community driven. And so if you just go for a, you know, that's stuff that I just love to do once a week or so let's go browse at all the things that are out on Hackaday IO, and you know, there's the guy building the electron microscope, and there's, you know, this amazing amount of projects out there that are really cool. And I saw one the other day I don't think the post has actually come out yet. It'll probably come out right about the time this gets published as well. Some of my favorite posts on Hackaday are for people trying to challenge how all this stuff gets taught to people. I love that right? Because I don't think we always do the best job of that. And we've, you know, in some ways, I think we've gone backwards. I mean, there's a calculus book from 1908, that I still think is the best calculus book, right? Better than the ones I had when I was in school, because I'm not that old. I'm old, but I'm not that old. But there's a and I forget their names. But they were actually talked at the Super Conference, which is the Hackaday conference back in December, where one of them's got an MIT degree, and the other one's self taught. And they've come to the realization that teaching calculus is much better if you have 3d printed models of all these things that you know, and then you can start talking about things like the volumes. And so they did this great talk, and there was a post on Hackaday. I think it may have actually published, it's published in the last week, or if not, it's about two. And I love that kind of stuff. Because I think that's one of the great things with the Internet. You know, TV, who was the FCC chairman said it was a vast wasteland, right? But there's all these educational things you could be doing with TV. And it's the same way with the internet, there's cat pictures. Yeah, you know, and there's other kinds of pictures. But there's so much educational opportunity there. And we just got to get out of these old modalities. So I get a lot of these posts, where they're doing all the really great computer graphics, showing you about how like a fast Fourier transform works, or how IQ signals on an SDR or, you know, it really gives you that intuition. And maybe it's not as rigorous as saying, yeah, here's a whiteboard full of equations, which I don't know about you. That's what I got. Right?
That's where I got to, that's all I got.
We had one professor that he would come in, and he'd have the board half covered with stuff. And he would just keep writing, and you keep taking notes. And finally, somebody would say, excuse me, Dr. Rogers, he just turned around and go,
Sure.
And that was the entire class was him writing on the board and you dutifully taking notes, you know, so I really think that's, uh, you know, I love those kinds of articles. And that's one that stuck in my mind lately. And I think that's kind of, you know, as I mentioned, at the top of the podcast, I mean, that's kind of the intersection of my, my interests, right. I like to think FPGAs are cool, I enjoy them. But I like to think we could be teaching more people more about them, and documenting this stuff, you know, and that's kind of the boot camp ideas, how do we document and that's a little more of an educational documentation. But, you know, you guys deal with a lot of external folks, right? So you know, the state of documentation is generally not what you would wish it to be. I get a lot of clients, especially where there'll be like, Oh, well, Bob did this on an FPGA for us. And eight years ago, and of course, Bob's gone now, right? He retired or he quit, or we fired him for surfing YouTube, or whatever, you know. And, and then you go, well, that's interesting, because there's no documentation of this whatsoever. And I think that's a real interesting problem. And I don't think it's one we're attacking very well. So you know, that's the other side to simulation to I think, at least sometimes the simulations give you a way to delve into what does this thing really do? Right. But it's still not ideal, right? You would wish for more comprehensive documentation? So I mean, how about you guys, you see a lot of this too, right? You see great documentation that you probably see some pretty poor documentation too.
Yeah. On the, on the, let's say, on the macro fab side. Because aside, we have a API documentation for our web interface. And for the longest time, it was basically one of those just like self generated or auto generated documentation for for the API endpoints. And so if you wanted to do something, you basically had to experiment with it, and figure out what, how, how it worked. And it wasn't till like a couple of months ago, like, we finally sat down and wrote out like, examples and, and flushed out the documentation. So like, you don't have to actually like, you just have to read the documentation. And now you understand how it works from a, you know, code design level. So I've run into that problem Williams, where you just don't have proper documentation for everything your own things.
Yeah, right. A year later, you're like, What? No, where was I thinking?
Yeah, how does that work? And you don't know until you actually try to do it. And I will say the biggest one I've run into like the largest project I've rented that's got poor documentation is the key CAD Python documentation. It has gotten a lot better over the last like two months now. Like There's that I can't remember the guys name. But he has a website where like he actually is going through the documentation and writing his own documentation for that Python interface. And because right now the official stuff is you have to go look in the code and see what it's what it's doing. To figure out what you need, like what attributes you need, you can pull out of out of the interface.
Yeah, I think I'm gonna go with that. That's the absence of documentation. If you work, if you require your end user to read the code itself, that means there's no documentation.
I always say that's what you'd ever want to hear on an airplane right? As you want to hear the captain come on and say, Excuse me, ladies and gentlemen, this is the captain speaking. Are there any software engineers on board? probably not your best flight. So. So it's kind of interesting. And I mean, one of the things that I've always been kind of flirting with, and I'm afraid I'm not very good at it myself, but I always think it's interesting. You know, Donald Knuth had the literate programming, you know, so the tech stuff is all it's basically a book. And inside the book, there's code, but the code subordinate to the description. One of the things that really stood out to me is the best example I've ever seen on that is that Jones on fourth, have you ever seen that? Where the guy's name is Jones? And he, he writes a fourth compiler interpreter of four. It's kind of weird, right? It's kind of both. But he does the fourth system. And he starts with x86 assembly language and then moves into fourth. But it's the same way. It's almost all comments, and you read the comments. And then it's like, Oh, and here's a little code that goes with that. And it's it's more of a, so they call that literate programming. But I've recently been thinking about that again, in context of FPGA is not because of FPGAs. But because of the rising popularity of these Python. What do they call them workbooks right now is it workbooks where they call them the Jupyter? Notebooks? The Python notebooks? You guys been following that any? No, that's first I've heard of that. So it used to be called ipython. And I guess now they've they've made the Python kernel ipython. And so you can actually get it with other things other than Python. But essentially, it's like literate programming. There's this document, it's a markdown document. They can have graphics in it, it can have, you know, graphs and hyperlinks and all that, but it also can have live Python code in it or other code. They were saying the other day, they have 100 different languages for it. I don't know if that's true or not. And, you know, I think that's an extension of this literate programming ideas, the codes, not the main point, the documents, the main point, and the code supports the document. So it often makes me think that's probably what we ought to be doing with the FPGA documentation. The two things I've historically always seen on documents that kind of cheesed me off, it's really easy to sit and say, oh, you know, Parker, you wrote about this API, and it doesn't say what happens when you return a five or something, you know, is find something that you wrote, and it's it's demonstrably wrong. What's really hard is to say, Hey, I looked at your document, and you know, what's missing? Is this complete piece over here, right? People weren't trained to look for that hole, they look at what you've put in front of them, and they comment on it. And they, they throw rocks at that. But the holes are really tough to find, and you can't see them, because it's your thing, right? So you don't have holes at all. But that's the one thing I think when I look at stuff, I always try to think, Okay, I'm happy or unhappy with what's here. But what do I think about the stuff that's not here? I think that's one real big issue. I think the other thing is, is just there's so often when I go into a strange situation, which of course I do quite frequently, and start looking at, you know, whatever little documentation exists, is that everyone assumes you know, all the details about what's happening to begin with. So, you know, the, like, if you say, Okay, I'm gonna document my car. And so you start going into well, here's the transmission. Okay, well, wait, what does the car do? You know, I need that for passengers. And they move along a road up to 60 miles an hour. Okay, that's the bigger picture. And as an industry, we're really bad at documenting that right? Because we all think we know exactly what we're doing. Well, we do. But then the guy coming behind you, he may not understand that. That I mean, cars, probably a bad example, because we all know that. But generally, that's not what I'm getting called in to look at. And it's stuff where you don't really understand the big picture. Frequently, no one left standing knows the big picture. And so all the detailed documentation in the world doesn't really give you a lot if you can't get that orientation to the universe. So anyway, I don't know. But yeah, check out the Jupyter Notebooks. It's kind of interesting. We've got to hack it. A post coming out all those twos unsurprisingly, right.
So I'll put those in the notes. And I'm going to read up about those after the podcast because they looked really interesting. That whole style of documentation, I that's actually makes a lot of sense is write a more of like a project description, style thing, and then make sure your project actually supports that. So go. So start with the documentation and build towards that, which is actually how like classical engineering is done.
No, I mean, the problem with the classical engineering, as you usually are working with requirements that are so stilted that it's really difficult, you know, parsing them as its own job, right. And so we're I have worked on big projects like that, where we have requirements, I've always tried to have some architecture document, that you could just go read on the bus and go, Okay, I'd kind of, you know, I know Oh, I see four people have to get the car and go 60 miles an hour with their luggage. Okay, that makes sense. There's a great story about who was the shuttle guy, Max, the j, that is how you pronounce it, where he had the 20 people in the room at the beginning of the space shuttle project. And he had the glider, and he threw it out in the audience. And he said, that's what we're making, you know. And I thought that's, that's the kind of thing you got to strive for is all the requirements in the world won't show you that glider going out into the audience. And you've got to have both of those things. I think so. So you're gathering links, I'll tell you the one that you really ought to stick in the links. Did you see the post we did about a week ago about what really happens if your spacesuit decompresses in space?
No, okay, so I had that on my list to read in
our there's so much from this podcast that I'm gonna have to go and do homework on. It's unbelievable. You've given me like 40 hours of work now.
So what happens if your space suit decompresses and out of space?
Well, I think you should read the article. But the reason I wanted to point it out to you is I got to use the word meet balloon in that article. So it was really
just a teaser.
That's just a teaser, right? If you want to read about meat balloons, you know, that's a Yeah. Yeah. So
I actually did hear a story. And I don't know if this might be in that article. But apparently, one astronaut did actually get a hole punctured in his in his suit, and it was near his hand. And the vacuum actually sucked, you know, a portion of his skin of his hand into the hole and plugged it. And so for an extended period of time, he had just you a portion of his hand exposed to open space. And he it was fine. I mean, I'm sure it was a bit cold and maybe a bit read, but it he survived.
I'm gonna bet you that little area Party wasn't fine. On the sand, probably not.
Well, no, the if you go read through that article, though, like I say, I won't spoil the ending of the article. But there was a guy in I believe it was here in Houston. He was a technician working on the suit or an engineer, I don't remember which, but they had us in a vacuum chamber, and the tubing came loose. And he was exposed to you know, very explosive decompression. And he survived it. I mean, I'll give you that spoiler alert, you know, wasn't wasn't totally annoyance free. And of course, they also got him re pressurized very quickly. So I don't know that he would have survived very long. But you know, it's not this Arnold Schwarzenegger exploding on the movie set like you.
Oh, and like you say Total Recall. And total recall was the eyes pop out of his head. Yeah.
Now it turns out that can happen to and that's in the article, but it doesn't happen the way from those kinds of conditions. So it's kind of an interesting read. And I had to just plug meat below and I mean, that's just how often do I get to use that that article?
Yeah, that's a
badge of honor. Right there.
I'll say that part in in Total Recall that were Arnold's eyeballs are popping out because they're on the surface of Mars and the vacuum that you can hear them screaming just fine, though. Which doesn't make any sense.
There's a very small atmosphere on Mars, right? Just just I think so.
Yeah. But they didn't like it just sounds like they're in a no more room yelling.
I spared you doing an Arnold Schwarzenegger impression. So you should thank me for that. So
don't you don't want me to do one either. I think even can do one though.
Oh, well, there you go.
You know what, maybe we'll record a separate video of
that should be the ending of each one of your podcasts. We'll be back and podcast
after hours.
So um, is there anything else we want to talk about with FPGAs? I actually I want to do a little more on the simulation stuff like so on the EDA playground is that like, basically you you dump in your Verilog code and then simulate it
so is really nice. And especially if you sign up, which I know some people have an aversion to signing up for things, but it doesn't cost anything, you get access to a lot of commercial simulators that would be really expensive for you to get yourself. And you can also use Icarus, I don't think you have to sign up for that one. And there's a couple of versions of Icarus and everything. But it's basically a little IDE, you've got the left hand side and the right hand side and your test bench, which is the code you don't intend to be synthesized, right? That's on the left, your synthesized codes on the right. And there's a little UI for adding tabs. So if you've got multiple files, you can do that. And it doesn't handle those as well as you'd like. But I can tell you more about that in a second. And you pick your tool, you can pick different libraries, like if you want some of these verification libraries. And you you basically tell it to run, and it will come in and assuming it all runs correctly, you know, there's a console down at the bottom, it'll pop up a new window or a new tab, and it'll show you the waveforms on there. And you can pick which waveforms, you want to look at everything. So it's not as nice as say, model sim or, or even GTK wave. But it's on your browser, it doesn't cost anything, and you don't have to install it. And if you're at work or something where you can install stuff, you can still sit there and crash a little Verilog code out and take a look at the outputs. So I was very impressed with it, I use it quite a bit. And like I say, we kind of centered the the boot camps around them. Even though you can just say no, I don't want to do that I want to do it all on Icarus, whatever we support that we kind of talk about how to do both. The only downside to it? Well, it's couple of downsides. One is is like right after the boot camps came out, they started crashing a lot. And I was afraid we might be responsible for that. So you know it the availability is not 100%. Right? If you look on his Twitter, you'll see they go down occasionally. But the other thing is, the way that set up, it really wants you to have your test bench named something over here, and your main code, named something over here. And if you have multiple tabs, you kind of have to include those other tabs. So they're there, but it doesn't pick them up as part of the library automatically. So that means every time I do have something I'm really trying to do, that's not just a toy, I wind up having to go make little subtle changes to get it to work with that build system. So it's not exactly the same as what I started with, which is kind of, you know, not ideal. But it's not just Verilog, right, they do VHDL they do system C they do C++ they do, I want to say python, and you know, if you go look on the tools, there's multiple tool sets, you can pick. And then inside each of those, there's different versions of the different tools. And like I say, some of them are commercial tools that would actually cost you a good bit. Field yourself. Now granted, you're not gonna want to run your commercial top secret designs out on the internet, through some guy's web server to do the build, but just for stuff, experimenting, or trying to make sure something works for a customer that uses a particular tool that you don't have or something. It's pretty cool.
That simulation is one of those things I really want to start getting into for FPGA development, mainly from the standpoint of when you make one little change, like you're trying to debug one little tiny thing and when you click Compile, it's not it's it doesn't it just takes forever to do that it because most times it's that layout step where the your EDA tool, like what you're using for the FPGA, like was Xilinx has one and I can't remember what the Cordis is the one for orders is Altera Intel era. Yeah, so that's the one I use a lot. So when you start doing that, and you you are changing one variable, like the incrementation for a variable for like, you know, trying to sync a clock up, it takes a long time and just debugging that one thing can take you hours because how long it takes between each of the layout steps. But if you had a robust, you know, input into your simulation, then you're gonna you can probably do it in 15 minutes.
Yeah, it's always way easier to catch stuff at simulation, especially because you have a god I view, right, you can look at everything. So you know, it's not like the old days where you could just go send a tech into a rack with a couple of probes and find anything on this on the system. So if you do want to try to debug live, you know, on the hardware, you wind up building in a logic analyzer, which most of the vendors have. I did one by the way, I found an open source one, open Vera flaw, and I didn't care for some of the way it worked. And I basically kind of rewrote it, but I forked it. So if you look on GitHub, you can find a fork of open Vera flow, and it's a logic analyzer that will drop into almost anything that's doing Verilog but you know, now I gotta go wire that into the circuit and I gotta bring it out and I got to do you know, it's not convenient, correct. Whereas with simulator, I can look at anything and I like you say it's instant, I can make changes and immediately see what's happening. One of the things that's interesting to me about simulation, though I run into, you know, it goes back to like the documentation, I see a lot of times where people have simulated their whole system, you know, and so here's my 85, Vera log files, and I got a simulation test harness for all of it. Well, that's great until it doesn't work, right? And then it's like, Okay, now what is this huge project to go figure out? Okay, that must be in this module or that module. So I'm much more of a fan of having small unit tests. And then yeah, you probably do still need the big umbrella test. But that should almost be a formality. At that point, you shouldn't be finding little quirky things inside of some module based on that that should have been found way down at the early, very small step, test bench. You know, I think the other thing that you don't see a lot of people flash on immediately is there's really not one FPGA simulation step right, there's really three, you know, there's the one where you sit and just look at the logic of the statements. So this is set to one when that's zero. So it does that and the timing is not necessarily going to be right, down to some pick a second level or whatever. But you can find almost all of your major logical bugs that way, you know, where I forgot, like you say, I should have added to and I added one, or, you know, what was the old joke, there's two main programming errors divided by zero. Failure to initialize variables and off by one, right? Yes. Yeah, that's, that's the two major errors. So you know, you can catch all that kind of stuff pretty quickly. And then you also have after you synthesize where you really start looking at the well that got synthesized into these AND gates and OR gates, and inverters. And really, it gets synthesized into cells for the FPGA, you can simulate at that level. And then after the layout, which is the long step you were talking about, you can back annotate timing into that. And then you can really start looking at, well, that signal didn't get here until 18.3, pick a seconds, you know, and this one got here at 19. Because seconds, that's a lot harder to make sense of. But you can actually do that with most of the vendors tools. And it's pretty awesome. The amount of fidelity that they have on that is really just crazy. Awesome.
Here's a here's a question that I'm I'm kind of interested in, is there a way to bridge the gap between my digital simulation of my FPGA and my analog SPICE simulation? Say, Let's take for example, I've got a new power supply that I for some reason want to have it controlled by an FPGA? Can I meld those two worlds together and actually do a SPICE simulation where I have resistors, cap, transformers, all this other stuff? And have my simulation of my FPGA actually controlling?
Yeah, that's mixed signal simulation. And so most, I'm trying to think I can't think of a cheap way to do that. But all the bigger tools will will do that, right. And the problem is they're not cheap. I'm trying to think now some of the simulation you see, like LT spice and stuff, they can do certain amount of digital logic, but I don't think they do verilog. So that'd be kind of interesting. I wonder if somebody had ever thought about doing you know, there's your VPI project, right, as do the Verilog interface to go get over to Lt spice, and do mixed mode simulation. There's some other simulation products out there in open source that may or may not do that, I'd have to go look, but certainly it is possible. And it's pretty well understood how to do that. It's just a matter of can you do that with a free tool or not? I don't know. You know, the one I think is really cool for just quickie simulations, going back to the browser is that false dead simulator in the browser. And you know, it's got digital logic to now again, not Verilog. But you know, you can actually have some digital circuitry, driving into some analog circuitry, and then drag it back out into the digital domain. And it's just all gate level stuff. I don't know if you guys ever played with that or not. But that's really cool. And in fact, we use that on the bootcamp zero for that same reason where we're just building and gates and flip flops and things like that. But it does very nice analog simulation. And what I really like about it working with students on the analog side, which we don't do on the bootcamp, but on the analog side, it actually shows you little dots moving along the lines, and the velocity is proportional to the current. So you really get to see the visualization of, you know, oh, that lower resistor has faster current running through it than that bigger resistor or whatever. And it's just really illustrative. So I don't even get that on a normal spice software, you know, so it's really awesome. So that totally dodged your question other than to say go spend a lot of money with mentor or somebody like that. And yes, you can do that. So
yeah, Yeah, so I have a free copy of piece bytes from Cadence. And I know that they have a lot of higher level capability. And they likely have that capability. I just know, on the free version, you're limited to a certain number of pins. And it's it's low enough that, you know, you're able to do a few op amps and things like that, but you're not really going to simulate your entire system. So I know in some ways, it is possible. It's just on the more hobbyist and home gamer level, I'm not aware myself of any kind of simulation that allows you to do both worlds mixed together.
Well, you know, I wonder there's that. Is it CUCS? Qu, CS? And some reason something's telling me that maybe does something with that, but I don't I don't remember that for sure. But, you know, it certainly would be possible. It's interesting, that would be a really cool open source project. If there's not already something out there that will do that. Let's see, here you go. So far, no attempt has been made to interface CUCS Verilog a models within it. So that kind of implies that possibly CUCS will do that. It's qu CSSA cute CUCS. I don't know if anybody else says that or not. But it may have some mixed mode capability. That was just from a quick google and a vague recollection, though. So
I've never tried doing mixed mode, Steven. So
I did the most I've ever done with mixed mode is plopping down gates in a spice simulator. And at that point, it's just gates, you know, is it nothing particularly special there? There's no code behind it. Or no code that I wrote behind it.
I got it. You take your Verilog code, synthesize it into gates, plop that in? There you go. Yeah, that would totally be like 1000 some odd gates,
I'll get back to you and a year and a half. When I have it all connected up.
You have some Verilog. The Spice netlist converter that would do that. I mean, it's not Impala technically.
Yeah, technically. That's possible, right? Yeah. Yeah. Good. Click, click Simulate and tell me how long that takes to. For it to think about all that. Oh, great.
Does anyone have anything else? No more meat balloons?
No, that was my that was my one Hurrah for the day, I think was the meat balloons though. I can give you a nice piece of trivia. So I was just saw on Amazon. They had the old show with Bob Cummings called my living doll from 1964 where he works for NASA. And he comes into possession of this female robot. It's kind of like a Dream of Jeannie. But instead of her being a genie, she's a robot. And her designation on there was a f 709. And apparently, that's where they named Seven of Nine. In homage to that character off of that show starring the robot. Yeah. So there's your there's your random Star Trek trivia for the day. So we'll see if you edit that out or not. So
now it'll stay in there. So if that's gonna wrap up this podcast, I'll wombs you want to sign us out?
Well, that was the macro fab engineering podcast. I was your guest al Williams.
And we're your hosts Parker, Dolman.
And Steven Craig.
Let everyone take it easy. Thank you, yes, you our listener for downloading our show. If you have a cool idea, project or topic. Let Stephen and I know Tweet us at McWrap at Longhorn engineer at analog E and G or email us at podcasts at Mack feb.com. Also, if you have a cool project and want to get featured on Hackaday let al Williams know you can find a link in our description to send him an email. Also check out our Slack channel. That's where we all hang out and chat about engineering things and projects and things about the podcast. If you're not subscribed to the podcast yet, click that subscribe button. That way you get the latest episode right when it releases and please review us wherever you listen, as it helps the show stay visible and helps new listeners find us
Stephen brings up alternative uses for assembly layers in PCB design and Parker uses OctoPrint!
Al Williams returns to talk about FPGAs (Field Programmable Gate Arrays) and how to get started.
Al Williams returns to the podcast for the fourth time! This time to discuss the importance of circuit simulation and what it can teach engineers.