Back to Eliza

Memory map

packages/chip/docs/arch/memory-map.md

2.0.19.1 KB
Original Source

Memory map

All addresses are byte addresses. The e1 chip uses a single-cycle MMIO request interface. Only word-aligned accesses in the first 256 bytes of each 4 KiB region are implemented in the current RTL. Nonzero addr[11:8], unaligned accesses, and unknown regions return 0xDEAD_BEEF at the top-level decode.

RegionBaseSizePurpose
Boot ROM0x0000_00004 KiBReset/identity words
Peripheral control0x1000_00004 KiBID, scratch, GPIO, timer
DMA0x1001_00004 KiBDMA master contract model
NPU0x1002_00004 KiBSmall NPU datapath
Display0x1003_00004 KiBFramebuffer scanout controller
DRAM aperture0x8000_00004 KiBSRAM-backed test DRAM visible to debug MMIO and DMA

Linux-capable AXI-Lite scaffold map

The CPU/interconnect scaffold is separate from the e1-chip debug MMIO path. It uses AXI-Lite-style channels and establishes the future software contract. The e1-chip top now exposes a small debug-visible DRAM aperture for DMA integration, while the Linux-capable scaffold keeps its own AXI-Lite DRAM model:

RegionBaseSizePurpose
Interrupt controller0x0C00_00004 KiBPLIC-style source pending, enable, claim/complete scaffold
DMA control scaffold0x1001_00004 KiBAXI-Lite DMA control target; DMA master is arbitrated onto the DRAM model
DRAM aperture0x8000_0000256 MiBExternal DRAM controller/PHY boundary; current RTL model implements a small test memory

Unmapped AXI-Lite scaffold accesses return DECERR; reads also return 0xDEAD_BEEF.

The 256 MiB row is the software-visible aperture contract, not implemented capacity. The current SRAM-backed RTL model under that aperture implements only 4 KiB; accesses within 0x8000_0000 - 0x8FFF_FFFF but outside the 4 KiB model return DRAM-model SLVERR, not AXI-Lite decode DECERR. The tiny CPU execution test uses the DRAM aperture as instruction and data memory. The current DRAM model implements aligned 32-bit words with byte strobes; the CPU subset only generates aligned LW and SW.

The Linux-capable scaffold routes DMA master traffic only to the DRAM model. DMA access attempts outside the DRAM aperture must fail with a memory error and must not update MMIO targets. This is a local containment check, not an IOMMU or coherency implementation.

The map is also not a complete boot-memory map. The current reset ROM entry is the e1-chip identity ROM, and no boot SRAM region, ROM-to-SRAM copy contract, DRAM initialization sequence, or OpenSBI memory-discovery handoff is implemented in this map. Those rows must be added before Linux boot-memory readiness can be claimed.

Linux access-map dependencies

The scaffold map is not yet a complete Linux device memory map. Before a Linux/Android readiness claim, the memory map must explicitly reserve and test these dependencies:

DependencyRequired map contract
Reset ROMImmutable reset vector, executable ROM image or source, failure behavior, and handoff target.
Boot SRAMSRAM base/size, permissions, stack/temporary storage ownership, zeroization or lifetime policy, and DMA exclusion.
CLINT/ACLINTMachine timer and software interrupt window, CPU privilege access, DMA exclusion, and device-tree binding evidence.
PLIC/IMSICInterrupt-controller pending, enable, priority, threshold, claim/complete, CPU privilege access, DMA exclusion, and source-ID stability.
IOMMU/SMMUMMIO aperture, stream/client IDs, page table format, fault-status registers, interrupt source, and reset behavior.
DRAM/LPDDRReal target memory base, discovered size, reserved firmware/device regions, cacheability attributes, training status, and boot log evidence.
DMA-coherent regionsCoherent or non-coherent DMA buffer attributes, cache-maintenance requirements, and dma-buf/fence compatibility evidence.
QoS/performance countersPer-master bandwidth, latency, underflow, error, and fault counters if the production fabric exposes them.

Until those rows exist with executable evidence, CLINT/PLIC access map dependencies, page fault reporting, coherent DMA, IOMMU/SMMU, and DRAM bandwidth/latency remain blockers rather than implemented behavior.

Register conventions

All registers are 32-bit little-endian words. Writes to reserved registers are ignored. Reads from unmapped regions return 0xDEAD_BEEF.

Peripheral registers

OffsetNameAccessDescription
0x00IDRO0x1000_0001
0x04SCRATCHRWSoftware scratch register
0x08GPIO_OUTRWLow 8 bits drive gpio_out
0x0CTIMER_COUNTROFree-running counter
0x10TIMER_COMPARERWTimer interrupt threshold
0x14TIMER_IRQROBit 0 is timer IRQ level

DMA registers

OffsetNameAccessDescription
0x00SRCRWSource byte address; must be word-aligned in this model
0x04DSTRWDestination byte address; must be word-aligned in this model
0x08LENRWByte length; the model issues one 32-bit beat at a time
0x0CCTRL_STATUSRWWrite bit 0 to start, bit 1 to clear done/error; read bit 0 busy, bit 1 done/IRQ, bit 2 error, bit 3 accepted read-address pulse, bit 4 accepted write-address/data pulse
0x10CFGRWReserved DMA integration/configuration word; reset value is 4 bytes per beat
0x14BYTES_DONERONumber of payload bytes completed by the current/last command
0x18BEATS_ISSUEDRONumber of modeled write beats completed
0x1CCUR_SRCROCurrent source address while busy
0x20CUR_DSTROCurrent destination address while busy
0x24LAST_SRCROLast modeled read address issued
0x28LAST_DSTROLast modeled write address issued
0x2CMASTER_TRACERO{last_wstrb[3:0], state[2:0]} packed into bits [10:7] and [2:0]
0x30READ_BEATSRONumber of AXI-Lite read responses completed
0x34WRITE_BEATSRONumber of AXI-Lite write responses completed
0x38ERROR_COUNTRONumber of alignment or bus response errors observed by the current/last command

NPU registers

OffsetNameAccessDescription
0x00OP_ARWOperand A
0x04OP_BRWOperand B
0x08RESULTROLow result word
0x0CCTRL_STATUSRWWrite bit 0 to start, bit 1 to clear done/error; read bit 0 busy, bit 1 done/IRQ, bit 2 error
0x10OPCODERW0 add, 1 sub, 2 unsigned multiply, 3 signed S16 MAC, 4 packed signed INT8 dot4, 5 unsigned max, 6 unsigned min, 7 packed signed INT4 dot8, 8 bounded INT8 GEMM
0x14ACCRWAccumulator/bias input for MAC/DOT operations
0x18RESULT_HIROHigh result/sign-extension word
0x1CTRACERO{latched_opcode[3:0], busy_count[2:0]} in low bits
0x20GEMM_CFGRWBounded scratchpad GEMM dimensions: M[1:0], N[9:8], K[18:16]
0x24GEMM_BASERWByte bases: A[5:0], B[13:8], C[21:16]
0x28GEMM_STRIDERWByte strides: A[3:0], B[11:8], C[19:16]
0x2CPERF_UNSUPPORTED_OPSRORejected opcode/configuration counter
0x30CMD_PARAMRWReserved command parameter word; no tensor queue semantics yet
0x40DESC_BASERWReserved descriptor-ring base; not a DMA command queue
0x44DESC_HEADRWReserved descriptor-ring head
0x48DESC_TAILROReserved descriptor-ring tail
0x4CDESC_STATUSROReserved descriptor-ring status
0x50PERF_CYCLESROCycles spent in active GEMM state
0x54PERF_MACSROSigned INT8 GEMM MACs issued by the scratchpad prototype
0x58PERF_OPSROAccepted operation counter
0x5CPERF_ERRORSRWRejected command/configuration counter; write bit 0 clears all NPU perf counters
0x80-0xBCSCRATCH[0..15]RW64-byte MMIO scratchpad for the bounded GEMM prototype

Display registers

OffsetNameAccessDescription
0x00FB_BASERWFramebuffer base address; top-level scanout currently fetches from the 0x8000_0000 SRAM-backed DRAM aperture
0x04MODERW{height[15:0], width[15:0]}
0x08FORMATRWFourCC-like format value
0x0CENABLERWBit 0 enables scanout
0x10VSYNCROBit 0 is vsync IRQ level
0x14UNDERFLOW_COUNTRW1C-likeCounts active pixels that could not fetch framebuffer data
0x18FETCHED_PIXEL_COUNTRW1C-likeCounts active pixels fetched from the framebuffer client

Interrupt controller registers

OffsetNameAccessDescription
0x00IDRO0x1C00_0001
0x04PENDINGROBit n is pending state for source ID n + 1
0x08ENABLERWBit n enables source ID n + 1
0x0CCLAIM_COMPLETERWRead returns lowest enabled pending source ID, or 0; write source ID to clear its pending bit