fmapi

package
v0.0.0-...-c74ab33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fmapi provides the interface to interact with the Fabric machine (hardware accelerators implemented on an FPGA board, accessed through PCIe).

config.go implements utilities to read Fabric machine's configuration data.

regmap.go implements Fabric machine's register map and providies utilities to read/write the registers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHardwareAddress

func GetHardwareAddress() string

func GetOrderers

func GetOrderers() []string

func GetPcieResourceFile

func GetPcieResourceFile() string

func GetStartingBlock

func GetStartingBlock() uint64

func InitConfig

func InitConfig(fabricConfigReader *viper.Viper) error

func IsEnabled

func IsEnabled() bool

func IsSwStateDbEnabled

func IsSwStateDbEnabled() bool

func ResetFpgaCard

func ResetFpgaCard() bool

Types

type BlockData

type BlockData struct {
	Num         uint64
	NumTxs      uint32
	Valid       bool
	TxsVldFlags txflags.ValidationFlags
	Latency     time.Duration
}

type FabricMachine

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

func NewFabricMachine

func NewFabricMachine(pcieResourceFile string) (*FabricMachine, error)

NewFabricMachine returns a Fabric machine instance. It resets the Fabric machine to ensure a consistent initial state.

func (*FabricMachine) Close

func (fm *FabricMachine) Close() error

func (*FabricMachine) GetBlockData

func (fm *FabricMachine) GetBlockData(blockNum uint64, numTries int) (*BlockData, error)

GetBlockData returns block data after reading from the Fabric machine. This function will only return when the block is available, unless numTries > 0 in which case it will return after trying for numTries. Do not read a block again after it has been successfully read, because that messes up the synchronization between the hardware and software. If you do that, data returned for subsequent blocks may be corrupted.

type FabricMachineConfig

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

type RegMap

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

func NewRegMap

func NewRegMap(pcieResourceFile string) (*RegMap, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL