Peripherals¶
- class torii.lib.soc.periph.ConstantBool(value: bool) None ¶
Boolean constant.
- Parameters:
value (bool) – Constant value.
- class torii.lib.soc.periph.ConstantInt(value: int, *, width: int | None = None, signed: bool | None = None) None ¶
Integer constant.
- Parameters:
- class torii.lib.soc.periph.ConstantMap(**constants: dict[str, ConstantValue]) None ¶
Named constant map.
A read-only container for named constants. Keys are iterated in insertion order.
- Parameters:
**constants (dict[str, ConstantValue]) – Named constants.
Examples
>>> ConstantMap(RX_FIFO_DEPTH = 16) ConstantMap([('RX_FIFO_DEPTH', ConstantInt(16, width = 5, signed = False))])
- class torii.lib.soc.periph.ConstantValue¶
Todo
Document Me
- class torii.lib.soc.periph.PeripheralInfo(*, memory_map: MemoryMap, irq: Source | None = None, constant_map: ConstantMap | None = None) None ¶
Peripheral metadata.
A unified description of the local resources of a peripheral. It may be queried in order to recover its memory windows, CSR registers, event sources and configuration constants.
- Parameters:
memory_map (MemoryMap) – Memory map of the peripheral.
irq (event.Source | None) – IRQ line of the peripheral.
constant_map (ConstantMap | None) – Constant map of the peripheral.
- property memory_map: MemoryMap¶
Memory map.
- Returns:
MemoryMap – The memory map describing the local address space of the peripheral.
- property irq: Source¶
IRQ line.
- Returns:
event.Source – An event source used by the peripheral to request interrupts. If provided, its event map describes local events.
- Raises:
NotImplementedError – If peripheral info does not have an IRQ line.
- property constant_map: ConstantMap¶
Constant map.
- Returns:
ConstantMap – The map containing the configuration constants of the peripheral.