src/latticeBitParser: support machxo2 (check compress & fill vector<string>)

This commit is contained in:
Gwenhael Goavec-Merou
2022-11-26 12:06:24 +01:00
parent b078aa393a
commit 2d885ce064
2 changed files with 114 additions and 28 deletions
+17 -5
View File
@@ -1,26 +1,38 @@
// SPDX-License-Identifier: Apache-2.0
/*
* Copyright (C) 2019 Gwenhael Goavec-Merou <[email protected]>
* Copyright (C) 2019-2022 Gwenhael Goavec-Merou <[email protected]>
*/
#ifndef LATTICEBITPARSER_HPP_
#define LATTICEBITPARSER_HPP_
#ifndef SRC_LATTICEBITPARSER_HPP_
#define SRC_LATTICEBITPARSER_HPP_
#include <iostream>
#include <fstream>
#include <map>
#include <string>
#include <vector>
#include "configBitstreamParser.hpp"
class LatticeBitParser: public ConfigBitstreamParser {
public:
LatticeBitParser(const std::string &filename, bool verbose = false);
LatticeBitParser(const std::string &filename, bool machxo2,
bool verbose = false);
~LatticeBitParser();
int parse() override;
/*!
* \brief return configuration data with structure similar to jedec
* \return configuration data
*/
std::vector<std::string> getDataArray() {return _bit_array;}
private:
int parseHeader();
bool parseCfgData();
size_t _endHeader;
bool _is_machXO2;
/* data storage for machXO2 */
std::vector<std::string> _bit_array;
};
#endif // LATTICEBITPARSER_HPP_
#endif // SRC_LATTICEBITPARSER_HPP_