Streamline FPGA Colorlight i5
|
This is a design page. The blade described here does not exist yet. The page collects what the blade and the FPGA design inside the module have to do so that the module behaves like any other Streamline MCU blade. Facts about the module and the backplane are marked with their source; everything else is a proposal. |
The Hazard3 + FPU on FPGA project runs a RISC-V core with a floating point unit on a ColorLight I5 module (Lattice ECP5 LFE5U-25F). Today the module sits on its extension board and is programmed over JTAG. The next step is a Streamline blade with a DDR2 SO-DIMM socket for the module, so that it can be used like the Streamline MCU RP2354 or the STM32 blades:
- programmed and debugged from the Streamline Connect over SWD on the backplane, with no other cable
- console on the Connect's virtual COM port
- SWO trace into the Connect
- the existing peripheral blades (storage, audio, CAN, Ethernet, RS-485 and so on) work on their standard backplane pins
Starting points
The Colorlight i5 module
The module has a 200-pin DDR2 SO-DIMM edge connector, but only the shape is DDR2: the pinout is Colorlight's own[1][2].
| Item | Value |
|---|---|
| FPGA | Lattice LFE5U-25F-6BG381C |
| On the module | 2 MB SPI flash (GD25Q16), 8 MB SDRAM (EM638325, 32 bit), 2 × Broadcom B50612D Gbit Ethernet PHY, 25 MHz oscillator (ball P3), green LED (ball U16), voltage regulators |
| Power | 5 V on SO-DIMM pins 2, 4, 6, 8, 10, 12; GND on 1-11 (odd), 39, 40, 55, 56, 105-108, 157, 158, 199, 200[1]. The module accepts "3V3 to 6V" and has no regulated output on the connector[2]. |
| FPGA I/O | 106 FPGA balls on SO-DIMM pins 41-156[1], 3.3 V (LVCMOS33 in the LiteX board file[3]) |
| Ethernet | The PHYs' line side (MDI, 4 pairs each) is on pins 15-38, so magnetics and RJ45 jacks go on the carrier board[1] |
| JTAG | Not on the edge connector: only on test points on the module[1][2] |
| PROGRAMN, INITN, DONE | Not on the edge connector (not listed in any of the sources) |
The Streamline backplane and Connect
From the Streamline Header Mapping, the Streamline Peripheral Pin Mapping and the Streamline Connect and Streamline MCU RP2354 schematics:
| Signal | Backplane | Notes |
|---|---|---|
| 5 V | A48, B48 | From the Connect's USB, or the MCU blade's USB-C (diode-ORed on each blade) |
| 3.3 V | A47, B47 | Made from 5 V by an LDO on each MCU blade and on the Connect |
| GND | A1, A49, B1, B49 | |
| NRST | A2 | Driven by the Connect |
| BOOT0 | B2 | Boot select, button/jumper on the MCU blade |
| VBAT, VA | A3, B3 | Battery and analog reference for STM32 |
| SWDIO, SWCLK | A46 (PA13), A43 (PA14) | The Connect's SWD |
| SWO | A29 (PB3) | Into the Connect's SWO input |
| Console | B45 (PA9), B46 (PA10) | USART1 TX/RX, the Connect's VCP by default (others selectable on the Connect by jumper) |
| GPIO | 80 positions, PA0 … PE15 | Named after the STM32F407 pins; the peripheral blades use the STM32 peripheral positions |
| Spare | U1-U6 (A19, B19, A27, B27, A38, B38) | Not used by the MCU blades |
The Streamline Connect runs Hybridlink, which in CMSIS-DAP mode supports SWD and SWO (UART/NRZ, through DAP_SWO_Data, tested at 2 Mbaud) and works with OpenOCD, pyOCD and probe-rs. The Connect routes SWD only, not JTAG. So the FPGA has to be debugged and programmed over SWD.
The blade
Power
- 5 V from the backplane (A48/B48) and from a USB-C connector, diode-ORed as on the other MCU blades, to the module's 5 V pins through a load switch (see Reconfiguring the FPGA).
- A 3.3 V LDO feeds the backplane's 3V3 (A47/B47), like the LDO on every MCU blade. The module makes its own supplies and gives none back to the connector, so the blade can't take 3.3 V from the module.
- The module's current draw is not documented. With two Gbit PHYs on board it is probably well above an STM32 blade's: to be measured on the extension board before choosing the load switch, the fuse and the LDO. The FPGA design can power down the unused PHYs over MDIO.
Signals
The FPGA can put any function on any pin, so the blade wires every backplane signal 1:1 to an FPGA I/O, each through a series resistor (33-100 Ω) for edge rates and protection. No level shifting is needed: the backplane and the FPGA I/O are both 3.3 V.
- 80 GPIO positions + NRST + BOOT0 + U1-U6 = 88 of the 106 I/Os. The rest are spare: the REBOOT output, a blade-local header, or the RJ45 jacks' LEDs.
- Clock inputs belong on the FPGA's clock-capable pins (PCLK). Most important is SWCLK, for example on SO-DIMM pin 89 (ball J20, PCLKT2_0) or 81 (L20, PCLKT3_1). The RMII reference clock (A5, PA1) for the Streamline Ethernet blade is another, for example on pin 91 (J19, PCLKT2_1).
- Pins 42-52, 62, 66 and 68 (balls R1, T1, U1, Y2, W1, V1, T2, T3, R3) are in the FPGA's configuration bank 8. They work as normal I/O after configuration, but avoid them for NRST, SWD and SWO, which must behave while the FPGA is configuring.
- Pin 41 (ball U16) also drives the module's LED.
- VBAT and VA are unused: the FPGA has no ADC or RTC domain.
Reset and boot
- NRST (A2) gets a 10 kΩ pull-up, 100 nF and a reset button, as on the Streamline MCU RP2354, and goes to an FPGA input. It resets the SoC (core and peripherals), not the FPGA configuration. As on a Cortex-M, the debug port must keep working while NRST is low, so that the Connect can attach under reset.
- BOOT0 (B2): button or jumper to an FPGA input. Proposal: BOOT0 high at reset keeps the core from starting the program in flash, so a program that breaks the debug connection, for example by reconfiguring the SWD pins, can always be erased.
Reconfiguring the FPGA
The ECP5 loads its configuration from the SPI flash at power-up or when PROGRAMN is pulsed. PROGRAMN is not on the edge connector, so the blade gets a load switch on the module's 5 V. An FPGA pin (REBOOT) triggers a short power cycle through a circuit that times the off period itself, since the FPGA loses power. That lets a new bitstream, written to the flash over SWD, take effect without anyone unplugging the blade.
First programming and recovery
The first bitstream has to go in over JTAG: on the extension board, or through pogo pins on the module's JTAG test points. After that the FPGA design itself provides SWD, so everything is done from the Connect. Optionally, the blade gets pogo pads or a cut-out for those test points, so a module can be recovered without moving it to the extension board. ECP5 multiboot can also keep a known-good "golden" image in the flash, which the FPGA falls back to if a new image fails to load.
Ethernet (optional)
The module's two Gbit PHYs are only usable if the carrier provides magnetics and jacks. One or two RJ45 jacks with integrated magnetics on the blade give Gbit Ethernet without a separate Ethernet blade. The MDI pairs need 100 Ω differential routing. This is blade-local: the backplane has no Ethernet line signals.
Mechanical
The blade carries a standard DDR2 SO-DIMM socket (200 pins, 1.8 V key position). Points to check: the module's width (67.6 mm, standard SO-DIMM) against the blade's outline, the height of the socket plus module against the spacing on the backplane, and access to the module's JTAG test points.
Inside the FPGA: what makes it an MCU
The blade only connects signals. Behaving like an MCU is the job of the FPGA design.
SWD debug port
A serial wire debug port (Arm ADIv5 SW-DP) in the FPGA, with two access ports:
- an APB-AP to the Hazard3 debug module, so the Connect can halt, step, set breakpoints and read registers. This is how the RP2350 debugs its Hazard3 cores. Hazard3's debug module already has an APB-style interface on that side, and Hazard3 includes an asynchronous APB bridge for the crossing from the SWCLK clock to the system clock.
- an AHB-AP onto the SoC bus, as on a Cortex-M: fast program loading (instead of about 3 kB/s over JTAG today), memory access while the core runs, and access to the flash writer and the SWO registers.
On the PC side this needs OpenOCD with support for RISC-V debug behind an Arm debug port, as used for the RP2350's RISC-V cores.
Program storage
The program is stored in the module's SPI flash after the bitstream, so it survives a power cycle. At reset a small boot ROM copies it to SRAM and starts it, and code runs at full speed from SRAM. Writing the flash goes through a flash writer that the debugger reaches through the AHB-AP. Bitstream updates use the same path.
SWO
- An ITM-compatible block: 32 stimulus ports at the Arm standard address (0xE0000000) and a TPIU-style output (0xE0040000) with UART/NRZ encoding and a programmable baud rate. Software gets a
printfchannel that doesn't use a UART, and host tools that know the Arm registers (OpenOCD'stpiu/itmcommands, orbuculum) can configure it. - Later: periodic PC sampling, timestamps, and interrupt and exception entry/exit packets, taken from inside the Hazard3 core, for statistical profiling as on a Cortex-M.
Peripherals at the STM32 positions
The FPGA design places each peripheral on the backplane pins where the STM32 blades have it, so the existing blades work unchanged:
| Blade | Interface | Needed in the FPGA |
|---|---|---|
| Streamline Connect VCP, Streamline RS485 | USART1, others | UART (exists), driver-enable output for RS-485 |
| Streamline Storage Flash, Streamline SPI-Ethernet | SPI | SPI controller |
| Streamline Storage EEPROM | I²C | I²C controller |
| Streamline Storage SD | SDIO (default) or SPI | SDIO controller, or SPI |
| Streamline IO Audio DAC | I2S2 | I2S transmitter |
| Streamline IO CAN | CAN | CAN controller (the blade has the transceivers) |
| Streamline Ethernet | RMII | Ethernet MAC with RMII |
| Streamline Neopixel 8x8 | GPIO | WS2812 driver (or GPIO with timing in software) |
| LED, button | PC13, PC15 | GPIO |
Only the UART and the timer exist today. The peripheral registers will not be STM32 compatible, so software needs its own drivers.
Resources
The FPGA currently uses 41% of its logic (9864 of 24288 LUTs) for the core, FPU and SoC. The SWD port, the access ports and SWO are estimated at 1-2k LUTs (not measured yet). The peripherals above are small individually, but together, and with a possible second core, the 25F will start to fill up.
Open questions
- Current draw of the module, with the PHYs active and powered down: sets the load switch, the fuse and whether the backplane's USB power is enough.
- Whether PROGRAMN is on a test point on the module. If so, the load switch could be replaced by a simpler reconfiguration circuit.
- Which version of OpenOCD (or other host tool) supports RISC-V debug behind an Arm SW-DP with Hybridlink.
- Mechanical fit of an SO-DIMM socket on a Streamline blade.
See also
- Hazard3 + FPU on FPGA: the FPGA design that runs on the module
- ColorLight I5: the module and its extension board
- Streamline, Streamline Connect, Streamline Header Mapping, Streamline Peripheral Pin Mapping
- Hybridlink: the Connect's firmware
References
- ↑ 1.0 1.1 1.2 1.3 1.4 wuxx/Colorlight-FPGA-Projects: Colorlight i5 v7.0 components and DDR2 SO-DIMM pin table
- ↑ 2.0 2.1 2.2 Tom Verbeure, The Colorlight i5 as FPGA development board
- ↑ LiteX board definition for the Colorlight i5