Repository navigation
Implementation
The initial proposal for the RevX4KS is to utilise the very capable AMD Spartan-6 FPGA, not the latest in the range but the last option to utilise LFQP packaging which makes hand assembly viable. The newer Spartan-7 uses BGA style packaging which requires more expensive board fabrication and is far from simple to assemble by hand.
The Spartan-6 provides sufficient IO for the purposes of the SAMx64 requirements and operates at a high enough base clock that it has no problem meeting the latency requirements of running at a mere 4MHz (or thereabouts). The price point for the Spartan-6 in small quantities is slightly higher than the newer chips but still falls within a reasonable budget given the advantages it brings.
Another point in favour of the AMD chip is that the OEM development stack (Vivado IDE) is available without a license and comes with a range of tools to verify the implementation.
The biggest hurdle for development is actually the PCB design and making sure the implementation is correct without extended rounds of fabrication and testing. There is also a further potential complication of pin assignment that could render an otherwise viable physical implementation unusable.
The alternative to designing a main board to carry the chip is to use a custom or ready made plugin. This reduces the cost of fabrication (based on physical board dimensions) and means the main board only needs to match the pin out of a carrier mezzanine board.
QMTech sell a ready-to-use board that contains the Spartan-6's younger and more capable sibling, the Artix-7. This does not bring any extra IO but does offer some new opportunities. The first of these is dual port RAM blocks of a useful size - a mix of 18KB and 36KB. The RAM blocks are implemented internally to the FPGA and are very high performance. There is not sufficient capacity in a block to map the entire 4MB address space but each block is large enough to hold the 64KB that the CPU can address, this means RAM and ROM can be cached internally irrespective of external storage. This also means that the MMU memory page map can be completely internal and removes the need to use a RAM access slice for that purpose, opening up the chance to run the advanced video solution at quad speed, offering four times the memory bandwidth per pixel! This of course comes at a cost - a single screen of memory at regular resolutions would extend to 24KB, nearly half the address space (not so terrible once paging is considered and the larger video address space proposed). If the high resolution option of 320x200 is used the screen memory extends to 32KB, assuming that is a bitmap page and not tiled.
An interesting advantage to the QMTech board is that it also contains a large 32MB block of SDRAM, many times the planned capacity required. This could be used directly but given the performance of the internal RAM blocks it would make sense to cache RAM but this potentially brings a new set of problems to overcome. The way the chip is organised should help however. The chip is organised into 4M word banks, with a word being 16bits. There are then 4 banks. In practical terms this means only a single bank needs to be selected and only the lower byte of each word needs to be used (what the upper byte is used for or if it is just ignored is subject to further thinking). The chip operates at 166MHz (the FPGA has an internal clock of just 100MHz), this should be fast enough that there is no apparent latency on a single read/write anyway but the cache option is available.
Even with the high performance flash ROM specified the access times are still relatively slow and potentially a sticking point, in this instance caching of ROM pages makes for a smoother level of performance (rather than potentially having to stretch clock cycles when accessing a ROM page). When it comes to flashing new pages to the ROM the situation is likely to be different, this almost certainly requires the CPU to be halted for the duration but should not need to block the video activity which is effectively a separate data bus and with the dual port ram there should be no issue even if the page in question is used for both video and for a rom image. The same cannot be done for the CPU without some rearchitecting of the board since the ROM and CPU sit on the same bus and there is insufficient IO available to provide three data buses
With the dual port ram in the FPGA it becomes possible to separate the video clock from the cpu clock. This adds complexity to the solution (the Artix-7 itself should not be the limiting factor) but does mean the CPU could run at higher clock speeds, really limited by the CPU silicon. The 63C09 is officially rated at 3MHz but can, allegedly, run at speeds of 5MHz (or more) but this is likely to be a bit of a silicon lottery and is also likely to shorten the life of the CPU itself.
The Artix-7 also happens to be the same FPGA used in the Spectrum Next and is quite capable of implementing a synthetic CPU core in addition to the SAM (and can manage the video too), this goes against the ethos of the board design, that original, period hardware is used where possible but if ultimate speed is desired this is a tempting option and a cycle accurate implementation of the MC6809E is already available in the required format. The next option is an emulated CPU core, using a Raspberry Pi Zero 2 or Pi 3. This already exists for the BBC B Tube emulator so a large part of the work is already done. The down side is that this is emulation and that can further disrupt any sensitive timing, the counterpoint is that you are already running many times faster than even the fastest Motorola or Hitachi CPU could manage.
Dragon Rev X4 and Rev X4 (ATX) Kitchen Sink Edition