I haven't posted in a while, but I did decide to implement a 65C02 softcore (Jens Gutschmidt's cpu6502_tc) in an FPGA, along with VGA output in order to, in the longterm, have some fun with IDE hard drives.
For the moment, I have got the CPU and monochrome VGA output working, and will be working on getting the firmware (ROM) to be upgradeable via UART (as resynthesizing the whole project does take a bit of time...), and have PS/2 input in order to run a monitoring ROM of sorts. I do plan on having color VGA eventually, but my FPGA board's standard VGA output is limited to 8 colors (although more can be made with certain techniques). The VGA module is fixed at 640x480, and is of my own work (for a school project about 2 years ago). The VHDL code hooking all the modules together is dirty though, especially for address decoding
The board I am using is the Xilinx Spartan 3E Microblaze Development board (no longer in production unfortunately... link).
The current system is running at 25 MHz, although the RAM/VRAM and ROM are synchronous, so I'm running them at 50 MHz in order to get data out before the 65C02's inputs latch.
The system memory MAP is as follows for the moment:
00 - 24 KiB : Main RAM
24 - 32 KiB : Video RAM (Write Only)
32 - 64 KiB : ROM (with IRQ/NMI/RST vectors hard coded into ROM at the moment, even though NMI and IRQ are tied high...)
I am using the Kowalski Assembler/Simulator to produce code at the moment, which I integrate into Xilinx's ISE in a ROM file.
The code I have made to test the VGA at the moment is this:
Code: Select all
.ORG $8000
LDX #$00 ; Load 0 into X (init)
.begin:
LDA helloWorld,X ; absolute indexed.
CMP #$00 ; was the value 0?
BEQ .done ; done string copying
STA $6000,X ; store in video buffer...
INX ; next value
BRA .begin ; else loop
.done:
BRA .done ; let's just branch on ourself.
helloWorld:
.DB "Hello World. This is a very long line of text designed to test the VGA Output. I am a 65C02 running happily inside an FPGA. I am eating some electrons.",$00
.ORG $FFFA ; Vectors, LSB then MSB
.nmiVec:
.DB $00,$80
.rstVec:
.DB $00,$80
.irqVec:
.DB $00,$80
Here is a report from the ISE on resource usage:
6502.org wrote:
Image no longer available: http://jnicot.eu/ISEReport.png
Sorry for the terrible quality, I'm using my phone at the moment, since I can't find my camera charger...
6502.org wrote:
Image no longer available: http://jnicot.eu/soft65C02.jpg
EDIT: Added ISE Report and board used.