[HN Gopher] FPGAs and the renaissance of retro hardware
       ___________________________________________________________________
        
       FPGAs and the renaissance of retro hardware
        
       Author : surprisetalk
       Score  : 95 points
       Date   : 2023-11-27 12:45 UTC (10 hours ago)
        
 (HTM) web link (brainbaking.com)
 (TXT) w3m dump (brainbaking.com)
        
       | agg23 wrote:
       | Retrocomputing FPGA work is a fun diversion from normal software,
       | enough that my brain was convinced they weren't related (had a
       | bit of a mental block for software). Over the course of a year, I
       | went from knowing basically nothing to releasing 3 different FPGA
       | emulation cores of my own for multiple platforms, along with
       | releasing something like 5 ports (which is not necessarily
       | trivial, particularly for a beginner) of existing cores to the
       | Analogue Pocket.
       | 
       | It has been a very fun experience, and I've found it to be
       | extremely addicting. It helps that there's a fairly tight-knit
       | community very interested in furthering the development of FPGA
       | hardware preservation, so people are very willing to donate,
       | test, and contribute feedback, which is a great feeling for open
       | source work.
        
         | captaincaveman wrote:
         | Interested in knowing how you got started, any prior
         | knowledge/training, as that seems quite the hill to climb?
        
           | petrohi wrote:
           | Not the parent poster, but my experience may be relevant.
           | 
           | My background is exclusively in software engineering and
           | computer science. I started by reading "Digital Design and
           | Computer Architecture". There's new RISC-V edition
           | https://a.co/d/imzGBK5 as well as freely available ARM
           | edition https://dl.acm.org/doi/book/10.5555/2815529. The book
           | starts from Boolean logic and transistor technology and goes
           | all the way to assembly programming with everything in
           | between. Most importantly gives great introduction to HDLs.
           | Next I played with a bunch of hardware projects specifically
           | targeting inexpensive Arty-A7 board to get comfortable with
           | FPGA tooling.
           | 
           | I can attest to the parent saying that this is sufficiently
           | different from software engineering I do at my day job and
           | therefore feels a lot more like hobby. Especially if you also
           | foray into wire-wrap prototyping, PCB design and assembly.
           | Finding and fixing analog "bugs" is so much fun!
        
           | agg23 wrote:
           | I _technically_ had prior knowledge as a computer
           | architecture class had us stick some premade pieces together
           | to create a CPU we designed, but I personally wrote no
           | Verilog, and it was a small subset of the class.
           | 
           | I don't have much documentation for getting started with HDLs
           | (Verilog, VHDL, etc), but I have tried to document my process
           | as much as possible. I have primarily developed for the
           | Analogue Pocket, so my documentation is themed towards that
           | device, but there's IP (code modules) and wiki entries that
           | would be useful for everyone:
           | https://github.com/agg23/analogue-pocket-utils
           | 
           | I had previously written a cycle accurate NES emulator, so I
           | was familiar with hardware techniques, but not what they look
           | like in circuits. The first core I wrote was a schematic
           | accurate Pong implementation. This was both good and bad
           | because it's very simple and has no CPU (and thus no code),
           | but it also makes it very hard to tell what is going on. I
           | went from there to doing a lot of ports (NES, SNES, PCE, and
           | a few more), and after that I worked on my own cores
           | (Tamagotchi, Game and Watch). Tamagotchi I took a very
           | typical software approach where I wrote massive amounts of
           | unit tests and wrote against those tests. While this is what
           | real hardware developers do, I found it to be a huge waste of
           | time when you're working by yourself on a small project.
           | 
           | I, and a few others, are very willing to help people learn
           | (though I'm still really a noob). If you want to play around
           | in this space, let me know and I'll try to help you with what
           | you need.
        
             | agg23 wrote:
             | On the note of my sibling comment, a common book in this
             | space for learning is "Designing Video Game Hardware in
             | Verilog", which is specifically retrocomputing related.
        
               | 0xcafefood wrote:
               | I second this book recommendation! I just started it
               | exactly to get a foothold on FPGA programming. It's very
               | accessible.
        
               | lovelyviking wrote:
               | with what FPGA hardware is better to start for first
               | tries?
        
               | Graziano_M wrote:
               | The book actually has an accompanying emulator where you
               | can run everything in browser!
        
             | datameta wrote:
             | My recommendation is the NAND2Tetris coursera course. You
             | start with a single NAND gate and put together more complex
             | gates building upon the previous abstraction. Part 1 covers
             | things like creating Muxes, RAM, and an ALU in a stripped
             | down HDL. Part 2 covers the software stack picking up after
             | having created an assembler but I haven't taken it yet.
             | Perhaps this is isn't tailor-made for jumping into FPGA
             | fast but it helped fill in a lot of blanks for me coming
             | from mostly software world.
        
             | lovelyviking wrote:
             | I really wish to play with those things because I was
             | playing with hardware when I was a schoolboy and found it
             | back then very entertaining.
             | 
             | I've built my first computer with soldering all the parts
             | and then started debugging it with oscilloscope to see
             | signals from chips and analyse them to find the problem.
             | And in doing so I have quickly realised that I am missing
             | something. This something was 'How chips actually work'.
             | Turned out it was called Digital electronics so I've
             | decided to learn this on the way.
             | 
             | My treasure and source of inspiration at school time was
             | this book: Digital Electronics by Roger Tokheim. I was
             | dragging it to school and back every day just like people
             | cary notebooks these days. This was my bible back then.
             | Boys in the school made fun of me for this. The book was
             | amazing and I think it still is.
             | 
             | I remember it all as very exciting time.
             | 
             | Now FPGA seems like a nice opportunity to revisit all of
             | this after many years of programming and developing a new
             | point of view about many paradigms.
             | 
             | May be you can direct me and others like me toward a good
             | community and tips for shortening a learning curve.
             | Possibly many things I am familiar with already and yet
             | with FPGA I didn't find a good/easy way to start so far.
             | Perhaps you can advice something about 'how' and 'were' to
             | begin.
        
               | agg23 wrote:
               | This is retrocomputing specific, but this Discord server
               | (https://discord.gg/3wv3gMhp) has quite a few of the big
               | devs in the FPGA gaming space, and they're more than
               | willing to answer questions. They're what really got me
               | going after I built my Pong core.
               | 
               | I have always been a big advocate of learning while
               | doing, especially in software. Find something, preferably
               | small, that you want to build (your Pong), and work on
               | making it a reality. Maybe it's making Snake entirely in
               | HDL. Maybe it's playing around with LiteX on your
               | preferred development platform so you can build something
               | cool with the RISC-V processor (I don't suggest this
               | though, start with learning a normal HDL). Maybe it's
               | simply looking through one of the existing retrocomputing
               | cores, trying to figure out how stuff ticks.
               | 
               | Until you get to the CPU design level, the general
               | concepts you'll encounter will be fairly simple. I think
               | it's enough to just play around with blinking lights,
               | learning how parallel synchronous logic works, relative
               | to how we think of software working.
        
         | kjs3 wrote:
         | Just avoid the 'FPGA reimplementation v actual hardware'
         | religious wars and you'll be fine.
        
         | bmurphy1976 wrote:
         | > Retrocomputing FPGA work is a fun diversion from normal
         | software, enough that my brain was convinced they weren't
         | related (had a bit of a mental block for software).
         | 
         | That's awesome! I feel this, I've had a software development
         | mental block for a number of years now. I just don't find
         | modern software all that interesting anymore. Lost in mountains
         | of model mapping, layers of terrible abstraction, that never
         | ending package update grind (shudders), bad APIs, closed won't
         | fix works as designed bugs (sigh), truly insane complexity and
         | so many many things that are simply outside of my control.
         | 
         | It's my interest in related, but different areas that has kept
         | me engaged recently: micro electronics, 3d printing, and home
         | automation. They exercise enough of my decades of programming
         | experience to get that fix, but the projects are small and
         | focused on solving very concrete problems instead of moving a
         | decimal point on some spreadsheet somewhere completely
         | disconnected from me. It's great when you make something for a
         | friend and you can see the joy in their eyes as they realize
         | how much this thing you made helps them.
         | 
         | Sounds like FPGAs are doing that for you and that makes me
         | happy!
        
       | bbayles wrote:
       | I wanted to learn how to use Ghidra for reverse engineering
       | binaries. The thing that allowed me to really improve with it was
       | using it to analyze old video games that I played as a kid in the
       | 1990s. Finding previously-unknown cheat codes, coming up with
       | improvement patches, and figuring out how they work is very
       | motivating!
       | 
       | I'm happy that these retro hardware projects are working out;
       | I've liked seeing people test out what I've found in Ghidra on
       | real systems.
        
         | FirmwareBurner wrote:
         | _> I 've liked seeing people test out what I've found in Ghidra
         | on real systems._
         | 
         | Do you have any findings to share?
        
           | bbayles wrote:
           | I've been writing up my findings here:
           | https://32bits.substack.com/
           | 
           | So far I've focused on the Sega Saturn because it is
           | notorious for having a difficult-to-understand assembly
           | language (SH-2). That means there are lots of things to
           | discover, because people haven't really looked yet!
        
             | FirmwareBurner wrote:
             | Noice
        
       | ChuckMcM wrote:
       | I agree strongly with the sentiment of this article, the author
       | missed the fully open source programmable systems like the
       | Lattice ECP5 and 40K FPGAs. There is something magical about
       | using the LiteX "make me an SOC out of this board" system.
       | 
       | As the ACM Digital has gone open access I can recommend this Jan
       | Gray paper, "Hands-on Computer Architecture - Teaching Processor
       | and Integrated Systems Design with FPGAs"[1] There are different
       | opinions on whether or not understanding computer architecture
       | makes you a better developer or not (I tend to think it does) but
       | its a really amazing time to be able to explore these concepts
       | without the need to be at a company or in an University setting.
       | 
       | [1] https://dl.acm.org/doi/pdf/10.1145/1275240.1275262
        
         | agg23 wrote:
         | LiteX is very neat, but at the same time is a massive pain as
         | soon as you move past building an example SoC. I've been
         | spending a lot of time on this recently.
        
       | eachro wrote:
       | What can a hobbyist do with an FPGA? Ive mostly only heard about
       | fpga's being used at HFT firms somehow.
        
         | _moof wrote:
         | Design and implement basically any digital circuit you can
         | possibly imagine, within certain speed, thermal, and/or gate
         | count constraints.
        
         | 082349872349872 wrote:
         | If you have a couple of years and a friend, it's possible to
         | build an entire system, from designing the architecture through
         | writing the apps to run on it: http://www.projectoberon.net
         | 
         | (they provide Verilog on this website, but Wirth himself has an
         | HDL of --of course-- his own design:
         | https://people.inf.ethz.ch/wirth/Lola/index.html )
         | 
         | NB. Risc5 != RiscV
        
       | xattt wrote:
       | I'm getting the sense that there was an FPGA "ground floor" at
       | some point in the last 5-7 years, and trying to buy one now is
       | pretty much a ripoff.
        
         | ted_dunning wrote:
         | That's odd. Whatever you could get 5-7 years ago is still
         | available (except better) for pretty much the same or lower
         | prices and with a lot more examples to start from.
         | 
         | How is that world a ripoff?
        
       | jxdxbx wrote:
       | I can see how an FGPA can perfectly emulate the logic of an older
       | chip--but the actual physical layout is different, right? Are
       | there any timing issues that result from this?
        
       | deepthaw wrote:
       | Why is the MiSTer listed as "used to perfectly emulate and/or
       | upscale analog signals?"
       | 
       | MiSTer doesn't just concern itself with analog signals, it
       | simulates the entire system and outputs the original analog
       | signal or can upscale it for digital output on its own. This
       | description could make somebody think it's just a scaler.
        
       ___________________________________________________________________
       (page generated 2023-11-27 23:00 UTC)