tcdev
24th September 2009, 06:34 AM
I've resurrected the 1541 emulation again.
Some background. The c1541 logic - processor, memory etc - is implemented in the c1541_logic module. This module can then be used two different ways:
1. using the diskif module, it translates the drive signals from the core into track, sector, offset etc which is useful for hooking directly to a random access device (eg. memory).
2. using the c1541_core_fifo module, it adds a fifo to the data path and exports the drive signals such as wps, step etc. This allows a (read-only) media emulation to simply push data into the FIFO.
I had #2 "sort-of" working with an internal NIOS-II processor reading data from SD card. I say "sort-of" because it was quite flaky and I was never sure where the problem lay.
A while back, Arnim Läuger took my "sort of working" core and managed to get reads and writes working via the "diskif" (1.) module. He tweaked the diskif module to basically make it work. I haven't had a suitable platform to test his changes, although I integrated them back into the PACE source tree.
And back to the present:
I wanted to get the FIFO core (2) running again, on a platform with a suitably high-speed off-board processor for emulating the disk media. I hooked it all up into the new "custom_io" framework and - presto - it all appears to work correctly. At least, good enough to run some games!
I can only surmise that the previous NIOS-II/SD combination was too slow and couldn't meet the data timing required by the 1541 - because I haven't changed anything in the HDL or the software running on the media emulation!?!
The software part is a real mess, but the FIFO interface is quite clean and with sufficiently grunty on/off-chip support for the media emulation, it would be a perfectly workable (read-only) solution.
Some background. The c1541 logic - processor, memory etc - is implemented in the c1541_logic module. This module can then be used two different ways:
1. using the diskif module, it translates the drive signals from the core into track, sector, offset etc which is useful for hooking directly to a random access device (eg. memory).
2. using the c1541_core_fifo module, it adds a fifo to the data path and exports the drive signals such as wps, step etc. This allows a (read-only) media emulation to simply push data into the FIFO.
I had #2 "sort-of" working with an internal NIOS-II processor reading data from SD card. I say "sort-of" because it was quite flaky and I was never sure where the problem lay.
A while back, Arnim Läuger took my "sort of working" core and managed to get reads and writes working via the "diskif" (1.) module. He tweaked the diskif module to basically make it work. I haven't had a suitable platform to test his changes, although I integrated them back into the PACE source tree.
And back to the present:
I wanted to get the FIFO core (2) running again, on a platform with a suitably high-speed off-board processor for emulating the disk media. I hooked it all up into the new "custom_io" framework and - presto - it all appears to work correctly. At least, good enough to run some games!
I can only surmise that the previous NIOS-II/SD combination was too slow and couldn't meet the data timing required by the 1541 - because I haven't changed anything in the HDL or the software running on the media emulation!?!
The software part is a real mess, but the FIFO interface is quite clean and with sufficiently grunty on/off-chip support for the media emulation, it would be a perfectly workable (read-only) solution.