Dave [hoglet] and I are pleased to announce the successful enhancement of Arlet's (small, fast) 6502 core to include all the normal 65C02 operations:
Quote:
additional 65C02 instructions and addressing modes:
- PHX, PHY, PLX, PLY
- BRA
- INC A, DEC A
- (zp) addressing mode
- STZ
- BIT zpx, absx, imm
- TSB/TRB
- JMP (,X)
- NOPs (optional)
- 65C02 BCD N/Z flags (optional, disabled)
The Rockwell/WDC specific instructions (RMB/SMB/BBR/BBS/WAI/STP) are not currently implemented
The 65C02 core passes Klaus Dormann's 6502 test suite, and also passes the 65C02 test suite if the optional support for NOPs and 65C02 BCD flags is enabled.
It has been tested as a BBC Micro "Matchbox" 65C02 Co Processor, in a XC6SLX9-2 FPGA, running at 80MHz using 64KB of internel block RAM. It
just meets timing at 80MHz in this environment. It successfully runs BBC Basic IV and Tube Elite.
It's not a lot bigger - about 10% - and not any slower - about 80MHz in our tests. But note that speed depends on which FPGA you choose and how you drive the tools, and what other bits you have in the design in addition to the CPU.
Here's the source:
https://github.com/hoglet67/verilog-6502For compatibility the original core is still found in cpu.v and the new core is cpu_65c02.v
It was particularly satisfying, and a testament to Arlet's original implementation, that we were able to make successive simple changes to implement each type of new instruction incrementally. Although it looked like we might, it turned out we didn't even need to change the ALU.
(It's probably worth noting that there other HDL implementations of 65C02 - see the Homebuilt Projects section of the site, at
http://6502.org/homebuilt#HDLT65
cpu65c02_true_cycle
M65C02
R65C02
)