Shenanigans afoot! As always, massive thanks to
@Bolle for posting the schematics and relevant info needed to clone this. Wouldn't have happened without that.
Interesting tidbits i've come up with: I can roughly confirm the acceptable clock range as per what
@GeekDot posted in the hacking thread.
The clock is incredibly fiddly to the point where I have some cases where the same type of GAL won't work. 15-47 of
theoretical delay (by various loops through GALs of various speeds) seems to roughly be the range. Around 30ns of delay also seems to be problematic. If someone else designs their own clone, be prepared to trial and error it.
Additionally, the less delay (while still being in operable range) improves the 68040's ability to access the 68030 bus: As the delay increases, bus performance (memory read/write) decreases. On the longer delay side @ 45mhz - ~113% SE/30 memory performance as measured by Snooper 2.0. On the fast side, 131% (@45). Norton system info gives more detail on this. I have not decided which I plan to keep and try to validate stability.
By comparison, 68030 accelerators Diimo and Powercache are approximately 2x faster at accessing main memory.
As the 68040 has sync bus cycles only I assume the logic to adapt the 68030 async cycles (used by main memory) has to insert wait cycles til the timing lines up just right, and by playing with the delay, it must shave a few cycle or two off sometimes as the clocks are not phase locked nor even multiples. With phase locked to the system clock (and frequency doubled), no CPUclk delay is required for maximum performance. At 31.33 mhz snooper saw 111% SE/30 performance. This decrease to 100% if there is a delay. Better performance than expected, for such a large decrease in clock speed.
My clone's cache section seems to be happy at 45mhz without any fuss. I did use faster rated SRAM and a few other minor tweaks, but this was a surprise to me.
Do not order 68040 from UTsource. They sent me a remarked original 0.8um 68040 that has very little hope of hitting 40mhz (not without cooking). Currently battling to get a refund, preferably without shipping the stupid thing overseas.
Atmel 17C65 works just fine for the FPGA PROM. Atmel was so kind as to post an AVR example of how to write a programmer, which I updated to work on any AVR-based Arduino (I'm lazy, sue me). I'll toss it on Github if anyone has interest.
Nice cheap heatsink that is a perfect size for a 68040. Bring your own thermal tape.