Files
retroSoC/publications/datasheets/sections/architecture.typ
T
maksyuki 0e36b6a82f feat: introduce RV64 support and related tooling for HP workloads
- Added build_hp_rtthread.py for building the RT-Thread kernel with RV64 support.
- Updated build_hp_smoke.py to target RV64 architecture and modified output filenames.
- Modified generate_vexiiriscv.py to reflect RV64 configuration and memory management.
- Created hp_tools.py for shared utilities related to RV64 builds.
- Enhanced package_hp_boot.py to package RV64 workloads and updated versioning.
- Implemented run_hp_sim.py for executing and validating HP workloads with specific markers.
- Developed setup_hp_rtthread.py for installing RT-Thread source and environment setup.
- Updated GenerateRetroSocHp.scala to generate RV64 application cores.
- Enhanced tests for HP boot bundles, platform specifications, and tool utilities to accommodate RV64 changes.
- Adjusted test cases to validate new workload types and ensure compatibility with RV64 architecture.
2026-09-26 15:47:26 +08:00

173 lines
9.3 KiB
Typst

#import "../style.typ": *
#import "../figures.typ": *
#import "../waveforms.typ": timing
#import "../diagram-packages.typ": memory-window-diagram
#import "../soc-architecture.typ": soc-functional-diagram
= System Architecture
#change-start("dev-architecture","Nine-master fabric, address map, LP IRQ and lifecycle reference")
== Introduction
=== SoC Architecture
Mini PRODUCT contains two fixed harts, an LP-owned control plane, a native HP data fabric and
two APB4 register islands. There is no hardware cache coherency. Software transfers shared
buffer ownership explicitly and performs the required fences and cache maintenance.
#figure(soc-functional-diagram(), caption:[Mini PRODUCT functional architecture and clock domains.])<soc-functional-overview>
=== Management Processor
==== Hazard3
Hazard3 is hart 0 and the root-management processor. The reference profile selects RV32IM
firmware. Its AHB-Lite interface is adapted to AXI32 for control access; memory transactions
are directed through the LP gateway to the shared data plane. The management JTAG path provides
halt, resume, register and system-bus access. LP retains control while HP is held in reset.
#source-note("docs/hazard3-debug.md", title:"Management debug transport and acceptance flow")
=== Application Processor
==== VexiiRiscv
The generated HP hart is a dual-issue RV64IMAFDC + Zicbom configuration, with supervisor/user
modes, Sv39 virtual memory and 64-byte cache-maintenance blocks. Hart 1 uses native AXI64
instruction and data paths. Its uncached MMIO path is downsized and crosses into the LP
control plane. OpenSBI/Linux inputs and generated-core configuration are dependency-locked.
#source-note("docs/lp-hp-architecture.md", title:"LP/HP architecture and boot contract")
#include "processor-details.typ"
== Interconnect
=== AXI4 and APB4 Interfaces
The product replaces the former NMI/AXI4-Lite/APB3 organization with AXI4 control and data
paths and APB4 register targets. The compatibility RIBP boundary for selected MPW cores is
described in @mpw. It is not the PRODUCT data fabric.
The LP control fabric uses 32-bit data. APB accesses cross LP to PCLK through asynchronous
request/response bridges. The HP data plane uses 64-bit data, 32-bit addresses and seven-bit
global transaction IDs. Adapters preserve byte lanes and response attribution across width
and clock boundaries. HP MMIO cannot write root-owned SYSCTRL/RCU, watchdog, GPIO administration
and other protected management controls.
#change-start("system-fabric", "PRODUCT control and memory circuit paths")
#figure(fabric-diagram(), caption:[PRODUCT control and memory paths. Gateway adaptation and CDC separate the functional clock domains.])<fabric-diagram>
#change-end("system-fabric")
=== Common Bus Protocols <common-protocols>
The following WaveDrom examples define the handshake notation used by the IP chapters.
They show valid protocol ordering, not guaranteed transaction latency. Address windows,
byte strobes, burst limits, access permissions and IP-specific side effects remain binding.
#timing("apb4",[APB4 setup, access and wait-state example.])
#timing("axi4",[AXI4 read-address and response-channel example.])
#timing("axis",[AXI4-Stream backpressure and end-of-transfer example.])
=== Interconnect Matrix
The #data.policies.len() initiator identities access #data.targets.len() memory targets. The crossbar arbitrates reads and
writes separately for each target. I/O gateway A combines USB2, SDIO0 and the APU private
master; gateway B combines SDIO1 and SPI-SD. JPEG occupies slot 6 and GA2D slot 8; EXT-H uses slot 7.
#note[The matrix on the next page is generated from the RTL access policy. R/W permission is
subject to active memory-pad mode, resource ownership, target readiness and EXT-H address bounds.
An allowed entry does not guarantee throughput.]
#pagebreak()
#figure(matrix-diagram(), caption:[AXI64 memory access matrix: R = read, W = write, - = denied.])<bus-matrix>
The I-cache is the only instruction-permitted initiator. HP cache attributes are preserved;
DMA, I/O gateways, LP gateway, JPEG, EXT-H and GA2D require non-cacheable transactions. XPI is read-only
on this data plane; indirect writes use its APB-controlled command engine.
Denied accesses return a finite error response with source attribution. EXT-H has additional
read/write address bounds. SRAM and SDRAM use multiple outstanding credits; serial targets
have more restricted concurrency. Software must not assume coherency or treat theoretical bus
width multiplied by clock rate as measured application bandwidth.
#source-note("rtl/mini/integration/soc_topology.json", title:"Generated matrix source: data_master_policies")
#pagebreak()
#include "bus-programming.typ"
=== Address Mapping
All ranges below are inclusive. The SRAM range is resolved using the reference profile's
32 KiB setting. Peripheral windows are address allocations; not every offset implements a
register. Detailed contracts define valid offsets and access modes. Reserved regions do not
advertise an implemented IP.
#ds-table("memory", [Memory and reserved data apertures],
([Window], [Base], [End], [Size]),
data.regions.filter(r=>r.route in ("axi4","ram","reserved") and r.size > 4096).map(r=>(
code(r.symbol),code(r.base_hex),code(r.end_hex),r.size_label)),
widths:(1fr,1.1fr,1.1fr,0.65fr),
notes:[FLASH is the reset/boot alias. SPISD's former card-data aperture is reserved. The physical
capacity of fitted XPI/OPI devices remains board-dependent.],
)
#ds-table("registers", [Register and interrupt-controller windows],
([Window], [Base], [Size], [Integration]),
data.regions.filter(r=>not(r.route in ("axi4","ram","reserved") and r.size > 4096)).map(r=>(
code(r.symbol),code(r.base_hex),r.size_label,r.availability)),
widths:(1.3fr,1fr,0.6fr,1.35fr),
)
<reserved>
GA2D occupies the active 4 KiB APB4 window at 0x10012000. The former SPI-SD data aperture
remains reserved. PRODUCT keeps a compatibility responder at the former selectable user-IP
window; it does not instantiate MPW user IPs there.
#block(breakable:false)[
#figure(memory-window-diagram(),kind:image,supplement:[Figure],caption:[Selected PRODUCT memory address windows in the reference configuration.])<memory-window-layout>
]
#pagebreak()
#include "memory-use.typ"
== Clock and Reset
=== Architecture
The RCU compatibility wrapper contains the product clock/reset subsystem. AON uses REF24;
LP resets to REF24 and HP resets to the external 72 MHz safe source. The reference profile
disables the PLL. Generic PLL selectors model 72-240 MHz in 24 MHz steps; these are digital
integration choices, not qualified silicon speed grades.
#change-start("system-clocks", "System clock and reset circuit organization")
#figure(clock-diagram(), caption:[Clock-domain organization and reset defaults. Frequencies shown are configuration values.])<clock-diagram>
#change-end("system-clocks")
The memory root is the stable external 72 MHz clock divided by two. Audio, DVP pixel, ULPI and
JTAG have independent clocks. The inventory below lists domains without presenting synthesis
constraint periods as measured operating limits.
#ds-table("domains", [Canonical clock/reset-domain inventory],
([Domain], [Clock signal], [Reset signal]),
data.clocks.map(d=>(d.name,code(d.clock),code(d.reset))),widths:(0.6fr,1.45fr,1.45fr),
)
=== Reset and Logic
Clock changes validate the request, block new traffic, quiesce and drain accepted work, park
LP, select the safe source, apply and qualify the PLL setting, then restore the requested
roots. Timeout or lock loss returns to the safe source and retains fault status. Reset
release uses per-domain synchronizers; coordinated warm flushes prevent stale transactions
from re-entering a restarted domain.
#source-note("docs/pll-clock-control.md", title:"Clock transition, fault and PLL control contract")
#tbd[PLL jitter, PVT range, clock-tree closure and pad-level reset timing require physical
qualification. No crystal-oscillator range or maximum core frequency is specified here.]
#include "operating-states.typ"
#include "reset-summary.typ"
#include "clock-programming.typ"
== Interrupt System
The management interrupt vector is 64 bits wide; two local causes and 62 external positions
are distinct from the currently allocated source list. The following numbers are
LP vector bits, not HP PLIC source IDs. Peripheral-level status registers identify causes
within an aggregate source. Resource-controlled interrupts are routed according to ownership.
#ds-table("lp-irqs", [LP interrupt vector],
([LP bit], [Source], [Description]),
data.interrupts.map(i=>(str(i.core_bit),code(i.name),i.description)),
widths:(0.45fr,1.25fr,2fr),
)
HP has local software/timer interrupts and a 32-source, two-context PLIC. Source 0 is
reserved; sources 1-11 are UART1, mailbox, EXT-H, DMA, USB2, SDIO0, SDIO1, SPI-SD, JPEG, APU
and GA2D. Sources 12-31 are reserved. GA2D uses LP vector bit 32 (external ordinal 30),
which is distinct from HP PLIC source 11. The contexts drive machine and supervisor external interrupts.
Claim/complete and priority rules are defined in the HP platform contract.
#block(above:rhythm.metadata-before,below:rhythm.metadata-after,breakable:false)[
#set text(size:9pt)
#source("docs/ip/hp-platform.md",title:"HP PLIC, local interrupts and mailbox") · LP software: @irq-runtime
]
#include "system-management.typ"
#include "register-programming.typ"
#include "interface-subsets.typ"
#change-end("dev-architecture")