Hi everybody,
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
. There are latches I need to get rid of. The character ROM comes from M. Rictor
, I took it from
here, and subsequently adapted it for use with my VGA controller module.
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:
.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
Nothing spectacular (there are tons of ways even just to improve that code, even if jut by adding labels for the vectors...), just a quick way to test the hardware. I plan on implementing some more complete tests/software later on.
Here is a report from the ISE on resource usage:
The actual output on a monitor is as such:
Sorry for the terrible quality, I'm using my phone at the moment, since I can't find my camera charger...
On a side note, I'd like to thank the members of this forum for the many discussions I have read and that inspired me to make this... I've been following this forum a long time, but have been more of a silent type here because my schedule is often filled, and when I wanted to start making microprocessor systems, I was motivated but lacked the knowledge... after some 5 years of university level education, things tend to make more sense... So many thanks!
EDIT: Added ISE Report and board used.