FPGA

Reverse-engineering the first FPGA chip, the XC2064

project icestorm, reverse-engineered lattice ice40

PDF, Memory Usage Guide for iCE40 Devices

yosys techlibs ice40

Home Page of Fall 2020 CPE480

icestick

Digikey ICE40HX1K-STICK-EVN

icestick_pinout

litex

jonnor/embeddedml
apt install python3-pip python3-venv gcc-riscv64-unknown-elf
python3 -m venv env
. env/bin/activate
pip install -r ~/dl/requirements-litex.txt
time python3 ~/dl/litex_setup.py --init --install --config=full

openFPGALoader

$ openFPGALoader --Version
openFPGALoader v1.0.0

write bitstream to flash:

$ openFPGALoader -b ice40_generic top.bin 
empty
Can't read iSerialNumber field from FTDI: considered as empty string
Jtag frequency : requested 6.00MHz    -> real 6.00MHz   
Parse file DONE
JEDEC ID: 0x20ba16
Detected: micron N25Q32 64 sectors size: 32Mb
00000000 00000000 00000000 00
start addr: 00000000, end_addr: 00010000
Erasing: [==================================================] 100.00%
Done
Writing: [==================================================] 100.00%
Done
Reset and Wait for CDONE:
Done

read back the contents of spi flash on lattice icestick:

$ iceprog top.bin 
init..
cdone: high
reset..
cdone: low
flash ID: 0x20 0xBA 0x16 0x10 0x00 0x00 0x23 0x71 0x32 0x74 0x15 0x00 0x95 0x00 0x39 0x18 0x05 0x17 0x05 0x71
file size: 32220
erase 64kB sector at 0x000000..
programming..
done.                 
reading..
VERIFY OK             
cdone: high
Bye.
$ openFPGALoader -b ice40_generic --dump-flash --file-size 32220 dump.bin
empty
Can't read iSerialNumber field from FTDI: considered as empty string
Jtag frequency : requested 6.00MHz    -> real 6.00MHz   
Read Flash JEDEC ID: 0x20ba16
Detected: micron N25Q32 64 sectors size: 32Mb
dump flash (May take time)
Open dump file DONE
Read flash : [==================================================] 100.00%
Done
Reset and Wait for CDONE:
Done
~/src/examples/ice40_i2c $ sha1sum top.bin dump.bin 
63683072c1c941e1ed51aa710f4cf7d28b6e0e33  top.bin
63683072c1c941e1ed51aa710f4cf7d28b6e0e33  dump.bin

verilator

"Taking a New Look at Verilator"