Documentation ¶
Index ¶
Constants ¶
const ( ReadOnly = iota WriteOnly ReadWrite )
Constants for opening RAM on the FGPA
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
Kernel is a a function that runs on an FGPA.
func (*Kernel) Run ¶
Run will start execution of the Kernel with the number of dimensions. Most uses of this should be called as
kernel.Run()
func (*Kernel) SetArg ¶
SetArg passes the uint32 as an argument to the Kernel. The resulting type on the kernel will be a uint32.
func (*Kernel) SetMemoryArg ¶
SetMemoryArg passes the pointer to Memory as an argument to the Kernel. The resulting type on the kernel will be a uintptr.
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory represents a segment of RAM on the FGPA
func (*Memory) Reader ¶
func (mem *Memory) Reader() *MemoryReader
Reader constructs a one-time use reader for a Memory. This has the standard io.Reader interface. For example, to copy from the FPGA with the binary package:
var input [256]uint32 err := binary.Read(buff.Reader(), binary.LittleEndian, &input)
func (*Memory) Writer ¶
func (mem *Memory) Writer() *MemoryWriter
Writer constructs a one-time use writer for a Memory. This has the standard io.Writer interface. For example, to copy data to the FPGA with the binary package:
var input [256]uint32 err := binary.Write(buff.Writer(), binary.LittleEndian, &input)
type MemoryReader ¶
type MemoryReader struct {
// contains filtered or unexported fields
}
MemoryReader is an io.Reader to RAM on the FPGA
type MemoryWriter ¶
type MemoryWriter struct {
// contains filtered or unexported fields
}
MemoryWriter is an io.Writer to RAM on the FPGA
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program ways to lookup kernels
func (*Program) GetKernel ¶
GetKernel will return the specific Kernel from the Program. The input argument is the name of the Kernel in the Program (typically "reconfigure_io_sdaccel_builder_stub_0_1").
This needs to be released when done.
kernel := program.GetKernel("reconfigure_io_sdaccel_builder_stub_0_1") defer kernel.Release()
type World ¶
type World struct { }
World is an opaque structure that allows communication with FPGAs.
func NewWorld ¶
func NewWorld() World
NewWorld creates a new World. This needs to be released when done. This can be done using `defer`
world := xcl.NewWorld() defer world.Release()
func (World) Import ¶
Import will search for an appropriate xclbin and load their contents, either in a simulator for hardware simulation, or onto an FPGA for actual hardware. The input argument is the name of the program from the build procedure (typically "kernel_test"). The returned value is the program used for interacting with the loaded xclbin.
This needs to be released when done. This can be done using defer.
program := world.Import("kernel_test") defer program.Release()