2019-12-06 11:51:47 +01:00
|
|
|
# openFPGALoader
|
2019-12-06 13:24:36 +01:00
|
|
|
Universal utility for programming FPGA
|
2019-09-26 18:53:30 +02:00
|
|
|
|
2019-12-06 13:24:36 +01:00
|
|
|
__Current support kits:__
|
2019-12-06 07:45:19 +01:00
|
|
|
|
2019-09-26 18:53:30 +02:00
|
|
|
* Trenz cyc1000 Cyclone 10 LP 10CL025 (memory and spi flash)
|
2020-04-22 15:32:19 +02:00
|
|
|
* [Colorlight 5A-75B (version 7)](https://fr.aliexpress.com/item/32281130824.html) (memory and spi flash)
|
2020-08-08 11:42:38 +02:00
|
|
|
* [Digilent Arty A7 xc7a35ti](https://reference.digilentinc.com/reference/programmable-logic/arty-a7/start) (memory and spi flash)
|
|
|
|
|
* [Digilent Arty S7 xc7s50](https://reference.digilentinc.com/reference/programmable-logic/arty-s7/start) (memory and spi flash)
|
2020-05-02 09:58:32 +02:00
|
|
|
* [Lattice MachXO2 Breakout Board Evaluation Kit (LCMXO2-7000HE)](https://www.latticesemi.com/products/developmentboardsandkits/machxo2breakoutboard) (memory and flash)
|
2019-12-20 09:14:58 +01:00
|
|
|
* Lattice MachXO3LF Starter Kit LCMX03LF-6900C (memory and flash)
|
2020-09-26 08:47:52 +02:00
|
|
|
* [Lattice CrossLink-NX Evaluation Board (LIFCL-40-EVN)](https://www.latticesemi.com/en/Products/DevelopmentBoardsAndKits/CrossLink-NXEvaluationBoard) (memory and spi flash)
|
2020-04-22 15:32:19 +02:00
|
|
|
* [Lattice ECP5 5G Evaluation Board (LFE5UM5G-85F-EVN)](https://www.latticesemi.com/en/Products/DevelopmentBoardsAndKits/ECP5EvaluationBoard) (memory and spi flash)
|
2019-12-06 07:45:19 +01:00
|
|
|
* [Trenz Gowin LittleBee (TEC0117)](https://shop.trenz-electronic.de/en/TEC0117-01-FPGA-Module-with-GOWIN-LittleBee-and-8-MByte-internal-SDRAM)
|
2020-04-28 18:22:33 +02:00
|
|
|
* [Saanlima Pipistrello LX45](http://pipistrello.saanlima.com/index.php?title=Welcome_to_Pipistrello) (memory)
|
2020-02-01 18:12:09 +01:00
|
|
|
* [SeeedStudio Spartan Edge Accelerator Board](http://wiki.seeedstudio.com/Spartan-Edge-Accelerator-Board) (memory)
|
2020-01-18 18:03:32 +01:00
|
|
|
* [Sipeed Tang Nano](https://tangnano.sipeed.com/en/) (memory)
|
2020-08-24 08:59:01 +02:00
|
|
|
* [Sipeed Lichee Tang](https://tang.sipeed.com/en/hardware-overview/lichee-tang/) (memory and spi flash)
|
2020-08-19 15:15:13 +02:00
|
|
|
* [Terasic de0nano](https://www.terasic.com.tw/cgi-bin/page/archive.pl?No=593) (memory)
|
2020-05-13 10:09:50 +02:00
|
|
|
* LambdaConcept ECPIX-5 (memory and flash)
|
2019-12-06 07:45:19 +01:00
|
|
|
|
2019-12-06 13:24:36 +01:00
|
|
|
__Supported (tested) FPGA:__
|
2019-12-06 07:45:19 +01:00
|
|
|
|
2020-08-24 08:59:01 +02:00
|
|
|
* Anlogic [EG4S20](http://www.anlogic.com/prod_view.aspx?TypeId=10&Id=168&FId=t3:10:3) (SRAM and Flash)
|
|
|
|
|
* Gowin [GW1N (GW1N-1, GW1N-4, GW1NR-9)](https://www.gowinsemi.com/en/product/detail/2/) (SRAM and Flash)
|
2020-05-02 09:58:32 +02:00
|
|
|
* Lattice [MachXO2](https://www.latticesemi.com/en/Products/FPGAandCPLD/MachXO2) (SRAM and Flash)
|
2019-12-20 09:14:58 +01:00
|
|
|
* Lattice [MachXO3LF](http://www.latticesemi.com/en/Products/FPGAandCPLD/MachXO3.aspx) (SRAM and Flash)
|
2020-04-22 15:32:19 +02:00
|
|
|
* Lattice [ECP5 (25F, 5G 85F](http://www.latticesemi.com/Products/FPGAandCPLD/ECP5) (SRAM and Flash)
|
2020-09-26 08:47:52 +02:00
|
|
|
* Lattice [ECP5 (25F, 5G 85F, CrossLink-NX (LIFCL-40)](https://www.latticesemi.com/en/Products/FPGAandCPLD/CrossLink-NX) (SRAM and Flash)
|
2020-02-16 19:20:34 +01:00
|
|
|
* Xilinx Artix 7 [xc7a35ti, xc7a100t](https://www.xilinx.com/products/silicon-devices/fpga/artix-7.html) (memory (all) and spi flash (xc7a35ti)
|
2020-04-28 18:21:07 +02:00
|
|
|
* Xilinx Spartan 6 [xc6slx45](https://www.xilinx.com/products/silicon-devices/fpga/spartan-6.html) (memory)
|
2020-08-08 11:42:38 +02:00
|
|
|
* Xilinx Spartan 7 [xc7s15, xc7s50](https://www.xilinx.com/products/silicon-devices/fpga/spartan-7.html) (memory (all) and spi flash (xc7s50))
|
2020-08-19 15:15:13 +02:00
|
|
|
* Intel Cyclone IV CE [EP4CE22](https://www.intel.com/content/www/us/en/products/programmable/fpga/cyclone-iv/features.html) (memory. See note below)
|
2019-12-06 13:24:36 +01:00
|
|
|
* Intel Cyclone 10 LP [10CL025](https://www.intel.com/content/www/us/en/products/programmable/fpga/cyclone-10.html)
|
2019-12-06 07:45:19 +01:00
|
|
|
|
2020-08-19 15:15:13 +02:00
|
|
|
**Note**: cyclone IV and cyclone 10 have same idcode. A WA is mandatory to
|
|
|
|
|
detect correct model for flash programming.
|
|
|
|
|
|
2019-12-06 07:45:19 +01:00
|
|
|
__Supported cables:__
|
2019-11-19 16:21:04 +01:00
|
|
|
|
2020-08-20 16:56:29 +02:00
|
|
|
* anlogic JTAG adapter
|
2020-02-01 18:01:55 +01:00
|
|
|
* [digilent_hs2](https://store.digilentinc.com/jtag-hs2-programming-cable/): jtag programmer cable from digilent
|
2020-06-14 15:41:00 +02:00
|
|
|
* [DirtyJTAG](https://github.com/jeanthom/DirtyJTAG): JTAG probe firmware for STM32F1
|
2020-08-19 15:15:13 +02:00
|
|
|
* Intel USB Blaster: jtag programmer cable from intel/altera
|
2019-11-19 16:21:04 +01:00
|
|
|
* JTAG-HS3: jtag programmer cable from digilent
|
2019-12-06 07:45:19 +01:00
|
|
|
* FT2232: generic programmer cable based on Ftdi FT2232
|
2020-08-04 17:36:33 +02:00
|
|
|
* FT232RL and FT231X: generic USB<->UART converters in bitbang mode
|
2020-01-18 18:03:32 +01:00
|
|
|
* Tang Nano USB-JTAG interface: FT2232C clone based on CH552 microcontroler
|
|
|
|
|
(with some limitations and workaround)
|
2019-09-26 18:53:30 +02:00
|
|
|
|
|
|
|
|
## compile and install
|
|
|
|
|
|
2019-10-05 12:00:29 +02:00
|
|
|
This application uses **libftdi1**, so this library must be installed (and,
|
2019-09-26 18:53:30 +02:00
|
|
|
depending of the distribution, headers too)
|
|
|
|
|
```bash
|
2020-03-14 18:41:57 +01:00
|
|
|
apt-get install libftdi1-2 libftdi1-dev libudev-dev cmake
|
2019-09-26 18:53:30 +02:00
|
|
|
```
|
2020-03-14 19:42:07 +01:00
|
|
|
**libudev-dev** is optional, may be replaced by **eudev-dev** or just not installed.
|
|
|
|
|
|
|
|
|
|
By default, **(e)udev** support is enabled (used to open a device by his */dev/xx*
|
|
|
|
|
node). If you don't want this option, use:
|
|
|
|
|
|
|
|
|
|
```-DENABLE_UDEV=OFF```
|
2020-03-14 16:48:40 +01:00
|
|
|
|
|
|
|
|
And if not already done, install **pkg-config**, **make** and **g++**.
|
2019-09-26 18:53:30 +02:00
|
|
|
|
2020-07-26 12:26:52 +02:00
|
|
|
Alternatively you can manually specify the location of **libusb** and **libftdi1**:
|
|
|
|
|
|
|
|
|
|
```-DUSE_PKGCONFIG=OFF -DLIBUSB_LIBRARIES=<path_to_libusb> -DLIBFTDI_LIBRARIES=<path_to_libftdi> -DLIBFTDI_VERSION=<version> -DCMAKE_CXX_FLAGS="-I<libusb_include_dir> -I<libftdi1_include_dir>"```
|
|
|
|
|
|
|
|
|
|
You may also need to add this if you see link errors between **libusb** and **pthread**:
|
|
|
|
|
|
|
|
|
|
```-DLINK_CMAKE_THREADS=ON```
|
|
|
|
|
|
2019-09-26 18:53:30 +02:00
|
|
|
To build the app:
|
|
|
|
|
```bash
|
2020-01-28 11:54:07 +01:00
|
|
|
$ mkdir build
|
|
|
|
|
$ cd build
|
2020-03-14 18:49:13 +01:00
|
|
|
$ cmake ../ # add -DBUILD_STATIC=ON to build a static version
|
2020-03-14 19:42:07 +01:00
|
|
|
# add -DENABLE_UDEV=OFF to disable udev support and -d /dev/xxx
|
2020-01-28 11:54:07 +01:00
|
|
|
$ cmake --build .
|
|
|
|
|
or
|
|
|
|
|
$ make -j$(nproc)
|
2019-09-26 18:53:30 +02:00
|
|
|
```
|
|
|
|
|
To install
|
|
|
|
|
```bash
|
|
|
|
|
$ sudo make install
|
|
|
|
|
```
|
2020-02-16 13:33:38 +01:00
|
|
|
The default install path is `/usr/local`, to change it, use
|
|
|
|
|
`-DCMAKE_INSTALL_PREFIX=myInstallDir` in cmake invokation.
|
2019-09-26 18:53:30 +02:00
|
|
|
|
2020-04-13 15:57:31 +02:00
|
|
|
## access right
|
|
|
|
|
|
|
|
|
|
By default, users have no access to converters. A rule file
|
|
|
|
|
(*99-openfpgaloader.rules*) for *udev* is provided at the root directory
|
|
|
|
|
of this repository. These rules set access right and group (*plugdev*)
|
|
|
|
|
when a converter is plugged.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ sudo cp 99-openfpgaloader.rules /etc/udev/rules.d/
|
|
|
|
|
$ sudo udevadm control --reload-rules && udevadm trigger # force udev to take new rule
|
|
|
|
|
$ sudo usermod -a YourUserName -G plugdev # add user to plugdev group
|
|
|
|
|
```
|
|
|
|
|
After that you need to unplug and replug your device.
|
|
|
|
|
|
2019-09-26 18:53:30 +02:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader --help
|
|
|
|
|
Usage: openFPGALoader [OPTION...] BIT_FILE
|
|
|
|
|
openFPGALoader -- a program to flash cyclone10 LP FPGA
|
2019-09-26 18:53:30 +02:00
|
|
|
|
|
|
|
|
-b, --board=BOARD board name, may be used instead of cable
|
|
|
|
|
-c, --cable=CABLE jtag interface
|
2019-11-19 09:17:04 +01:00
|
|
|
-d, --device=DEVICE device to use (/dev/ttyUSBx)
|
2020-09-22 18:22:51 +02:00
|
|
|
--ftdi-channel=CHANNEL FTDI chip channel number (channels 0-3 map to A-D)
|
2020-02-22 20:55:51 +01:00
|
|
|
--detect detect FPGA
|
2020-05-25 23:18:42 +02:00
|
|
|
--freq=FREQ jtag frequency (Hz)
|
2020-01-04 17:37:16 +01:00
|
|
|
-f, --write-flash write bitstream in flash (default: false, only for
|
2020-04-22 15:32:19 +02:00
|
|
|
Gowin and ECP5 devices)
|
2019-12-07 06:40:29 +01:00
|
|
|
--list-boards list all supported boards
|
|
|
|
|
--list-cables list all supported cables
|
|
|
|
|
--list-fpga list all supported FPGA
|
2020-01-04 17:37:16 +01:00
|
|
|
-m, --write-sram write bitstream in SRAM (default: true, only for
|
2020-04-22 15:32:19 +02:00
|
|
|
Gowin and ECP5 devices)
|
2019-09-26 18:53:30 +02:00
|
|
|
-o, --offset=OFFSET start offset in EEPROM
|
2020-08-04 17:36:33 +02:00
|
|
|
--pins arg pin config (only for bitbang) TDI:TDO:TCK:TMS
|
2019-09-26 18:53:30 +02:00
|
|
|
-r, --reset reset FPGA after operations
|
|
|
|
|
-v, --verbose Produce verbose output
|
2020-07-23 18:32:18 +02:00
|
|
|
-h, --help Give this help list
|
2019-09-26 18:53:30 +02:00
|
|
|
-V, --version Print program version
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
To have complete help
|
|
|
|
|
|
2019-11-19 09:17:04 +01:00
|
|
|
### Generic usage
|
|
|
|
|
|
|
|
|
|
#### display FPGA
|
|
|
|
|
|
|
|
|
|
With board name:
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader -b theBoard
|
2019-11-19 09:17:04 +01:00
|
|
|
```
|
2019-12-07 06:40:29 +01:00
|
|
|
(see `openFPGALoader --list-boards`)
|
2019-11-19 09:17:04 +01:00
|
|
|
|
|
|
|
|
With cable:
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader -c theCable
|
2019-11-19 09:17:04 +01:00
|
|
|
```
|
2019-12-07 06:40:29 +01:00
|
|
|
(see `openFPGALoader --list-cables`)
|
2019-11-19 09:17:04 +01:00
|
|
|
|
|
|
|
|
With device node:
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader -d /dev/ttyUSBX
|
2019-11-19 09:17:04 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Note:** for some cable (like *digilent* adapters) signals from the converter
|
|
|
|
|
are not just directly to the FPGA. For this case, the *-c* must be added.
|
|
|
|
|
|
2019-12-06 11:51:47 +01:00
|
|
|
**Note:** when -d is not provided, *openFPGALoader* will opens the first *ftdi*
|
2019-11-19 09:17:04 +01:00
|
|
|
found, if more than one converter is connected to the computer,
|
|
|
|
|
the *-d* option is the better solution
|
|
|
|
|
|
|
|
|
|
#### Reset device
|
|
|
|
|
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader [options] -r
|
2019-11-19 09:17:04 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### load bitstream device (memory or flash)
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader [options] /path/to/bitstream.ext
|
2019-11-19 09:17:04 +01:00
|
|
|
```
|
|
|
|
|
|
2020-08-04 17:36:33 +02:00
|
|
|
#### bitbang mode and pins configuration
|
|
|
|
|
|
|
|
|
|
*FT232R* and *ft231X* may be used as JTAG programmer. JTAG communications are
|
|
|
|
|
emulated in bitbang mode.
|
|
|
|
|
|
|
|
|
|
To use these devices user needs to provides both the cable and the pin mapping:
|
|
|
|
|
```bash
|
|
|
|
|
openFPGALoader [options] -cft23XXX --pins=TDI:TDO:TCK:TMS /path/to/bitstream.ext
|
|
|
|
|
```
|
|
|
|
|
where:
|
|
|
|
|
* ft23XXX may be **ft232RL** or **ft231X**
|
|
|
|
|
* TDI:TDO:TCK:TMS may be the pin ID (0 <= id <= 7) or string value
|
|
|
|
|
|
|
|
|
|
allowed values are:
|
|
|
|
|
|
|
|
|
|
| value | ID |
|
|
|
|
|
|-------|----|
|
|
|
|
|
| TXD | 0 |
|
|
|
|
|
| RXD | 1 |
|
|
|
|
|
| RTS | 2 |
|
|
|
|
|
| CTS | 3 |
|
|
|
|
|
| DTR | 4 |
|
|
|
|
|
| DSR | 5 |
|
|
|
|
|
| DCD | 6 |
|
|
|
|
|
| RI | 7 |
|
|
|
|
|
|
|
|
|
|
|
2020-08-19 15:15:13 +02:00
|
|
|
### CYC1000 and de0nano
|
2019-09-26 18:53:30 +02:00
|
|
|
|
2019-09-27 08:58:38 +02:00
|
|
|
#### loading in memory:
|
|
|
|
|
|
|
|
|
|
sof to svf generation:
|
|
|
|
|
```bash
|
|
|
|
|
quartus_cpf -c -q -g 3.3 -n 12.0MHz p project_name.sof project_name.svf
|
|
|
|
|
```
|
|
|
|
|
file load:
|
2019-09-26 18:53:30 +02:00
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader -b cyc1000 project_name.svf
|
2019-09-26 18:53:30 +02:00
|
|
|
```
|
|
|
|
|
|
2020-08-19 15:15:13 +02:00
|
|
|
```bash
|
|
|
|
|
openFPGALoader -b de0nano -b project_name.svf
|
|
|
|
|
```
|
|
|
|
|
|
2019-09-27 08:58:38 +02:00
|
|
|
#### SPI flash:
|
|
|
|
|
sof to rpd:
|
2019-09-26 18:53:30 +02:00
|
|
|
```bash
|
2019-09-27 08:58:38 +02:00
|
|
|
quartus_cpf -o auto_create_rpd=on -c -d EPCQ16A -s 10CL025YU256C8G project_name.svf project_name.jic
|
2019-09-26 18:53:30 +02:00
|
|
|
```
|
2019-09-27 08:58:38 +02:00
|
|
|
file load:
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader -b cyc1000 -r project_name_auto.rpd
|
2019-09-27 08:58:38 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Note about SPI flash:
|
|
|
|
|
svf file used to write in flash is just a bridge between FT2232 interfaceB
|
|
|
|
|
configured in SPI mode and sfl primitive used to access EPCQ SPI flash.**
|
2019-10-05 19:40:43 +02:00
|
|
|
|
2019-10-11 09:10:38 +02:00
|
|
|
**Note about FT2232 interfaceB:
|
|
|
|
|
This interface is used for SPI communication only when the dedicated svf is
|
|
|
|
|
loaded in RAM, rest of the time, user is free to use for what he want.**
|
|
|
|
|
|
2020-02-01 18:12:09 +01:00
|
|
|
### ARTY and Spartan Edge Accelerator Board
|
2019-10-05 19:40:43 +02:00
|
|
|
|
|
|
|
|
To simplify further explanations, we consider the project is generated in the
|
|
|
|
|
current directory.
|
|
|
|
|
|
2020-02-01 18:12:09 +01:00
|
|
|
**Note: Spartan Edge Accelerator Board has only pinheader, so the cable must be
|
|
|
|
|
provided**
|
|
|
|
|
|
2019-10-05 19:40:43 +02:00
|
|
|
#### loading in memory:
|
|
|
|
|
|
|
|
|
|
*.bit* file is the default format generated by *vivado*, so nothing special
|
|
|
|
|
task must be done to generates this bitstream.
|
|
|
|
|
|
|
|
|
|
__file load:__
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader -b arty *.runs/impl_1/*.bit
|
2019-10-05 19:40:43 +02:00
|
|
|
```
|
2020-02-01 18:12:09 +01:00
|
|
|
or
|
|
|
|
|
```bash
|
|
|
|
|
openFPGALoader -b spartanEdgeAccelBoard -c digilent_hs2 *.runs/impl_1/*.bit
|
|
|
|
|
```
|
2019-10-05 19:40:43 +02:00
|
|
|
|
2020-02-01 18:12:09 +01:00
|
|
|
#### SPI flash (only for ARTY):
|
2019-10-05 19:40:43 +02:00
|
|
|
.mcs must be generates through vivado with a tcl script like
|
|
|
|
|
```tcl
|
|
|
|
|
set project [lindex $argv 0]
|
|
|
|
|
|
|
|
|
|
set bitfile "${project}.runs/impl_1/${project}.bit"
|
|
|
|
|
set mcsfile "${project}.runs/impl_1/${project}.mcs"
|
|
|
|
|
|
|
|
|
|
write_cfgmem -format mcs -interface spix4 -size 16 \
|
|
|
|
|
-loadbit "up 0x0 $bitfile" -loaddata "" \
|
|
|
|
|
-file $mcsfile -force
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
**Note:
|
|
|
|
|
*-interface spix4* and *-size 16* depends on SPI flash capability and size.**
|
|
|
|
|
|
|
|
|
|
The tcl script is used with:
|
|
|
|
|
```bash
|
|
|
|
|
vivado -nolog -nojournal -mode batch -source script.tcl -tclargs myproject
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
__file load:__
|
|
|
|
|
```bash
|
2019-12-06 11:51:47 +01:00
|
|
|
openFPGALoader -b arty *.runs/impl_1/*.mcs
|
2019-10-05 19:40:43 +02:00
|
|
|
```
|
2020-05-02 09:58:32 +02:00
|
|
|
### MachXO2/MachXO3 Starter Kit
|
2019-11-18 16:05:33 +01:00
|
|
|
|
|
|
|
|
#### Flash memory:
|
|
|
|
|
|
|
|
|
|
*.jed* file is the default format generated by *Lattice Diamond*, so nothing
|
|
|
|
|
special must be done to generates this file.
|
|
|
|
|
|
|
|
|
|
__file load__:
|
|
|
|
|
```bash
|
2020-05-02 09:58:32 +02:00
|
|
|
openFPGALoader [-b yourboard] impl1/*.jed
|
2019-11-18 16:05:33 +01:00
|
|
|
```
|
2020-05-02 09:58:32 +02:00
|
|
|
where *yourboard* may be:
|
|
|
|
|
* *machX02EVN*
|
|
|
|
|
* *machXO3SK*
|
|
|
|
|
|
2019-12-20 09:14:58 +01:00
|
|
|
#### SRAM:
|
|
|
|
|
|
|
|
|
|
To generates *.bit* file **Bitstream file** must be checked under **Exports Files** in *Lattice Diamond* left panel.
|
|
|
|
|
|
|
|
|
|
__file load__:
|
|
|
|
|
```bash
|
2020-05-02 09:58:32 +02:00
|
|
|
openFPGALoader [-b yourboard] impl1/*.bit
|
2019-12-20 09:14:58 +01:00
|
|
|
```
|
2020-05-02 09:58:32 +02:00
|
|
|
where *yourboard* may be:
|
|
|
|
|
* *machX02EVN*
|
|
|
|
|
* *machXO3SK*
|
2019-12-06 07:45:19 +01:00
|
|
|
|
2020-09-26 08:47:52 +02:00
|
|
|
### Lattice ECP5 (Colorlight 5A-75b, Lattice ECP5 5G Evaluation board, ULX3S) CrossLink-NX
|
2020-04-22 15:32:19 +02:00
|
|
|
|
|
|
|
|
#### SRAM:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
openFPGALoader [-b yourBoard] [-c yourCable] -m project_name/*.bit
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**By default, openFPGALoader load bitstream in memory, so the '-m' argument is optional**
|
2020-05-19 08:08:38 +02:00
|
|
|
|
2020-04-22 15:32:19 +02:00
|
|
|
#### SPI Flash:
|
|
|
|
|
|
2020-05-19 08:08:38 +02:00
|
|
|
##### bit
|
|
|
|
|
|
2020-04-22 15:32:19 +02:00
|
|
|
```bash
|
|
|
|
|
openFPGALoader [-b yourBoard] [-c yourCable] -f project_name/*.bit
|
|
|
|
|
```
|
|
|
|
|
|
2020-05-19 08:08:38 +02:00
|
|
|
##### mcs
|
|
|
|
|
|
|
|
|
|
To generates *.mcs* file **PROM File** must be checked under **Exports Files** in *Lattice Diamond* left panel.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
openFPGALoader [-b yourBoard] [-c yourCable] project_name/*.mcs
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
2020-01-18 18:03:32 +01:00
|
|
|
### Trenz GOWIN LittleBee (TEC0117) and Sipeed Tang Nano
|
2019-12-06 07:45:19 +01:00
|
|
|
|
|
|
|
|
*.fs* file is the default format generated by *Gowin IDE*, so nothing
|
|
|
|
|
special must be done to generates this file.
|
|
|
|
|
|
2020-01-04 17:37:16 +01:00
|
|
|
Since the same file is used for SRAM and Flash a CLI argument is used to
|
|
|
|
|
specify the destination.
|
|
|
|
|
|
|
|
|
|
#### Flash SRAM:
|
|
|
|
|
|
|
|
|
|
with **-m**
|
|
|
|
|
|
2020-01-18 18:03:32 +01:00
|
|
|
__file load (Trenz)__:
|
2020-01-04 17:37:16 +01:00
|
|
|
```bash
|
|
|
|
|
openFPGALoader -m -b littleBee impl/pnr/*.fs
|
|
|
|
|
```
|
2020-01-18 18:03:32 +01:00
|
|
|
__file load (Tang Nano)__:
|
|
|
|
|
```bash
|
|
|
|
|
openFPGALoader -m -b tangnano impl/pnr/*.fs
|
|
|
|
|
```
|
2020-01-04 17:37:16 +01:00
|
|
|
|
2020-01-18 18:03:32 +01:00
|
|
|
#### Flash (only with Trenz board):
|
2020-01-04 17:37:16 +01:00
|
|
|
|
|
|
|
|
with **-f**
|
|
|
|
|
|
2019-12-06 07:45:19 +01:00
|
|
|
__file load__:
|
|
|
|
|
```bash
|
2020-01-04 17:37:16 +01:00
|
|
|
openFPGALoader -f -b littleBee impl/pnr/*.fs
|
2019-12-06 07:45:19 +01:00
|
|
|
```
|
2020-08-20 17:16:19 +02:00
|
|
|
|
|
|
|
|
### Sipeed Lichee Tang
|
|
|
|
|
|
2020-08-21 14:07:28 +02:00
|
|
|
For this target, *openFPGALoader* support *svf* and *bit*
|
|
|
|
|
|
2020-08-24 08:59:01 +02:00
|
|
|
__bit file load (memory)__
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
openFPGALoader -m -b licheeTang /somewhere/project/prj/*.bit
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Since *-m* is the default, this argument is optional
|
|
|
|
|
|
|
|
|
|
__bit file load (spi flash)__
|
2020-08-21 14:07:28 +02:00
|
|
|
|
|
|
|
|
```bash
|
2020-08-24 08:59:01 +02:00
|
|
|
openFPGALoader -f -b licheeTang /somewhere/project/prj/*.bit
|
2020-08-21 14:07:28 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
__svf file load__
|
|
|
|
|
|
|
|
|
|
It's possible to produce this file by using *TD*:
|
|
|
|
|
* Tools->Device Chain
|
|
|
|
|
* Add your bit file
|
|
|
|
|
* Option : Create svf
|
|
|
|
|
|
|
|
|
|
or by using [prjtang project](https://github.com/mmicko/prjtang)
|
2020-08-20 17:16:19 +02:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
mkdir build
|
|
|
|
|
cd build
|
|
|
|
|
cmake ../
|
|
|
|
|
make
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Now a file called *tangbit* is present in current directory and has to be used as
|
|
|
|
|
follow:
|
|
|
|
|
```bash
|
|
|
|
|
tangbit --input /somewhere.bit --svf bitstream.svf
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
openFPGALoader -b licheeTang /somewhere/*.svf
|
|
|
|
|
```
|