program-ice40-sram

CLI reference

glasgow run program-ice40-sram

Program the volatile bitstream memory of iCE40 FPGAs.

usage: glasgow run program-ice40-sram [-h] [-V VOLTS] [--cs PIN] [--sck PIN]
                                      [--copi PIN] [--reset PIN] [--done PIN]
                                      [-f FREQ]
                                      BITSTREAM
bitstream

bitstream file

-h, --help

show this help message and exit

-V <volts>, --voltage <volts>

FPGA power (range: 1.8..5 V, or ‘S<port>’ to follow the voltage sensed on a port; default: unchanged)

--cs <pin>

bind chip select (SS_B) to PIN (default: ‘A0’, required)

--sck <pin>

bind serial clock to PIN (default: ‘A1’, required)

--copi <pin>

bind controller out, peripheral in to PIN (default: ‘A2’, required)

--reset <pin>

bind FPGA reset (CRESET_B, active low) to PIN (default: ‘A3’, required)

--done <pin>

bind FPGA configuration done (CDONE) to PIN (default: ‘A4’, optional)

-f <freq>, --frequency <freq>

set SCK frequency to FREQ kHz (default: 12000)

API reference

exception glasgow.applet.program.ice40_sram.ICE40SRAMError
class glasgow.applet.program.ice40_sram.ICE40SRAMPorts(*, supply: glasgow.abstract.GlasgowSupply, cs: amaranth.lib.io.PortLike, sck: amaranth.lib.io.PortLike, copi: amaranth.lib.io.PortLike, reset: amaranth.lib.io.PortLike, done: amaranth.lib.io.PortLike | None)
supply: GlasgowSupply

FPGA power

cs: PortLike

chip select (SS_B)

sck: PortLike

serial clock

copi: PortLike

controller out, peripheral in

reset: PortLike

FPGA reset (CRESET_B, active low)

done: PortLike | None

FPGA configuration done (CDONE)

class glasgow.applet.program.ice40_sram.ICE40SRAMInterface(logger: Logger, assembly: AbstractAssembly, ports: ICE40SRAMPorts)
property clock: ClockDivisor

SCK clock divisor.

async load(bitstream: Buffer)

Load bitstream into configuration SRAM.

Raises:

ICE40SRAMError – If the CDONE pin is present and was not asserted within 100 ms after the bitstream has been shifted in.