Tinycpm – CP/M ON A TINY 2040
kianryan.co.uk
kianryan.co.uk
The RP2040 beats the Cray for sure in the MIPS/$ category though :)
The Cray M1 may have only been clocked at 80mhz but the FPU could do a floating point mult + add in parallel making the "160 MFLOPS". It's similar to the performance of an ESP32, I think, which is a great FLOPS/$ comparison. A Cray-1 adjusted for inflation would be $35,000,000. A ESP32-S3 dev board is $6.
1. More RAM than usual, using ext SPI Flash to load RAM 2. Fancy programmable peripherals 3. TWO cores 4. Very flexible IO mapping. Others do IO mapping, but it's really nice on 2040 5. "Pretty fast" at 133 MHz
and the Total Win (for me)
6. Integrated into Arduino IDE
As for Floating Point, there are some great packages out there that are optimized for Cortex-M https://www.quinapalus.com/qfplib-m0-tiny.html
There also Q-notation, which uses integer HW to do a sort-of fixed-point 'float'. We used this extensively in the 2016 Model X body controls, because the falcon wing door was totally controlled without a floating point processor! That was hard to do... https://en.wikipedia.org/wiki/Q_(number_format) Motorola, err, I mean, Freescale provided an excellent library for their automotive-qual PowerPC MPUs.
Compare it with an PC 1512.
However, in my experience, Zork starting up isn't actually proof of very much. I've had any number of CP/M installations go bad once I got a hundred or so moves into the game.
If he can complete Zork on the Tiny 2040, then great. But just starting it is only half the battle.
i routinely ran cp/m in 48k or 64k on a 4-megahertz z80, which is about 0.6 dhrystone mips, on one or two 100-kilobyte floppies, with transfer rates of about 1 kilobyte per second. i think cp/m will run in 16k
this arm is as fast as 250 of those machines, it has as much ram as four of them, as much offboard xip program memory as 64-256 of them, and 40000 sssd floppy disks worth of storage, which furthermore can probably transfer data at 10 megabytes per second, ten thousand times as fast as the floppy
also the z80 didn't have a pio programmable i/o pin driver, it had to handle i/o interactions itself instead of outsourcing them to a channel program in pioasm, which slowed down computation
yes, if you're emulating a z80 on arm that entails some emulation slowdown, but it certainly isn't 250x. it might be 8x. if you do dynamic machine code translation it might be less than 2x
instead of calling it 'tinycpm' he should call it 'giantcpm'
I thougbt it was interesting, and it has inspired me to try something similar on my pico. Especially after rereading Code recently.
Oh, and I assume that tinycpm is because it runs on a Tiny 2040.