μHAL
util_sdb.h File Reference
#include <optional>
#include <vector>
#include "pcie-defs.h"
#include "sdb-defs.h"
Include dependency graph for util_sdb.h:

Go to the source code of this file.

Functions

std::optional< struct sdb_device_inforead_sdb (struct pcie_bars *, device_match_fn, unsigned)
 
std::vector< struct sdb_synthesis_infoget_synthesis_info (struct pcie_bars *)
 

Detailed Description

This file contains the functions used to query a Self Describing Bus (SDB) filesystem.

Function Documentation

◆ read_sdb()

std::optional< struct sdb_device_info > read_sdb ( struct pcie_bars bars,
device_match_fn  device_match,
unsigned  pos 
)

This function navigates the SDB filesystem and passes decoded SDB product entries to device_match. When device_match returns true for the pos -th time, this function returns that SDB device's information; the address can be used to locate the device's register map, and the version information makes it possible to gate functionality behind version checks. If device_match is null, pos is ignored and this function simply prints all SDB information.