Part 2 - requirements
First up, I need to make the big decision, do I use a Z80 CPU chip
or do I put this in an FPGA? Well, I have the Z80 CPU, SIO, PIO, DMA,
and CTC chips in my junkbox, so I could just go build a real Z80 computer.
But I want to be able to display register and memory contents on
some sort of virtual front panel, maybe single step through a program,
etc, just like the old Altair used to do. The Altair accomplished this
through some extreme ugliness involving forcing instructions onto the
data bus and putting the results in latches to light LEDs. Probably don't
want to recreate that mess.
Also, I just don't want to be limited to 4Mhz. I'd like to do at least 20Mhz.
There are 8Mhz Z80 chips, but no support chips for that speed that I can
find. And you know, I wirewrapped several Z80 computers in the 80's, so
I've been there and done that....
So we're going to use an FPGA with a soft Z80 core in it, the T80 from
OpenCores:
http://opencores.org/project,t80Using a soft core will let use do many things we can't easily do with a
real Z80 CPU chip.
OK, decision 1 down. Uh, but what FPGA chip? My current favorite chip
is the Xilinx Spartan 3A series, partly because they can boot from serial
flash, and partly because they only require 2 voltages, 3.3v and 1.2v.
The T80 core won't fit in the smallest FPGA (50K gates), so the next one
up is a 200K gate part, the XC3S200A. This comes in only one hobbyist
friendly (non-BGA) package, the 100pin VQFP, so that's what we'll target.
Decision 2, what kind of memory do we use?
The Spartan chip comes with internal block RAM, but I want the Z80 computer
to have the full 64K of memory, and maybe more through bank switching
in case I want to run MP/M. Well, there's not enough internal block RAM to
handle this. So we'll need to connect external memory to our FPGA.
OK, dynamic RAM or static RAM? I don't really want to deal with
the refresh issues of dynamic RAM, and 12ns static RAM is easy to come by,
so I'll use static RAM unless I hit a wall in the design.
Decision 3, how do I talk to this thing?
Traditionally, you connected a serial console off your Z80 computer.
But how many people have serial terminals these days? Few, I think.
Sure, you could wire it up to a serial port on your computer, but then
that kinda goes against the grain of this exercise, which is to not use
a huge amount of computing power just to get this system running.
So what I think I will do is provide a VGA output to connect to a monitor,
and PS/2 style keyboard and mouse inputs. The VGA output will have
a serial window emulating some kind of serial terminal (VT100 maybe),
and windows with other displays, perhaps the CPU registers, memory dump,
or the like? Have to work out the design of this in more detail, but
this will do for now. Hmm, maybe should accept USB keyboard and mouse?
That's harder....
Decision 4, storage
This is easy, no floppies, no spining disks, solid state storage only.
Probably looking at a small SD card here. This would let me write
boot images from another system, such as a pre-built CP/M system.
I want to have several system images on the SD card, so I could boot
a CP/M 2.2 system, or boot an MP/M system, or something else.
These partitions should be invisible to the Z80, so the FPGA hardware
will have to vitualize the storage somehow - to be determined.
Speaking of booting, how will this system boot? Z80's don't have
flash, they require an external boot ROM. Have some ideas here, but
will save this for another post.
Decision 5, other stuff
I think we'll include a serial port and/or USB port for connectivity.
Probably also need to throw on an EEPROM to save configuration
information (such as which system to boot). Hmm, maybe I'll use
an Atmel serial dataflash to boot the FPGA, and use the leftover
storage for configuration. Yeah, that's the ticket.
Part 3 in another post.
Scott