sdaccel: github.com/ReconfigureIO/sdaccel/xcl Index | Files

package xcl

import "github.com/ReconfigureIO/sdaccel/xcl"

Index

Package Files

fake.go

Constants

const (
    ReadOnly = iota
    WriteOnly
    ReadWrite
)

Constants for opening RAM on the FGPA

type Kernel Uses

type Kernel struct {
    // contains filtered or unexported fields
}

Kernel is a a function that runs on an FGPA.

func (*Kernel) Release Uses

func (kernel *Kernel) Release()

Release a previously acquired Kernel

func (*Kernel) Run Uses

func (kernel *Kernel) Run(_ ...uint)

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 Uses

func (kernel *Kernel) SetArg(index uint, val uint32)

SetArg passes the uint32 as an argument to the Kernel. The resulting type on the kernel will be a uint32.

func (*Kernel) SetMemoryArg Uses

func (kernel *Kernel) SetMemoryArg(index uint, mem *Memory)

SetMemoryArg passes the pointer to Memory as an argument to the Kernel. The resulting type on the kernel will be a uintptr.

type Memory Uses

type Memory struct {
    // contains filtered or unexported fields
}

Memory represents a segment of RAM on the FGPA

func (*Memory) Free Uses

func (mem *Memory) Free()

Free a previously allocated Memory.

func (*Memory) Reader Uses

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 Uses

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 Uses

type MemoryReader struct {
    // contains filtered or unexported fields
}

MemoryReader is an io.Reader to RAM on the FPGA

func (*MemoryReader) Read Uses

func (reader *MemoryReader) Read(bytes []byte) (n int, err error)

type MemoryWriter Uses

type MemoryWriter struct {
    // contains filtered or unexported fields
}

MemoryWriter is an io.Writer to RAM on the FPGA

func (*MemoryWriter) Write Uses

func (writer *MemoryWriter) Write(bytes []byte) (n int, err error)

type Program Uses

type Program struct {
    // contains filtered or unexported fields
}

Program ways to lookup kernels

func (*Program) GetKernel Uses

func (program *Program) GetKernel(kernelName string) *Kernel

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()

func (*Program) Release Uses

func (program *Program) Release()

Release a previously acquired Program.

type World Uses

type World struct {
}

World is an opaque structure that allows communication with FPGAs.

func NewWorld Uses

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 Uses

func (world World) Import(program string) *Program

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()

func (*World) Malloc Uses

func (world *World) Malloc(flags uint, size uint) *Memory

Malloc allocates a number of bytes on the FPGA. The resulting structure represents a pointer to Memory on the FGPA.

This needs to be freed when done.

buff := world.Malloc(xcl.WriteOnly, 512)
defer buff.Free()

func (*World) Release Uses

func (world *World) Release()

Release cleans up a previously created World.

Package xcl imports 1 packages (graph). Updated 2018-12-19. Refresh now. Tools for package owners.