The Ita Computer System's Hardware Implementation
I wanted Ita to be more than just an application running on a PC. So,
I knew that eventually I wanted it to be running independently on its own
hardware.
There are different ways that a computer can be realized in hardware.
One option would be to physically fabricate IC's. Practically speaking, that
option probably is out of reach of most people. Another option would be to
create the computer out of discrete components that are wired together. That's
feasible given enough time and dedication, but it also lies far outside my area
of expertise. I think it would also be hard to physically build a CPU as large
as the Ita CPU (i.e. 32 32bit registers) and to run it at a reasonable clock rate.
I felt that the next best option would be to do all the VHDL design for the
CPU and supporting components and then run my design on an FPGA development board.
I chose to target a Nexys2
development board. I chose the board because it seems fairly popular and well
documented. It is also relatively inexpensive and easy to obtain. The board
also has a VGA output, PS/2 input and on board flash and RAM. So it met all
my requirements for creating a full working computer system.
Highlevel Overview
CPU
The CPU was actually surprisingly easy to implement in VHDL. The current
implementation is well under 200 lines of VHDL.
Memory Controller
The memory controller handles accesses to both flash and PSRAM (pseudo-SRAM).
I decided to combine flash and PSRAM controllers into one unit because of the
development board design. The flash and PSRAM both share address and data lines,
so it is easier to coordinate access to these shared resources in a single controller
than two independent controllers.
Text Display
The text display uses on chip (i.e. on FPGA) memory. I kept the text RAM on chip
because it means I have fast and consistent timings when accessing text data.
It also allows me to simultaneously read/write from text RAM. This allows the
CPU to update text RAM while the video circuitry is reading data. The text
RAM stores the characters to be drawn on the screen as well as two 8bit values
for the character's foreground and background colors.
Keyboard Controller
The keyboard controller is quite simple. It receives PS/2 data from the PS/2 keyboard
and makes them available within the CPU's memory map. The main complication is
that the CPU can't be interupted and notified when a key is pressed. Instead
of using interupts, the keyboard controller has a circular buffer of 32
bytes. This allows the controller to buffer up PS/2 data until the CPU
polls the keyboard for new data.
|