shithub: 9ferno

ref: b502a62da2ec6058923db94f87ecc2d29db2fa77
dir: /man/3/fpga/

View raw version
fpga \- interface to on-board FPGA
.B "bind -a #F /dev"
.B /dev/fpgaclk
.B /dev/fpgactl
.B /dev/fpgamemb
.B /dev/fpgamemw
.B /dev/fpgaprog
.B /dev/fpgastatus
.I Fpga
allows configuration of an on-board FPGA (eg, the Altera Flex6000 on the Bright Star Engineering ip-Engine),
control of its clocks and environment, and raw access to any devices presented in the FPGA address space.
On booting, the FPGA subsystem is normally left powered down and the system's external clocks are not directed to
the processor's output pins, to conserve power if the subsystem is unused.
The control file
.B fpgactl
accepts the following requests:
.TF "power off"
.BI bclk " n"
Set BCLK output to
.I n
.I n
must be a divisor of the system clock frequency (eg, of 48 if the system is running at 48 MHz).
.BI power
Power up the FPGA subsystem (that is automatically done when
.B fpgaprog
is accessed).
.B "power off"
Power down the FPGA subsystem.
.B reset
Reset the FPGA, forcing it into configuration mode (automatically done when
.B fpgaprog
is accessed).
.BI vclk " n m v r"
Program the clock synthesiser with the given parameters, and enable its output as VCLK.
.B "vclk off"
Disable output from the clock synthesiser.
The files
.B fpgamemb
.B fpgamemw
give 8-bit and 16-bit access respectively to the address space interpreted by the FPGA.
The file offset is the address read or written within that space;
offset and count must both be even for
.BR fpgamemw .
The interpretation of the data, including the data format and
whether byte or word access is required, is completely determined
by the program configured into the FPGA.
The write-only file
.B fpgaprog
configures the device.
A single write provides an FPGA configuration in raw binary format.
The FPGA subsystem is given power, the processor's clocks are made visible externally, and the
device is configured with the data written.
The write returns an error if configuration fails.
The read-only file
.B fpgastatus
contains a single line of text giving the state of the two status bits in the FPGA interface.
The word
.B config
appears if
is set, and
.B !config
otherwise; the word
.B status
appears if
is set, and
.B !status
.B /os/ipengine/devfpga.c
.IR fpgaload (8)