C64 PLA Replacement
The PLA chip (906114-01) used
in the Commodore C64 is a generic 82S100 gate array with custom
programming. Its logic functions were dumped and reverse engineered
by the community and are available from a variety of sources [1],
[2]. They're reused for this particular PLA
replacement in the FPGA Arcade 28 pin DIL CPLD board.
Two approaches exist to build such a PLA replacement:
Implementation based on a truth table with 216
entries, each entry consiting of 8 bits and programmed into an EPROM
chip.
Reverse engineered logic equations programmed into a PLD.
Both approaches result in the same logic functionality when
implemented in a CPLD. Since equations are more common for CPLDs, I
chose this implementation style for the final design. However,
there's a variant for the truth table available which has been
verified in simulation but not in real C64 hardware. Following are
descriptions for both of them.
We have run simulations proving that the equations perfectly match the truth table,
so both compiled outputs are effectively identical in the C64 implementation discussed here.
Equation Based Desgin
The equation based design builds on the ABEL sources found in [3].
They were ported to VHDL and implement the core logic in file
src/pla_c64-equ.vhd. It is instantiated in the top level hierarchy
pla_c64_mj.vhd which contains the pin mapping and other glue logic
that is required for the FPGA Arcade 28 pin DIL CPLD board.
A Quartus II project is available in syn/pla_c64_mj_equ. It's
quite straigth forward and the resulting programming files are
included in the archive. I've tested this design inside a real C64
and it worked for me. However, I cannot guarantee that it will match
each and every fancy piece of software in the wild. Any feedback and
suggestions are highly appreciated.
Truth Table Design
This one uses the same top level file as the equation based
design. Instead of the logic equation,the ROM table wrapper hierarchy
from src/pla_c64-rom.vhd is instantiated in this case. The truth
table is supplied by a separate file in rom/rom_c64.vhd which
basically contains a huge case statement for this purpose. The
released file was generated from C64.BIN [2] with
the command
hex2rom -b C64.BIN rom_c64 16b8a >
rom_c64.vhd
A Quartus II project is available in syn/pla_c64_mj_equ. Truth
tables for other commodore PLAs are available from [2],
so it should be possible to replace these with the generic design as
well.
Version 1.0 of the design and programming files can be downloaded
here: pla_c64_28dil_1_0.zip
Parts
of the designs are copyright 2009, Arnim Läuger.
Credits go to
the creators of the equations according to [3].
Please note:
THE
DESIGNS ARE PROVIDED AS THEY ARE. THERE IS NO WARRANTY HOWSOEVER THAT
THEY WILL WORK WHEN PLUGGED INTO YOUR SPECIFIC PCB. YOU ARE SOLELY
RESPONSIBLE FOR ANY HARM OR DAMAGE THEY INDUCE WHEN PUT INTO
OPERATION.
References:
[1]
http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/c64/
[2]
http://vic20.de/html/eprom_pla_8296_und_c64.html
[3]
http://www.zimmers.net/cbmpics/cbm/c64/pla.txt
Arnim Läuger
<arnim.laeuger at gmx.net>