A Z80 Retro Microcomputer For The Papilio Pro FPGA Board

z80

[Will] wrote a 128MHz Z80-based retro microcomputer which runs on a Papilio Pro board. For those who don’t know, the latter is built around a Spartan-6 LX9 FPGA so you may imagine that much work was required to implement all the computer features in VHDL. The T80 CPU core was taken from opencores, the SDRAM controller was imported from Mike Field’s work but [Will] implemented several additional functions on his own:

– a 4KB paged Memory Management Unit to translate the 16-bit (64KB) logical address space into a 26-bit (64MB) physical address space.

– a 16KB direct mapped cache to hide the SDRAM latency, using the FPGA internal block RAM

– a UART interface for external communications

He also ported CP/M-2.2, MP/M-II and UZI (a UNIX system) to the computer. His project is completely open-source and all the source code can be downloaded at the end of [Will]’s write up.

Thanks [hamster] for the tip.

26 thoughts on “A Z80 Retro Microcomputer For The Papilio Pro FPGA Board

  1. Three points here
    Firstly the Papilio web site appears to be down at the moment (DNS issues?)
    Secondly the LX6 has a hard DDR controller, I’m wondering why he didn’t use that.
    Thirdly there are some very cheap Cyclone IV dev boards on eBay at the moment (<£30) which look like they may be up to this task, and have PS/2 and VGA ports so you can drop the need for the terminal also.

    1. I can at least answer the second, Most Spartan 6 parts do have a hard controller, but it isn’t available on the TQG144 package. This package is used as it is pretty much the only one that can be used on a two layer board.

    2. Hi there.

      As Mike points out the hard MCB on the Spartan-6 is not bonded out to pins on the TQFP package used by the FPGA on the Papilio Pro board.

      My first FPGA project was a 6502-based machine that generated VGA video at 1024×768 with an 8×16 character generator circuit giving a very nice 128×48 text mode.

      For this project the novel aspect started off being the MMU and the CPU cache. Once I had the machine running it turned into an opportunity to port the various Z80 operating systems I’d heard about but never had the opportunity to use. I wasn’t really interested in adding VGA output because I did most of the development on my laptop and the UART was a lot more convenient, both for interaction and for uploading new code for testing. There’s plenty of free block RAM on the FPGA so it could easily be added.

      It seemed much more appropriate to pose it with the VT510 as a terminal than my Macbook Air :) Every good hacker deserves a real VT.

      1. Odd that you can’t just map the hard IP MCB to any convenient pins like the soft controller.

        Implementing some kind of terminal (whether it be memory mapped or via a virtual serial link) gives you the advantage of it being usable stand-alone. There’s nothing stopping you hooking up the VT and the Air at the same time also.

        The eBay sourced dev boards I was talking about (Chinese boards branded as being designed by WXEDA) come with a small FPGA (only 6K of LUTS and 270k bits of BRAM) but include 32MB of DDR and 16MB of flash. They should be quite enough to implement this kind of thing.

        REAL hackers deserve a KSR33, but you need a soundproof room for one of those :-)

  2. Now you just need to add a sata controler to add a hard drive and load up some BBS software.
    And you really need an old version of Wordstar, MultiPlan, and DBase II.

      1. Oh but you really need a 3TB drive for a BBS system. I mean think of all the warez you could have in your filles section! Talk about being leet!
        Sorry I could not help the flashback to 1987.

    1. The limiting factor with FPGAs is the number of LUTs available (or how many logic chip equivalents have been crammed into the package). You can fit a 32 bit CPU into between 2-3000 LUTs, so this could have been a 32 bit machine (there are 9,000 available on the board he used) but the objective was to see what an old fashioned 8 bit machine could do.

  3. A bit off-topic but that guy is very lucky. From his write-up “my wife bought me an FPGA for my birthday”. Mine always asks when I’ll get rid of the “useless stuff” on my bench.

  4. Love this project – just ordered the Pap Pro, one more to add to the list of FPGA boards I have here. Like this so much, I plan to dedicate the new board just for this project. It’s going to be nice having a little speedy CP/M to zip through code. It would be great if we can get some IP cores made to clone various type of peripherals from back then. Which we could map to any of the spare I/O’s to connect anything we like. And using the original S-100 type interface, just as they do with the Wishbone interface for larger IP cores.

    There are cheaper FPGA boards on eBay of course, which would make a project like this more affordable to some. So much so that for the price, they can each be dedicated for different projects. Those aren’t as complete as the Pap Pro, they still need Dram for starters. I’ve seen some Dram breakout boards too to help along with this, but it still adds up. The Pap Pro is currently discounted on Sparkfun, down to $79 now, and their arcade megawing was also discounted, down to $20 – so I just bought both for a big savings.

    But also you can get lucky sometimes and find a great bargain on a good quality Xilinx SP601 Spartan 6 dev board on eBay like I did. But the smaller variants are always fun to play with too. I also bought the Gameduino which has a Spartan 3A, a little older but still has enough capabilities.

    1. Reading your post I was going to suggest porting the Gameduino VHDL into a Retro Z80 VHDL build like this then I see you already are aware of the code.

      I thought the Gameduino (I have one here) was a 3E 200K. I also have the older papilio which is a 3E 500K but it has no on board RAM.

      The 3E 500K should be enough if I had RAM. What is the ‘Pro’ compared to the 200K/500K?

      As for the S100 Bus … How on earth can you get an old Bus like that to run at the speeds of a modern FPGA ? or were you referring to an internal VHDL bus to make adding to designs easier?

      I am just a beginner at VHDL. This project caught my eye but then I realised that it had no video so to me it isn’t what I would want as a retro Z80 project.

      What I did learn though is the speed a VHDL Z80 can run at and that is very very impressive.

      1. I havn’t see any reference on the Gameduino using a 3E, only a 3A. Mine has a XC3S200A on board. But i also bought the version made by Olimex,MOD-VGA-32MB, which has onboard 32MB DRam too. I bought it thru Mouser, part# 909-MOD-VGA-32MB.

        About the S-100 bus, yes I was referring to an internal bus. Just as the Wishbone interface which is openIP on opencores.org, and also a modern bus interface. This way several different IP cores can be built and attached to the CP/M system. CP/M doesn’t really need the S-100 bus, but any serious system back in the day did use the S-100, even the IEEE-696 variant which was made for 16bit systems. This is how they built multi-user systems, with MP/M, by adding the additional terminal cards. Also the various video graphics cards among other types.

Leave a Reply to cantidoCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.