Expand description
Shared no_std helpers for ET-SoC-1 compute kernels: hart identity, the
U-mode trace write, a hardware memory fence, and scratchpad addressing.
This is the device-side support library for the compute kernels in this
package. Each kernel binary provides its own panic handler and invokes
kernel_entry! to generate the _start entry point.
Modules§
- pmu
- Performance Monitoring Unit (PMU) counter API.
- tensor
- Tensor-extension intrinsics: TensorLoad, TensorLoadB, TensorFMA32, TensorStore, and TensorWait, all encoded as RISC-V CSR writes. Tensor-extension intrinsics for the ET-SoC-1 Minion core.
Macros§
- kernel_
entry - Generate the kernel entry point (
_start).
Structs§
- Grid
- A hart’s view of an SPMD launch: its identity within
n_hartsparticipants. - MsgBuf
- A fixed-capacity stack buffer for composing trace messages without
alloc.
Constants§
- CACHE_
LINE - Cache-line size in bytes. Per-hart outputs are placed one-per-line so that
distinct harts never write the same line: false sharing silently corrupts
data on this software-coherent architecture. Defined once in
et-abiand shared with the host, so the two sides cannot disagree on the stride. ET-SoC-1 cache-line size, in bytes. - CB_BASE
- Base of the per-hart U-mode trace control-block array
(
CM_UMODE_TRACE_CB_BASEADDR); each entry is 64 bytes.
Functions§
- device_
slice ⚠ - View
nelements of typeTat device addressaddras a shared slice. - fence
- Full hardware memory fence (
fence rw, rw) that also bars compiler reordering. This is an ordering barrier, not an atomic operation. - hart_id
- Current hart ID, from the custom
hartidCSR (0xCD0). - scp_
shire_ base - Base address of
shire’s 2.5 MB L2 scratchpad (ETSOC_SCP_GET_SHIRE_ADDR(shire, 0)):0x8000_0000 | (shire << 23). - shire_
id - Current shire ID (
hart_id >> 6; 64 harts per shire). - timestamp
- A cycle timestamp (
hpmcounter3, CSR0xC03) for trace entry headers. - trace_
str - Write
textas a NUL-terminated string trace entry for the current hart, exactly as the SDK’sTrace_Stringdoes (reserve via the control block, then write atrace_string_t).