2019-09-26 18:27:33 +02:00
|
|
|
# cycloader
|
2019-11-18 16:05:33 +01:00
|
|
|
Utility for programming Intel/Altera Cyclone Xilinx Serie 7 and Lattice MachXO3
|
2019-09-26 18:53:30 +02:00
|
|
|
|
|
|
|
|
Current support:
|
|
|
|
|
* Trenz cyc1000 Cyclone 10 LP 10CL025 (memory and spi flash)
|
2019-10-05 19:40:43 +02:00
|
|
|
* Digilent arty Artix xc7a35ti (memory and spi flash)
|
2019-11-18 16:05:33 +01:00
|
|
|
* Lattice MachXO3LF Starter Kit LCMX03LF-6900C (flash)
|
2019-11-19 16:04:04 +01:00
|
|
|
* Digilent JTAG-HS3 programming cable
|
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
|
2019-11-19 09:17:04 +01:00
|
|
|
apt-get install libftdi1-2 libftdi1-dev libftdipp1-3 libftdipp1-dev libudev-dev
|
2019-09-26 18:53:30 +02:00
|
|
|
```
|
2019-10-05 12:00:29 +02:00
|
|
|
and if not already done, install **pkg-config**, **make** and **g++**.
|
2019-09-26 18:53:30 +02:00
|
|
|
|
|
|
|
|
To build the app:
|
|
|
|
|
```bash
|
|
|
|
|
$ make
|
|
|
|
|
```
|
|
|
|
|
To install
|
|
|
|
|
```bash
|
|
|
|
|
$ sudo make install
|
|
|
|
|
```
|
|
|
|
|
Currently, the install path is hardcoded to /usr/local
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cycloader --help
|
|
|
|
|
Usage: cycloader [OPTION...] BIT_FILE
|
|
|
|
|
cycloader -- a program to flash cyclone10 LP FPGA
|
|
|
|
|
|
|
|
|
|
-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)
|
2019-09-26 18:53:30 +02:00
|
|
|
-o, --offset=OFFSET start offset in EEPROM
|
|
|
|
|
-r, --reset reset FPGA after operations
|
|
|
|
|
-v, --verbose Produce verbose output
|
|
|
|
|
-?, --help Give this help list
|
|
|
|
|
--usage Give a short usage message
|
|
|
|
|
-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
|
|
|
|
|
cycloader -b theBoard
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
With cable:
|
|
|
|
|
```bash
|
|
|
|
|
cycloader -c theCable
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
With device node:
|
|
|
|
|
```bash
|
|
|
|
|
cycloader -d /dev/ttyUSBX
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**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.
|
|
|
|
|
|
|
|
|
|
**Note:** when -d is not provided, *cycloader* will opens the first *ftdi*
|
|
|
|
|
found, if more than one converter is connected to the computer,
|
|
|
|
|
the *-d* option is the better solution
|
|
|
|
|
|
|
|
|
|
#### Reset device
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cycloader [options] -r
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### load bitstream device (memory or flash)
|
|
|
|
|
```bash
|
|
|
|
|
cycloader [options] /path/to/bitstream.ext
|
|
|
|
|
```
|
|
|
|
|
|
2019-09-26 18:53:30 +02:00
|
|
|
### CYC1000
|
|
|
|
|
|
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-09-27 08:58:38 +02:00
|
|
|
cycloader -b cyc1000 project_name.svf
|
2019-09-26 18:53:30 +02:00
|
|
|
```
|
|
|
|
|
|
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
|
|
|
|
|
cycloader -b cyc1000 -r project_name_auto.rpd
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**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.**
|
|
|
|
|
|
2019-10-05 19:40:43 +02:00
|
|
|
### ARTY
|
|
|
|
|
|
|
|
|
|
To simplify further explanations, we consider the project is generated in the
|
|
|
|
|
current directory.
|
|
|
|
|
|
|
|
|
|
#### 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
|
|
|
|
|
cycloader -b arty *.runs/impl_1/*.bit
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### SPI flash:
|
|
|
|
|
.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
|
|
|
|
|
cycloader -b arty *.runs/impl_1/*.mcs
|
|
|
|
|
```
|
2019-11-18 16:05:33 +01:00
|
|
|
### MachXO3 Starter Kit
|
|
|
|
|
|
|
|
|
|
#### 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
|
|
|
|
|
cycloader -b machXO3SK impl1/*.jed
|
|
|
|
|
```
|