Documentation ¶
Index ¶
- Constants
- type Bitstream
- type File
- type FileAOCX
- func (f *FileAOCX) AcceleratorTypeUUID() (ret string)
- func (f *FileAOCX) Close() (err error)
- func (f *FileAOCX) ExtraMetadata() map[string]string
- func (f *FileAOCX) InstallPath(root string) (ret string)
- func (f *FileAOCX) InterfaceUUID() (ret string)
- func (f *FileAOCX) RawBitstreamData() ([]byte, error)
- func (f *FileAOCX) RawBitstreamReader() io.ReadSeeker
- func (f *FileAOCX) UniqueUUID() string
- type FileGBS
- func (f *FileGBS) AcceleratorTypeUUID() (ret string)
- func (f *FileGBS) Close() (err error)
- func (f *FileGBS) ExtraMetadata() map[string]string
- func (f *FileGBS) InstallPath(root string) (ret string)
- func (f *FileGBS) InterfaceUUID() string
- func (f *FileGBS) RawBitstreamData() ([]byte, error)
- func (f *FileGBS) RawBitstreamReader() io.ReadSeeker
- func (f *FileGBS) UniqueUUID() string
- type Header
- type Metadata
Constants ¶
const (
// OpenCLUUID is a special AFU UUID that is used for all OpenCL BSP based FPGA bitstreams.
OpenCLUUID = "18b79ffa2ee54aa096ef4230dafacb5f"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitstream ¶
type Bitstream struct { Size uint64 // Embed ReaderAt for ReadAt method. // Do not embed SectionReader directly // to avoid having Read and Seek. // If a client wants Read and Seek it must use // Open() to avoid fighting over the seek offset // with other clients. io.ReaderAt // embed common bitstream interfaces File // contains filtered or unexported fields }
A Bitstream represents a raw bitsream data (RBF) in the GBS binary.
func (*Bitstream) Open ¶
func (b *Bitstream) Open() io.ReadSeeker
Open returns a new ReadSeeker reading the bitsream body.
type File ¶
type File interface { io.Closer // RawBitstreamReader returns Reader for raw bitstream data RawBitstreamReader() io.ReadSeeker // RawBitstreamData returns raw bitstream byte array RawBitstreamData() ([]byte, error) // InterfaceUUID returns bitstream's Interface UUID InterfaceUUID() string // AcceleratorTypeUUID returns bitstream's AFU UUID AcceleratorTypeUUID() string // UniqueUUID returns UUID that uniquely identifies bitstream UniqueUUID() string // InstallPath returns unique filename for bitstream relative to given directory InstallPath(string) string // ExtraMetadata returns map of key/value with additional metadata that can be detected from bitstream ExtraMetadata() map[string]string }
File defines interfaces that are common for all supported bitstream file formats It should provide mechanisms to get raw bitstream data as a reader or as a byte array as well as mechanisms to identify bitstreams.
func GetFPGABitstream ¶
GetFPGABitstream scans bitstream storage and returns first found bitstream by region and afu id.
type FileAOCX ¶
type FileAOCX struct { AutoDiscovery string AutoDiscoveryXML string Board string BoardPackage string BoardSpecXML string CompilationEnvironment string Hash string KernelArgInfoXML string QuartusInputHash string QuartusReport string Target string Version string GBS *FileGBS // embed common bitstream interfaces File // contains filtered or unexported fields }
A FileAOCX represents an open AOCX file.
func NewFileAOCX ¶
NewFileAOCX creates a new File for accessing an ELF binary in an underlying reader. The ELF binary is expected to start at position 0 in the ReaderAt.
func (*FileAOCX) AcceleratorTypeUUID ¶
AcceleratorTypeUUID returns underlying GBS AFU ID.
func (*FileAOCX) Close ¶
Close closes the FileAOCX. If the FileAOCX was created using NewFileAOCX directly instead of Open, Close has no effect.
func (*FileAOCX) ExtraMetadata ¶
ExtraMetadata returns map of key/value with additional metadata that can be detected from bitstream.
func (*FileAOCX) InstallPath ¶
InstallPath returns unique filename for bitstream relative to given directory.
func (*FileAOCX) InterfaceUUID ¶
InterfaceUUID returns underlying GBS InterfaceUUID.
func (*FileAOCX) RawBitstreamData ¶
RawBitstreamData returns raw bitstream data.
func (*FileAOCX) RawBitstreamReader ¶
func (f *FileAOCX) RawBitstreamReader() io.ReadSeeker
RawBitstreamReader returns Reader for raw bitstream data.
func (*FileAOCX) UniqueUUID ¶
UniqueUUID represents the unique field that identifies bitstream. For AOCX it is the unique Hash in the header.
type FileGBS ¶
type FileGBS struct { Header Metadata Metadata Bitstream *Bitstream // contains filtered or unexported fields }
FileGBS represents an open GBS file.
func NewFileGBS ¶
NewFileGBS creates a new FileGBS for accessing an ELF binary in an underlying reader. The ELF binary is expected to start at position 0 in the ReaderAt.
func (*FileGBS) AcceleratorTypeUUID ¶
AcceleratorTypeUUID returns list of normalized AFU UUID from the metadata. Empty string returned in case of errors in Metadata.
func (*FileGBS) Close ¶
Close closes the FileGBS. If the FileGBS was created using NewFileGBS directly instead of Open, Close has no effect.
func (*FileGBS) ExtraMetadata ¶
ExtraMetadata returns map of key/value with additional metadata that can be detected from bitstream.
func (*FileGBS) InstallPath ¶
InstallPath returns unique filename for bitstream relative to given directory.
func (*FileGBS) InterfaceUUID ¶
InterfaceUUID returns normalized Metadata.AfuImage.InterfaceUUID.
func (*FileGBS) RawBitstreamData ¶
RawBitstreamData returns raw bitstream data.
func (*FileGBS) RawBitstreamReader ¶
func (f *FileGBS) RawBitstreamReader() io.ReadSeeker
RawBitstreamReader returns Reader for raw bitstream data.
func (*FileGBS) UniqueUUID ¶
UniqueUUID represents the unique field that identifies bitstream. For GBS it is the AFU ID.
type Metadata ¶
type Metadata struct { Version int `json:"version"` PlatformName string `json:"platform-name,omitempty"` AfuImage struct { MagicNo int `json:"magic-no,omitempty"` InterfaceUUID string `json:"interface-uuid,omitempty"` AfuTopInterface struct { Class string `json:"class"` ModulePorts []struct { Params struct { Clock string `json:"clock,omitempty"` } `json:"params"` Optional bool `json:"optional,omitempty"` Class string `json:"class,omitempty"` } `json:"module-ports,omitempty"` } `json:"afu-top-interface"` Power int `json:"power"` ClockFrequencyHigh interface{} `json:"clock-frequency-high,omitempty"` ClockFrequencyLow interface{} `json:"clock-frequency-low,omitempty"` AcceleratorClusters []struct { AcceleratorTypeUUID string `json:"accelerator-type-uuid"` Name string `json:"name"` TotalContexts int `json:"total-contexts"` } `json:"accelerator-clusters"` } `json:"afu-image"` }
Metadata represents parsed JSON metadata of GBS file.