I'm still working on this, guys! I just soldered it back together about two weeks ago and I'm trying it on a different FPGA board.
Unfortunately, this board still doesn't have SRAM on it, so I'm attempting to use the SDRAM.
I'm waiting for a seller in China to get back to me about a board with SRAM on it (doesn't seem worth the effort trying to debug this SDRAM crap).
The boards are quite cheap £26 - £45 depending on if you want SRAM only or SRAM + SDRAM + better chip.
The idea is to buy a cheap board specifically for the DC so I'm not tempted to steal it again (I'm gonna BOLT it to the metal shield next time!).
I can't get this board to boot the DC to the Sega logo like it did with the CF Card version. (I'm currently using SD Card instead).
As far as I can tell, it's reading the SD Card OK, but maybe not the SDRAM. It reads the TOC fine and appears to pass the security check, then attempts to read IP.BIN as usual, but no further?
It goes back to the DC Menu with the old "Please wait while disc is being checked", so the data is probably corrupted.
It tries to do a SET_MODE command after that, then just sits there?
I did manage to make the code a bit more generic though - the "gd_emu" part is separate from the control part.
This should in theory make things a bit easier to manage.
The "gd_emu" part does the main interface and parses the Packet commands etc. The "gd_emu" block supplies these values...
gd_sector_type, gd_start_sector, gd_sector_count, then asserts the trig_block_read signals.
In your "control" block, you then need to read the requested sector(s) from your SD / CF / HDD into a buffer, then transfer the sector(s) to the DC via DMA.
When the DMA transfer is complete, the control block asserts the "block_dma_done" signal and the "gd_emu" block handles the rest of the interrupt crap etc.
DMA sounds scary, but it's actually quite simple. The problem is, once you tell the DC that your sectors are prepared, it expects to read the data in a continuous burst at around 16.66 MBytes/sec!
I'm still fairly confident that the main chunk of gd_emu code is working, but using SDRAM is far more complex than SRAM because SDRAM needs to pause during refreshing etc.
This screws up the nice flow of data.
I've added a FIFO to the SDRAM, but it's still not booting? I don't have an easy way of way confirming that the data matches the original ISO file other than capturing small sections of data with Signaltap...
http://tinypic.com/view.php?pic=mt2iq&s=6
As you can imagine, this is a long-winded way of debugging because I have to reboot the DC every time I need to capture another section of signals.
There is an FT245 USB chip on this board, but it's nowhere near fast enough to stream the data to the DC in real time (max 1MByte/sec).
Again, this could be made to work with SRAM. I'm tired of trying to use SDRAM now, so I'm about to buy that new SRAM board from China.
@cybdyn - Your FPGA design is looking good. I can share my code so far if you like? I would DEFINITELY recommend adding an SRAM chip though, preferably 1MByte and minimum 512KB.
OzOnE.
P.S. Does anyone have a copy of the old FPGA project files which I uploaded in the other thread? I just need to confirm that the one I have matches because the link got removed?
The version I uploaded was the only one capable of booting to the Sega logo! If I had to guess, the filename was probably "GD-EMU Project (26-1-12 OzOnE).zip", or at least starts with "GD-EMU".