13namespace ChimeraTK::detail {
19 class TraditionalMapFileParser {
21 explicit TraditionalMapFileParser(std::string fileName);
30 std::pair<NumericAddressedRegisterCatalogue, MetadataCatalogue> parse(std::ifstream& stream);
35 RegisterPath pathName;
36 uint32_t nElements{0};
41 int32_t nFractionalBits{0};
42 bool signedFlag{
true};
45 std::vector<size_t> interruptID;
55 static std::pair<RegisterPath, std::string> splitStringAtLastDot(RegisterPath moduleDotName);
57 static std::pair<NumericAddressedRegisterInfo::Type, int> getTypeAndNFractionalBits(
58 const std::string& bitInterpretation, uint32_t width);
61 static std::vector<size_t> getInterruptId(std::string accessType);
65 uint64_t bar, uint32_t width, int32_t nFractionalBits,
bool signedFlag);
67 void parseMetaData(std::string line);
69 ParsedLine parseLine(
const std::string& line);
75 void handle2D(
const ParsedLine& pl);
81 void handle2DNewStyle(
const ParsedLine& pl);
87 static bool isScalarOr1D(
const RegisterPath& pathName);
93 static bool is2D(
const RegisterPath& pathName);
99 static bool is2DNewStyle(RegisterPath pathName);
104 static RegisterPath makeSequenceName(
const RegisterPath& pathName,
size_t index);
109 static RegisterPath make2DName(
const RegisterPath& pathName,
const std::string& prefix);
115 void make2DRegisterInfos(
const ParsedLine& pl, std::list<ParsedLine>& channelLines,
const std::string& prefix);
117 NumericAddressedRegisterCatalogue _pmap;
118 MetadataCatalogue _metadataCatalogue;
120 std::string _fileName;
121 uint32_t _lineNo = 0;
123 std::vector<ParsedLine> _parsedLines;
124 std::map<RegisterPath, const ParsedLine&> _parsedLinesMap;
Access
Enum describing the access mode of the register:
Type
Enum descibing the data interpretation: