Expand description
The system around the hart on Board B, defined once: the physical memory map, the device registers, how the
128 MB of DDR2 is laid out for the firmware, and the flash image the boot ROM loads. The hart model reads the map
as its physical memory attributes, the RTL takes it as parameters (verilog_defines), and the boot ROM and the
shim compile against the C header this module writes (c_header) — so no address is ever written twice.
Structs§
- Board
- The whole board: the hart at its reset vector over the devices.
- Devices
- The board’s devices, as the model of the system around the hart: memory, the flash behind the streaming port,
and every register in
REGSwith the behaviour its line documents. The RTL SoC is held to these. The bus completes every access the memory map permits (memory_map): a device address no register holds reads as zero and ignores writes. - Reg
- A device register: its name in the C header and its address.
Enums§
- Stopped
- How a run of the board ended.
Constants§
- BOOT_
WORK_ BASE - The boot ROM’s working tables (the inflater’s), in the mapping region: nothing uses it before the compiler runs, and the shim zeroes every page it hands out there.
- BUTTONS
- CONSTANTS
- Every constant the firmware compiles against, by its C name.
- DDR
- FIRMWARE_
BASE - FLASH_
SIZE - The flash: the bitstream at 0, the boot image here.
- HART_
HWCAP - The extensions the compiler sees, as Linux reports them in
AT_HWCAP(a bit per extension letter): the hart’s I, M, A and C, and the F and D the shim provides — exactly whatqemu-riscv64reports for the same binary. - HART_HZ
- The hart’s clock: the DDR2 controller’s divided clock, which the hart shares.
- IMAGE_
HEADER_ SIZE - IMAGE_
MAGIC - The boot image’s header:
IMAGE_MAGIC, a version and the header’s size, the RTL fingerprint it was built for, the body’s inflated and compressed lengths, and the sha256 of the compressed body. - IMAGE_
OFFSET - IMAGE_
VERSION - IO_BASE
- Device registers.
- IO_SIZE
- LINK
- MMAP_
BASE - MMAP_
SIZE - QSPI
- RAM_
BASE - The DDR2.
- RAM_
SIZE - REGS
- Every device register.
- RESET_
PC - ROM_
BASE - The boot ROM: the hart’s reset vector. Address 0 stays unmapped, so a null pointer faults.
- ROM_
SIZE - SECTION_
ARGS - SECTION_
BUNDLE - SECTION_
FIRMWARE - SECTION_
SHIM - A section of the boot image’s body.
- SHIM_
BASE - How the DDR2 is laid out once the shim runs: the shim itself, the firmware’s image and heap, the region its anonymous mappings come from, the boot image’s staging area, and the firmware’s stack.
- SHIM_
SIZE - SOC_ID
SYS_ID: “LOGOSHRT” read as a little-endian word.- SOC_
RESET_ KEY - The value
SYS_RESETtakes to restart the board. - SRAM_
BASE - Scratch RAM in block RAM: the boot ROM’s stack and data before the DDR2 is calibrated. It never holds code.
- SRAM_
SIZE - STACK_
BASE - STACK_
SIZE - STAGING_
BASE - STAGING_
SIZE - SYS
- UART
Functions§
- c_
header - The C header the boot ROM and the shim compile against.
- memory_
map - The physical memory map the hart enforces.
- verilog_
defines - The RTL’s view of the same map, as
defines the SoC’s Verilog includes (once, however many files include it).