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 ¶
- func GetHardwareAddress() string
- func GetOrderers() []string
- func GetPcieResourceFile() string
- func GetStartingBlock() uint64
- func InitConfig(fabricConfigReader *viper.Viper) error
- func IsEnabled() bool
- func IsSwStateDbEnabled() bool
- func ResetFpgaCard() bool
- type BlockData
- type FabricMachine
- type FabricMachineConfig
- type RegMap
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 IsSwStateDbEnabled ¶
func IsSwStateDbEnabled() bool
func ResetFpgaCard ¶
func ResetFpgaCard() bool
Types ¶
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
}