Run the CPU at 100 MHz

The FPU picks the FADD/FSUB operands and works out exponents and leading
zeros as it takes them, and finds the back end's leading one a clock
before using it; those were the paths that held the design to 91 MHz.
Add, multiply and the multiply-adds now take 13 clocks, divide and
square root 37, int -> float 9. Setup slack at 100 MHz is +0.286 ns.
On the board: an empty FOR loop 6.4 us (was 8.3), SIN 33 us (was 37).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-12-01 07:26:59 -08:00
1 parent bda9bb67b6
commit 2dafda5fe5
14 files changed
+78 -51

No files matched your search

+8 -7
View File
@@ -796,19 +796,20 @@ each voice, so a note or a bang fades away by itself.
### Speed
The processor is a 32-bit RISC-V (RV32IMF: the base instructions, multiply
and divide, and single-precision floating point) running at 90 MHz. Most
and divide, and single-precision floating point) running at 100 MHz. Most
instructions take 2 clocks; loads, stores, jumps and taken branches 3, a
multiply 4 and a divide 35, which comes to about 2.5 clocks per instruction in
BASIC, some 36 million instructions a second. Its floating-point unit adds,
subtracts and multiplies in 12 clocks and divides or takes a square root in 36,
BASIC, some 40 million instructions a second. Its floating-point unit adds,
subtracts and multiplies in 13 clocks and divides or takes a square root in 37,
correctly rounded. In round numbers:
| Operation | Time |
|---|---|
| One pass of an empty `FOR … NEXT` loop | 8 µs (about 120,000 a second) |
| `X = I * 1.5` | 26 µs |
| `Y = SIN(X)` | 37 µs |
| `LINE` right across the screen | 0.2 ms |
| One pass of an empty `FOR … NEXT` loop | 6.4 µs (about 150,000 a second) |
| `X = I * 1.5` | 23 µs |
| `Y = SIN(X)` | 33 µs |
| `Y = EXP(1)` | 33 µs |
| `LINE` right across the screen | 0.12 ms |
Constants in a program are converted from text every time they are used, so a
loop runs a little faster if a constant used inside it is put into a variable