Attempt to read out the header of a Xilinx bitstream file.
More...
#include <flash.h>
Attempt to read out the header of a Xilinx bitstream file.
Definition at line 104 of file flash.h.
◆ XilinxBitInfo()
mrf::XilinxBitInfo::XilinxBitInfo |
( |
| ) |
|
|
inline |
◆ read()
bool mrf::XilinxBitInfo::read |
( |
std::istream & |
strm | ) |
|
Definition at line 405 of file flash.cpp.
407 static const char header[] =
"\0\x09\x0f\xf0\x0f\xf0\x0f\xf0\x0f\xf0\0\0\1";
409 std::vector<char> buf(
sizeof(header)-1);
411 if(strm.read(&buf[0], buf.size()).gcount()!=std::streamsize(buf.size()) || !std::equal(buf.begin(), buf.end(), header))
421 if(strm.read((
char*)&
id, 1).gcount()==0)
429 if(strm.read((
char*)&size, 2).gcount()!=2)
430 throw std::runtime_error(
"Truncated block header");
433 if(strm.read(&buf[0], buf.size()).gcount()!=std::streamsize(buf.size()))
434 throw std::runtime_error(
"Truncated block payload");
446 fprintf(stderr,
"Warning: attempting to ignore unknown block 0x%02x\n",
unsigned(
id));
451 std::string str(&buf[0]);
454 case 0x61: project.swap(str);
break;
455 case 0x62: part.swap(str);
break;
456 case 0x63: date.swap(str);
break;
457 case 0x64: time.swap(str);
break;
464 this->project.swap(project);
465 this->part.swap(part);
466 this->date.swap(date);
◆ date
std::string mrf::XilinxBitInfo::date |
◆ part
std::string mrf::XilinxBitInfo::part |
◆ project
std::string mrf::XilinxBitInfo::project |
The documentation for this struct was generated from the following files: