NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
Public Member Functions | List of all members
DAQ::DDAS::FirmwareVersionFileParser Class Reference

A parser for the DDAS firmware specification file. More...

#include <FirmwareVersionFileParser.h>

Public Member Functions

 FirmwareVersionFileParser ()
 Constructor. More...
 
void parse (std::istream &input, FirmwareMap &config)
 Main entry point for parsing DDASFirmwareVersions.txt. More...
 

Detailed Description

A parser for the DDAS firmware specification file.

The FirmwareVersionFileParser is designed to parse the DDASFirmwareVersions.txt file that is installed by the project. The DDASFirmwareVersions.txt file has two major sections. The top section contains fpga firmware file paths and the bottom section provides the paths to dsp configuration code. The format of this file can be observed in DDASFirmwareVersions.txt.in , which is the template file used by automake to generate the DDASFirmwareVersion.txt file.

Ultimately, the contents of the DDASFirmwareVersions.txt file will be stored in the Configuration object passed in as an argument to the parse() method. That object will keep a database of the firmware files organized by their associated hardware type.

Constructor & Destructor Documentation

◆ FirmwareVersionFileParser()

DAQ::DDAS::FirmwareVersionFileParser::FirmwareVersionFileParser ( )

Constructor.

Regular expression matching

"(^\[Rev([xXa-fA-F0-9]+)-(\d+)Bit-(\d+)MSPS\]$)" 

to extract the firmware, bit depth, and module MSPS.

Member Function Documentation

◆ parse()

void DAQ::DDAS::FirmwareVersionFileParser::parse ( std::istream &  input,
FirmwareMap config 
)

Main entry point for parsing DDASFirmwareVersions.txt.

Parameters
inputThe stream to read file content from.
configThe FirmwareMap in which to store this.
Exceptions
std::runtime_errorIf the DDASFirmwareVersionFile.txt is missing any expected field.

Any firmware configurations that were stored in the configuration object before this will be overwritten with new content.

Todo:
(ASC 3/13/24): CFWFileParseError for exceptions.

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