FPGA-based EtherCAT Slave Controller for Colorlight 5A-75E (Lattice ECP5, LFE5U-25F), written in Migen/LiteX from scratch. Targets the same niche as LiteX-CNC and Mesa — open EtherCAT I/O for the LinuxCNC community.
- Ethernet PHY (RGMII, RTL8211F) on both ports
- PHY auto-config over shared MDIO
- EtherCAT frame forwarding between ports
- Datagram parser (on-the-fly, single cycle)
- Register file (Type, AL Control/Status, DL Status, etc.)
- FMMU (4 channels)
- SyncManager (4 channels, 3-buffer shadow)
- SII EEPROM emulation (in progress)
- AL state machine INIT → PREOP → SAFEOP → OP
- Distributed Clocks
- Mailbox / CoE
Give the LinuxCNC community another open EtherCAT slave option alongside LiteX-CNC and Mesa. Similar in spirit to what those projects do, but targeting a cheap Colorlight board.
ethercat_pu.py— datagram parser (processing unit)ethercat_memory.py— unified register + DPRAM memoryethercat_registers.py— ESC register fileethercat_fmmu.py— FMMUethercat_sm.py— SyncManagerethercat_sii.py— SII EEPROM emulationethercat_dl_router.py— port routerethercat_soc.py— top-level SoCsiitool/— SII binary generation tool
GPL-3.0 (see LICENSE)
=== Master 0, Slave 0 === Device: Main State: INIT Flag: E Identity: Vendor Id: 0xdeadbabe Product code: 0xdeadbabe Revision number: 0x00c0ffee Serial number: 0x00000000 DL information: FMMU bit operation: no Distributed clocks: no Port Type Link Loop Signal NextSlave 0 MII up open yes - 1 MII down closed no - 2 N/A down closed no - 3 N/A down closed no - Mailboxes: Bootstrap RX: 0x0000/0, TX: 0x0000/0 Standard RX: 0x0000/0, TX: 0x1000/128 Supported protocols: (should be CoE)
- RGMII PHY (RTL8211F) with auto-config over shared MDIO
- EtherCAT frame forwarding between ports
- On-the-fly datagram parser
- FMMU (4 channels)
- SyncManager (4 channels, 3-buffer shadow)
- SII EEPROM interface
- AL state machine INIT → PREOP → SAFEOP → OP
- Distributed Clocks
- Mailbox / CoE
- Multi-slave bus