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

+7 -7
View File
@@ -3,7 +3,7 @@
A complete home computer on a Digilent Basys 3 FPGA board, built around a
RISC-V processor written from scratch in Verilog:
- **RV32IMF processor at 90 MHz**: integer, multiply/divide and IEEE 754
- **RV32IMF processor at 100 MHz**: integer, multiply/divide and IEEE 754
single-precision floating point in hardware, with traps, interrupts, hardware
breakpoints and single step.
- **VT220 terminal** with ANSI colour on 1280×1024 VGA: 132 × 64 text, or 80 × 32
@@ -119,8 +119,8 @@ store breakpoints, and a resumable NMI (after the Smrnmi extension: `mnepc`,
It is a multi-cycle design with the next instruction fetched while the current
one decodes: 2 clocks for most instructions, 3 for taken branches, jumps, loads
and stores, 4 for multiplies, 35 for divides; BASIC averages about 2.5.
Floating-point add, subtract, multiply and the fused multiply-adds take 12
clocks, divide and square root 36. It runs at 90 MHz and takes about 5,300
Floating-point add, subtract, multiply and the fused multiply-adds take 13
clocks, divide and square root 37. It runs at 100 MHz and takes about 5,300
LUTs (3,000 of them the FPU), 1,900 flip-flops and 6 DSP slices.
## The machine (`rtl/rv32_system.v`)
@@ -163,10 +163,10 @@ All in C (plus a little assembly), compiled with GCC:
| BASIC on the board | |
|---|---|
| `Y = SIN(X)` | 37 µs |
| `Y = EXP(X)` | 45 µs |
| `X = I * 1.5` | 26 µs |
| An empty `FOR` loop, each time round | 8.3 µs |
| `Y = SIN(X)` | 33 µs |
| `Y = EXP(1)` | 33 µs |
| `X = I * 1.5` | 23 µs |
| An empty `FOR` loop, each time round | 6.4 µs |
## Building