# Standard library

The `amaranth.lib` module, also known as the standard library, provides modules that falls into one of the three categories:

1. Modules that will used by essentially all idiomatic Amaranth code, or which are necessary for interoperability. This includes `amaranth.lib.enum` (enumerations), `amaranth.lib.data` (data structures), `amaranth.lib.wiring` (interfaces and components), `amaranth.lib.meta` (interface metadata), and `amaranth.lib.stream` (data streams).

2. Modules that abstract common functionality whose implementation differs between hardware platforms. This includes `amaranth.lib.memory` and `amaranth.lib.cdc`.

3. Modules that have essentially one correct implementation and are of broad utility in digital designs. This includes `amaranth.lib.coding`, `amaranth.lib.fifo`, and `amaranth.lib.crc`.

As part of the Amaranth backwards compatibility guarantee, any behaviors described in these documents will not change from a version to another without at least one version including a warning about the impending change. Any nontrivial change to these behaviors must also go through the public review as a part of the Amaranth Request for Comments process.

The Amaranth standard library is separate from the Amaranth language: everything provided in it could have been implemented in a third-party library.

- Enumerations
  - Metaclass
  - Base classes
  - View classes
- Data structures
  - Introduction
  - Modeling structured data
  - Common data layouts
  - Data views
  - Data classes
- Interfaces and connections
  - Introduction
  - Signatures
  - Interfaces
  - Making connections
  - Components
  - Component metadata
- Interface metadata
  - Introduction
  - Defining annotations
  - Identifying schemas
  - Reference
- Data streams
  - Introduction
  - Data transfer rules
  - Examples
  - Reference
- Memory arrays
  - Introduction
  - Examples
  - Memory description
  - Memory component
  - Memory ports
- Input/output buffers
  - Introduction
  - Examples
  - Simulation
  - Ports
  - Buffers
- Clock domain crossing
  - `FFSynchronizer`
  - `AsyncFFSynchronizer`
  - `ResetSynchronizer`
  - `PulseSynchronizer`
- Code conversion
  - One-hot coding
  - Priority coding
  - Gray coding
- First-in first-out queues
  - `FIFOInterface`
  - `SyncFIFO`
  - `SyncFIFOBuffered`
  - `AsyncFIFO`
  - `AsyncFIFOBuffered`
- Cyclic redundancy checks
  - Introduction
  - Examples
  - Algorithms and parameters
  - CRC computation
  - Predefined algorithms