irioCoreCpp Library Module  2.1.0
irio::bfp::BFP Class Reference

BitFile Parser. More...

#include <bfp.h>

Public Member Functions

 BFP (const std::string &bitfile, const bool warnUnsupported=true)
 Parse the specified bitfile. More...
 
std::string getBitfilePath () const
 Return the path of the parsed Bitfile. More...
 
std::string getBitfileVersion () const
 Returns the Bitfile version. More...
 
std::string getSignature () const
 Return the Bitfile' signature. More...
 
std::unordered_map< std::string, RegistergetRegisters () const
 Get map with all the registers parsed, the key is the register name (without spaces) More...
 
Register getRegister (const std::string &registerName) const
 Get specific register. More...
 
std::unordered_map< std::string, DMAgetDMAs () const
 Get map with all the DMAs parsed, the key if the DMA name (without spaces) More...
 
DMA getDMA (const std::string &dmaName) const
 Get specific DMA. More...
 

Private Attributes

const std::string m_bitfilePath
 Path to the bitfile to be parsed.
 
std::string m_signature
 Bitfile's signature.
 
std::uint32_t m_baseAddress
 Bitfile's base address.
 
std::string m_bitfileVersion
 Bitfile's version.
 
std::unordered_map< std::string, Registerm_regMap
 Map storing the data of the registers parsed, using their names as keys.
 
std::unordered_map< std::string, DMAm_dmaMap
 Map storing the data of the DMAs parsed, using their names as keys.
 

Detailed Description

BitFile Parser.

Manages parsing a bitfile and extracting the Registers and DMAs on it. It also extracts the signature and Bitfile version.

Definition at line 20 of file bfp.h.

Constructor & Destructor Documentation

◆ BFP()

irio::bfp::BFP::BFP ( const std::string &  bitfile,
const bool  warnUnsupported = true 
)
explicit

Parse the specified bitfile.

Exceptions
irio::errors::BFPParseBitfileErrorUnable to parse bitfile
Parameters
bitfileBitfile to parse
warnUnsupportedIf true, a message will be printed by std::cerr informing of the registers found with an unsupported type

Member Function Documentation

◆ getBitfilePath()

std::string irio::bfp::BFP::getBitfilePath ( ) const

Return the path of the parsed Bitfile.

Returns
Path of the parsed Bitfile

◆ getBitfileVersion()

std::string irio::bfp::BFP::getBitfileVersion ( ) const

Returns the Bitfile version.

Returns
String with the Bitfile version

◆ getDMA()

DMA irio::bfp::BFP::getDMA ( const std::string &  dmaName) const

Get specific DMA.

Throws a runtime exception if not found.

Exceptions
irio::errors::ResourceNotFoundErrorSpecified dmaName not found
Parameters
dmaNameDMA name to get
Returns
DMA found

◆ getDMAs()

std::unordered_map<std::string, DMA> irio::bfp::BFP::getDMAs ( ) const

Get map with all the DMAs parsed, the key if the DMA name (without spaces)

Returns
Map with the DMAs

◆ getRegister()

Register irio::bfp::BFP::getRegister ( const std::string &  registerName) const

Get specific register.

Throws a runtime exception if not found.

Exceptions
irio::errors::ResourceNotFoundErrorSpecified registerName not found
Parameters
registerNameRegister name to get
Returns
Register found

◆ getRegisters()

std::unordered_map<std::string, Register> irio::bfp::BFP::getRegisters ( ) const

Get map with all the registers parsed, the key is the register name (without spaces)

Returns
Map with the registers

◆ getSignature()

std::string irio::bfp::BFP::getSignature ( ) const

Return the Bitfile' signature.

Returns
Bitfile' signature

The documentation for this class was generated from the following file: