aboutsummaryrefslogtreecommitdiff
path: root/kicad/lib/tools/make_ecp5_symbol.sh
diff options
context:
space:
mode:
authorFriedrich Beckmann <friedrich.beckmann@tha.de>2026-11-08 18:14:54 +0100
committerFriedrich Beckmann <friedrich.beckmann@tha.de>2026-11-08 18:14:54 +0100
commit5129a5a5448012a53cb9ddae1349c2a2c8571339 (patch)
tree41d60bbce7fe0de57cdd92b232682831759de1a8 /kicad/lib/tools/make_ecp5_symbol.sh
parent9e4911662b81bad61183cca74b8c1905f84e60e4 (diff)
Add KiCad 9 schematic, project libraries and datasheetsHEADmaster
Schematic (kicad/), one sheet per function as on ULX3S: - power: TLV62569 bucks for +1V1 / +3V3, AP2112K LDO for +2V5 - usb: USB-C with PTC and TVS, CH347F for JTAG and UART - fpga_power, fpga_config, fpga_banks_01/23/67: ECP5 LFE5U-25F caBGA256 (pin compatible with the 45F), quad SPI flash, 50 MHz CLOCK_50, ball assignment as in PINPLAN.md - ethernet: RTL8211F gigabit PHY, HR911130A RJ45, shield via 1M || 1nF 2kV - sdram: 32 MB W9825G6KH-6 - hdmi: TMDS from the FPGA (LVCMOS33D), AC coupled, ESD protected - user_io: SW, KEY (debounced), LEDR, LEDG, HEX0-HEX3 with DE1 names - gpio: two DE1 compatible 2x20 headers (THDB-ADA on GPIO_0), Pmod A/B, ESD arrays - testpoints: bring-up pads, M3 mounting holes All parts have LCSC numbers, MPN and manufacturer for JLCPCB assembly; footprints are cross-checked against the EasyEDA data. Libraries: ECP5 symbols generated from the Lattice pinout CSVs (kipart), CH347F, RTL8211F, SM410561N symbols, HR911130A symbol and footprint from KiCad library merge requests, generator scripts in lib/tools/. Datasheets of all parts except resistors and capacitors in datasheets/ (manufacturer copyright, not covered by the project licenses).
Diffstat (limited to 'kicad/lib/tools/make_ecp5_symbol.sh')
-rwxr-xr-xkicad/lib/tools/make_ecp5_symbol.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/kicad/lib/tools/make_ecp5_symbol.sh b/kicad/lib/tools/make_ecp5_symbol.sh
new file mode 100755
index 0000000..2495590
--- /dev/null
+++ b/kicad/lib/tools/make_ecp5_symbol.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-3.0-or-later
+# Generate the LFE5U-25F and LFE5U-45F caBGA256 symbols from the Lattice
+# pinout CSVs (FPGA-SC-02033 ECP5U-25, FPGA-SC-02034 ECP5U-45).
+#
+# kicad/lib/tools/make_ecp5_symbol.sh
+#
+# Needs kipart (pipx install kipart).
+#
+# Both parts have the same balls, banks and differential pairs in caBGA256;
+# only the pad names and the upper-corner PLL inputs (45F only) differ.
+# Writes kicad/lib/eboard_fpga.kicad_sym (overwritten).
+set -eu
+here=$(cd "$(dirname "$0")" && pwd)
+ds=$here/../../../datasheets
+command -v kipart >/dev/null 2>&1 || {
+ echo "kipart not found; install it with: pipx install kipart" >&2
+ exit 1
+}
+fp=Package_BGA:BGA-256_14.0x14.0mm_Layout16x16_P0.8mm_Ball0.45mm_Pad0.32mm_NSMD
+out=$here/../eboard_fpga.kicad_sym
+tmp=$(mktemp -d)
+trap 'rm -rf "$tmp"' EXIT
+
+python3 -I "$here/lattice2kipart.py" "$ds/FPGA-SC-02033-2-0-ECP5U-25-Pinout.csv" \
+ CABGA256 LFE5U-25F-xBG256x "$fp" 24K > "$tmp/lfe5u25.csv"
+python3 -I "$here/lattice2kipart.py" "$ds/FPGA-SC-02034-3-0-ECP5U-45-Pinout.csv" \
+ CABGA256 LFE5U-45F-xBG256x "$fp" 44K > "$tmp/lfe5u45.csv"
+# kipart names the units after the CSV unit column (Bank0 ... Bank8, Config, Power).
+kipart -b --bundle-style none -w -o "$tmp/raw.kicad_sym" "$tmp/lfe5u45.csv"
+# put all pin ends on the 2.54 mm grid
+python3 -I "$here/kicad_sym_grid.py" "$tmp/raw.kicad_sym" > "$tmp/lfe5u45.kicad_sym"
+# 25F: same geometry as the 45F symbol, pin names from the 25F pinout,
+# so "Change symbol" swaps the two parts without touching any wire.
+python3 -I "$here/derive_symbol.py" "$tmp/lfe5u45.kicad_sym" LFE5U-45F-xBG256x \
+ "$tmp/lfe5u25.csv" > "$out"
+echo "wrote $out"