A little more speed from the 6502
imapenguin.com
imapenguin.com
lda #firstbyte
sta dest+0
lda #secondbyte
sta dest+1
etc.
6 cycles per byte, so 166KB/sec. But we can do better: there are only 256 different bytes, so group the stores by byte value so that you don't have to reload before each one: lda #0
sta dest+10 ; All the places that get 0
sta dest+29
sta dest+42
lda #1
sta dest+3 ; All the places that get 1
sta dest+82
etc.
Up to 250 KB/sec and less space. If the prior data in dest is known, it could be even faster: skip stores where the destination already has the correct data. And even faster: for video, skip stores which have a low hamming distance from the prior bytes and put up with a bit of noise..Also FYI, that 6 cycles to load/store each byte is only if you're writing to zero page (an 8-bit address, meaning the first 256 bytes of the address space.) Stores to a 16-bit address take one more cycle, 4 instead of 3, to read the operand when it's a two-byte address instead of one.
Is anyone here an EE, who has access to original circuit design, knows how to translate to vhdl, verilog, or what have you, and also just happen to have the money lying around to have TSMC tape out the design so we can find out? :D
Here’s a “100 MHz 6502”: http://www.e-basteln.de/computing/65f02/65f02/
The more interesting thing I think is that the existence of this official IP core implies that it is already out in production in millions of components, like the Tamagotchi[1] and Furby[2], presumably running at a very diverse array of clock frequencies. I wonder which product has the fastest WDC 6502?
[1] https://hackaday.com/2013/05/24/tamagotchi-rom-dump-and-reve...
[2] https://official-furby.fandom.com/wiki/Furby_(1998)/Technica...
Obviously execution was slow, but it was a great exercise to show the class just how simple the 6502 was.
A little cyber stalking shows that he sold his house in 2017: https://www.youtube.com/watch?v=inCBLQJja2U
While thinking about him and the course, I remembered my final exam in that class, which I nearly failed. I had mastered the material maybe a little too well. The assignment was to program our KIM-1 (https://en.wikipedia.org/wiki/KIM-1) to drive a speaker with a 1KHz square wave on a PIO port (bit 0) when a switch was closed between ground and the same PIO bit 1. So obviously you had to set up the data direction register of the PIO with bit 0 as output and bit 1 as input, and have a loop that would toggle the bit 0 output every 500us if the PIO bit 1 input was at logic-0. Even back then, I liked to optimize my code, and the instructor did not give us detailed requirements about the state of PIO output bit 0 when PIO input bit 1 was logic-1, other than to say that the tone would not be present. So instead of reading PIO bit 1 in the loop and performing a compare to branch one way or the other, I simply inverted PIO input bit 1 and stored it into the data direction register for PIO bit 0 on every loop iteration. Thus the tone would be present when bit 1 was at ground, but not present otherwise (because bit 0 had been defined as an input rather than a output, and was in a high impedance state). The instructor looked at my code and gave me a "F". I had to confront him after the class and he grudgingly changed my final grade to a "C".
You could hypothetically make a 6502 with a wider or dual bus, so that it could read or write more than one byte per cycle or both at the same time, if whatever else is on the bus on the other ends of the reads/writes is compatible with that. In that way you could speed up executing 6502 instructions by more than just increasing clock speed.
You could also do pipelining and parallel/out-of-order execution like modern processors, if you weren't worried about retaining cycle-for-cycle compatibility. You could even build it with a wider bus, so that you could read all of a 2/3/4 byte instruction in one cycle. Although at that point it's really semantics as whether you call it a 6502 or a new processor with binary compatibility.
I think this could work, although if that means the ram is on die, setting up the memory map is much more complex (although maybe you just have a chip select pin for the on-die ram, and have your address decoder circuitry select it when appropriate for your system)
> You could also do pipelining and parallel/out-of-order execution like modern processors
I don't think that fits the prompt of same fundamental design though.
This is where the Z80 would come in handy with its separate 16-bit IO address space (accessed through special IO instructions and on the hardware level an IORQ output pin). The Z80 can also easily handle slow memory and IO devices through its WAIT input pin (but of course this just causes the CPU to slow down to the speed of the memory or IO device).
You can get a 100Mhz FPGA based 6502. http://www.e-basteln.de/computing/65f02/65f02/
Since FPGAs are significantly slower than ASICs, it seems like a 1Ghz 6502 wouldn't be unreasonable. The problem is, what would you do with it? The CPU would be severely bottlenecked by its peripheral interfaces.
https://3.14.by/en/read/arduino-liquid-nitrogen-overclocking