Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
235505c66This file is pinned to the selected release. Download the original to open it in your design tool.
#ifndef CONFIGBITSTREAMPARSER_H
#define CONFIGBITSTREAMPARSER_H
#include <iostream>
#include <fstream>
#include <stdint.h>
#include <map>
class ConfigBitstreamParser {
public:
ConfigBitstreamParser(const std::string &filename, int mode = ASCII_MODE,
bool verbose = false);
virtual ~ConfigBitstreamParser();
virtual int parse() = 0;
uint8_t *getData() {return (uint8_t*)_bit_data.c_str();}
int getLength() {return _bit_length;}
enum {
ASCII_MODE = 0,
BIN_MODE = std::ifstream::binary
};
static uint8_t reverseByte(uint8_t src);
protected:
std::string _filename;
int _bit_length;
int _file_size;
bool _verbose;
std::ifstream _fd;
std::string _bit_data;
std::map<std::string, std::string> _hdr;
};
#endif