Sunday, September 2, 2018

RC2018/09 Part 00

Retrochallenge 2018/09 is off to the races! Here's a description of my devious plans...

The What

My goal for the 2018/09 Retrochallenge event is to get a retro CPU core running on my Zybo FPGA development board.

The end result doesn't have to do could just be a 6502 blinking an LED, or a Z80 running a short program and depositing a value into a register. It would be lovely to wind up with a retro computer implementation like a virtual PET or CP/M machine, but that would be a stretch goal!

The Why

Years before I wrote my first computer program, I loved tinkering with electronics. My parents started me out with a Radio Shack crystal radio when I was 5, then a few years later bought me a Science Fair 65 in 1 kit. That kit was awesome - even Rod Serling thought so. I learned how transistors, capacitors, resistors, etc. worked, and how they combined to form useful stuff like radios, sirens, and other fun gadgets. If I wasn't a geek already, this sealed the deal.

A few years after that, I stumbled upon solid-state digital circuits, and my journey down the rabbit hole was complete. After successfully nagging my dad (on multiple occasions) to buy me a bunch of stuff at the local discount electronics shop, I would spend hours wiring up my solderless breadboard with 74xx TTL ICs, 555 timers, LEDs and switches. The BUGBOOK original book series (BUGBOOK I, BUGBOOK II) was a wonderful introduction to this world of digital chips. This season of my life taught me about rudimentary Boolean logic, and how to fry things by hooking them up backwards. The opportunity to see 1s and 0s up close has been useful my whole career. That said, once I leapt into the world of microcomputers, my electronics hobby took a decades-long back seat.

Enter the world of the Parallax Propeller, Arduino, Raspberry Pi and the like, and I was happily dragged back into the world of hacking around with electronics. These modern microcontroller boards combine programming, breadboarding, built-in I/O, and are all documented with the cumulative knowledge of the Internet. I'm almost glad this wasn't around when I was a kid, or I likely would have never emerged from my bedroom.

Moving along with the maker community flow, I noticed programmable logic devices such as CPLDs and FPGAs being discussed with more frequency. I wondered, what are these funky things, and what can be done with them? A podcast listener heard my musings and graciously sent me a Mojo FPGA board to play around with. I learned that this was a 21st century version of my TTL tinkering, albeit a gajillion times more powerful and very "virtual" in nature. With an FPGA, you dictate the circuit you need (usually in a specialized "hardware description language" or HDL like Verilog or VHDL), and the circuit appears almost magically inside the FPGA chip. Wow!

What kinds of circuits can you make? Almost anything within the speed and size boundaries of the FPGA, it turns out, including modern day digital reproductions of the CPUs of old, like the 6502, Z80, 6809, 68000, 8086, and more. I knew I wanted to, at some point, make an old CPU live on a modern FPGA board. Now, this has been done by many people already, and for my first go, I'll be using their work and just adapting it to my particular FPGA board. This could turn out to be easy or tough. Finding out is part of the point of this Retrochallenge entry.

The How

Designs on FPGAs or other logic devices are often called "cores". (I'm not sure why.) It seems there are "cores" in the open source world for all ye CPUs of olde, many of them written in the HDLs that I referred to earlier. I'll take one of these, compile it for my particular board using the tool set for that board (Xilinx Vivado HLx), and make it do something. (Well, that's the plan.)

If that works out OK, then I'll try to do more, like combining that CPU with other circuits to make a rudimentary computer.

More to come!

1 comment:

MontanaBoiler said...

Great project, Earl! Very timely for me as I'm really wanting to learn more about FPGA. I'll be following with much interest.

Randy Kindig