Skip to content

Commit 6f5c0ce

Browse files
authored
Merge pull request #1072 from bittide/lucas/add-component-diagrams
Add diagrams and mdbook entries fo s/g units and calendar
2 parents a878987 + 1f029a2 commit 6f5c0ce

7 files changed

Lines changed: 650 additions & 0 deletions

File tree

docs/SUMMARY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ SPDX-License-Identifier: Apache-2.0
1313
- [Soft UGN Demo](sections/soft-ugn-demo.md)
1414
- [Switch Demo with ASIC](sections/switch-demo-asic.md)
1515
- [Switch Demo with GPPE](sections/switch-demo-gppe.md)
16+
- [Components](sections/components.md)
17+
- [Calendar](sections/components/calendar.md)
18+
- [Scatter Unit](sections/components/scatter-unit.md)
19+
- [Gather Unit](sections/components/gather-unit.md)

docs/diagrams/components.drawio

Lines changed: 518 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2025 Google LLC
2+
3+
SPDX-License-Identifier: CC0-1.0

docs/sections/components.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 Google LLC
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
# Components
8+
9+
This section provides an overview of the main hardware components in the Bittide system. Each component plays a specific role in enabling efficient, synchronized, and flexible operation of the hardware platform.
10+
11+
## Available Components
12+
13+
- [Calendar](components/calendar.md)
14+
- [Scatter Unit](components/scatter-unit.md)
15+
- [Gather Unit](components/gather-unit.md)
16+
- [Switch](components/switch.md)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 Google LLC
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
## Calendar
8+
9+
The Calendar component is a programmable state machine that drives the configuration of other components (like the Scatter Unit, Gather Unit, or Switch) on a cycle-by-cycle basis. It allows for time-division multiplexing of resources by cycling through a sequence of pre-programmed configurations.
10+
11+
### Architecture
12+
13+
{{#drawio path="diagrams/components.drawio" page=2}}
14+
15+
The Calendar consists of two memories (buffers) to allow for double-buffering: an **active** calendar and a **shadow** calendar.
16+
- The **active** calendar drives the output signals to the target component.
17+
- The **shadow** calendar can be reconfigured via the Wishbone interface without interrupting the operation of the active calendar.
18+
19+
The active and shadow calendars can be swapped at the end of a **metacycle**. A metacycle is one full iteration through the active calendar's entries, including all repetitions.
20+
21+
### Operation
22+
23+
Each entry in the calendar consists of:
24+
1. **Configuration Data**: The actual control signals for the target component.
25+
2. **Repetition Count**: The number of additional cycles this configuration should remain active.
26+
- `0`: The entry is valid for 1 cycle.
27+
- `N`: The entry is valid for `N + 1` cycles.
28+
29+
The Calendar iterates through the entries in the active buffer. When it reaches the end of the active buffer (determined by the configured depth), it loops back to the beginning, completing a metacycle.
30+
31+
### Double Buffering and Swapping
32+
33+
To update the schedule:
34+
1. Software writes new entries into the **shadow** calendar using the Wishbone interface.
35+
2. Software configures the depth of the shadow calendar.
36+
3. Software arms the swap mechanism by writing to the `swapActive` register.
37+
38+
The swap does not happen immediately. It occurs only when the active calendar completes its current metacycle. This ensures that the schedule is always switched at a deterministic point, preventing glitches or partial schedules.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 Google LLC
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
## Gather Unit
8+
9+
The Gather Unit is a hardware component designed to transmit data frames over a Bittide link. It uses a double-buffered memory architecture and a configurable **Calendar** to determine which data to send in each cycle. This ensures deterministic data transmission.
10+
11+
### Architecture
12+
13+
{{#drawio path="diagrams/components.drawio" page=1}}
14+
15+
The Gather Unit consists of:
16+
- **Double-Buffered Memory**: Two memory buffers (Active and Shadow).
17+
- **Active Buffer**: Provides data to the Bittide link.
18+
- **Shadow Buffer**: Can be written to by the CPU via the Wishbone interface.
19+
- **Calendar**: Determines the read address in the Active Buffer for each outgoing frame.
20+
- **Wishbone Interface**: Allows the CPU to write data to be transmitted and monitor metacycle progress.
21+
22+
### Operation
23+
24+
1. **Data Transmission**:
25+
- Each clock tick, the **Calendar** provides the read address for the Active Buffer.
26+
- The data at that address is read from the Active Buffer and sent over the Bittide link.
27+
28+
2. **Buffer Swapping**:
29+
- The Active and Shadow buffers are swapped at end of each **metacycle**.
30+
- A metacycle is defined by the Calendar's schedule.
31+
- After the swap, the data that was written by the CPU becomes the active data being transmitted.
32+
33+
3. **CPU Access**:
34+
- The CPU writes the data to the Shadow Buffer using the Wishbone interface.
35+
- **Byte Enables**: The Wishbone interface is 32-bit, but the Gather Unit memory is 64-bit. The hardware uses the byte enables to allow writing to the upper or lower 32 bits of the 64-bit memory words.
36+
- To ensure data consistency, the CPU can synchronize with the metacycle using the stalling mechanism.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 Google LLC
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
## Scatter Unit
8+
9+
The Scatter Unit is a hardware component designed to receive data frames from a Bittide link and store them into a local memory. It uses a double-buffered memory architecture and a configurable **Calendar** to determine the write address for each incoming frame. This allows for cycle-accurate, deterministic data reception.
10+
11+
### Architecture
12+
13+
{{#drawio path="diagrams/components.drawio" page=0}}
14+
15+
The Scatter Unit consists of:
16+
- **Double-Buffered Memory**: Two memory buffers (Active and Shadow).
17+
- **Active Buffer**: Receives data from the Bittide link.
18+
- **Shadow Buffer**: Can be read by the CPU via the Wishbone interface.
19+
- **Calendar**: Determines the write address in the Active Buffer for each incoming frame.
20+
- **Wishbone Interface**: Allows the CPU to read received data and monitor metacycle progress.
21+
22+
### Operation
23+
24+
1. **Data Reception**:
25+
- In each cycle, if a valid frame arrives from the Bittide link, the **Calendar** provides the write address for the Active Buffer.
26+
- The frame is written to the Active Buffer at that address.
27+
28+
2. **Buffer Swapping**:
29+
- The Active and Shadow buffers are swapped at end of each **metacycle**.
30+
- A metacycle is defined by the Calendar's schedule.
31+
- After the swap, the data that was just received becomes available in the Shadow Buffer for the CPU to read.
32+
33+
3. **CPU Access**:
34+
- The CPU reads the data from the Shadow Buffer using the Wishbone interface.
35+
- To ensure data consistency, the CPU can synchronize with the metacycle using the stalling mechanism.

0 commit comments

Comments
 (0)