Skip to content

Calibrate the Cortex-A72's memory path to the Raspberry Pi 4 - #374

Merged
willmccallion merged 2 commits into
mainfrom
system/bus-clock
Nov 25, 2026
Merged

willmccallion merged 2 commits into
mainfrom
system/bus-clock

Conversation

@willmccallion

@willmccallion willmccallion commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Moves the Cortex-A72 calibration onto LPDDR4 (#373) behind a model of the A72's system port, closing the bandwidth gap in #370.

Clock the system bus and let it have AXI's channels

  • bus_clock_divider: core cycles per bus beat, so a bus is a width at its own clock. The A72's 128-bit port runs at 1:1 or N:1 of the core clock (TRM 7.7).
  • bus_channels selects the channel organisation:
    • RequestResponse, the default and the previous model: one channel out carrying an address and any write data, one back carrying read data or an acknowledgement, as TileLink and gem5's crossbar do.
    • Axi: AXI's five channels, so reads and writes queue only behind their own kind.
  • AXI as the default pushed ten gem5 and BOOM/Rocket comparisons over budget, because those systems really do share a channel each way. The default therefore keeps the old model, and make accuracy reports every program's error unchanged.
  • Tests: unit tests of each organisation's queuing and of the clock divider, plus Python field tests.

Calibrate the Cortex-A72's memory path to the Raspberry Pi 4

  • MemoryController.Lpddr4(density="Gb16"): two 16-bit channels of 16 Gb dies, from Micron's datasheets.
  • bus_width=16 and bus_channels="Axi" from the TRM.
  • bus_clock_divider=8 is fitted to the Pi's C fill. Every tinymembench fill on the Pi, NEON and non-temporal stores included, stops near 3 GB/s, a quarter of the memory's peak, so the limit is the port.
  • bus_latency=5 is fitted to the Pi's 16 MB chase.
Cortex-A72 Before Now Raspberry Pi 4 Fitted?
C fill, 32 MB 5,383 MB/s 3,000 2,883 yes
C copy, 32 MB 1,575 MB/s 2,261 2,253 no
16 MB chase, huge pages 206 205.2 cycles 203 yes
16 MB chase, 4 KB pages 219 222.2 cycles 233 no
CoreMark/MHz 5.05 5.09 5.50 no
DMIPS/MHz 3.86 3.87 3.77 no

Checked locally

  • Rust and Python suites, clippy, rustdoc, ruff, mypy and stubtest.
  • make accuracy: unchanged.
  • make lockstep-ci: 858/858.
  • riscv-tests on ref cortex-a72 and ref linux with 4 harts: 376/376.
  • Multicore smoke: 120/120.
  • A Linux boot and benchmarks on the A72 calibration.

The bus moved bus_width bytes every core cycle over one channel each way. bus_clock_divider now sets how many core cycles a beat takes, as the Cortex-A72's 128-bit port runs at an integer fraction of the core clock, and bus_channels chooses the organisation: RequestResponse, one channel out carrying an address and any write data and one back carrying read data or an acknowledgement, as TileLink and gem5's crossbar have and the bus had; or Axi, AXI's five channels, so reads and writes queue only behind their own kind.
Memory is the Pi's LPDDR4-3200 on the command-level controller, behind the A72's 128-bit AXI port (TRM 7.7). The port's clock fraction is unpublished and fitted to the Pi's C fill, one beat every 8 core cycles, and the bus crossing's latency to its 16 MB chase. C copy, fitted to neither, now runs at 2,261 MB/s against the Pi's 2,253.
@willmccallion
willmccallion merged commit 04a8a67 into main Nov 25, 2026
6 checks passed
@willmccallion
willmccallion deleted the system/bus-clock branch November 25, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant