blob: 1a3367b414faa24a9ae776d611a277ae1ac9ace6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# Hello Alchitry Pt v2
A basic Amaranth HDL blinky example for the Alchitry Pt v2 development board with XC7A100T-2FGG484I FPGA.
## Requirements
- Python 3.13+
- uv package manager
- Xilinx Vivado (with `vivado` command in PATH)
- Alchitry Pt v2 board connected via USB
## Setup
1. **Install Python dependencies:**
```bash
uv sync
```
2. **Install udev rules for USB access:**
```bash
sudo cp 99-alchitry-xilinx.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
```
3. **Ensure Vivado is in PATH:**
```bash
export PATH="/path/to/vivado/bin:$PATH"
```
## Usage
### Build and Program FPGA
Run the blinky example:
```bash
uv run python blinky.py
```
This will:
1. Synthesize the design using Vivado
2. Generate a bitstream
3. Program the FPGA automatically
4. LED 0 should start blinking at ~12Hz
### Build Only (No Programming)
To build without programming:
```bash
uv run python -c "
from platform_alchitry_pt import AlchitryPtPlatform
from blinky import Blinky
platform = AlchitryPtPlatform()
platform.build(Blinky(), do_program=False)
"
```
## Files
- `blinky.py` - Main blinky example that blinks LED 0
- `platform_alchitry_pt.py` - Alchitry Pt v2 platform definition with official pin mappings
- `pyproject.toml` - Project dependencies
- `99-alchitry-xilinx.rules` - udev rules for USB programming access
## Hardware Details
- **FPGA**: XC7A100T-2FGG484I (Artix-7, 484-pin BGA, speed grade -2)
- **Clock**: 100 MHz oscillator on pin W19
- **LEDs**: 8 LEDs (pins P19, P20, T21, R19, V22, U21, T20, W20)
- **Reset**: Active-low reset button on pin N15
- **IO**: 32 general purpose IO pins from A/B/C banks
Pin mappings are sourced from official Alchitry Labs V2 hardware definitions.
|