Merge pull request #1513 from antmicro/fix_format

format: Fix formating in bits2rbt
This commit is contained in:
Robert Winkler 2020-12-12 10:50:17 +01:00 committed by GitHub
commit 483a89c292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 13 deletions

View File

@ -93,8 +93,7 @@ class BitstreamReader {
// Extract FPGA configuration logic information
template <typename ArchType>
void BitstreamReader<ArchType>::PrintFpgaConfigurationLogicData(
FILE* aux_fp) {
void BitstreamReader<ArchType>::PrintFpgaConfigurationLogicData(FILE* aux_fp) {
// Get the data before the first FDRI_WRITE command packet
const auto fpga_conf_end = std::search(
words_.cbegin(), words_.cend(), kWcfgCmd.cbegin(), kWcfgCmd.cend());
@ -167,18 +166,20 @@ BitstreamReader<ArchType>::InitWithBytes(T bitstream) {
// Sync word as specified in UG470 page 81
template <typename ArchType>
const std::array<uint8_t, 4> BitstreamReader<ArchType>::kSyncWord{0xAA, 0x99, 0x55,
0x66};
const std::array<uint8_t, 4> BitstreamReader<ArchType>::kSyncWord{0xAA, 0x99,
0x55, 0x66};
// Writing the WCFG(0x1) command in type 1 packet with 1 word to the CMD register (0x30008001)
// Refer to UG470 page 110
// Writing the WCFG(0x1) command in type 1 packet with 1 word to the CMD
// register (0x30008001) Refer to UG470 page 110
template <typename ArchType>
const std::array<uint32_t, 2> BitstreamReader<ArchType>::kWcfgCmd = {0x30008001, 0x1};
const std::array<uint32_t, 2> BitstreamReader<ArchType>::kWcfgCmd = {0x30008001,
0x1};
// Writing the NULL(0x0) command in type 1 packet with 1 word to the CMD register (0x30008001)
// Refer to UG470 page 110
// Writing the NULL(0x0) command in type 1 packet with 1 word to the CMD
// register (0x30008001) Refer to UG470 page 110
template <typename ArchType>
const std::array<uint32_t, 2> BitstreamReader<ArchType>::kNullCmd = {0x30008001, 0x0};
const std::array<uint32_t, 2> BitstreamReader<ArchType>::kNullCmd = {0x30008001,
0x0};
template <typename ArchType>
typename BitstreamReader<ArchType>::iterator

View File

@ -23,7 +23,8 @@ class ConfigurationPackets {
private:
using ConfigurationFrame = std::pair<uint32_t, std::vector<uint32_t>>;
using ConfigurationFrames = std::map<uint32_t, std::vector<uint32_t>>;
// Refer to UG470 page 109 for address of configuration registers and commands
// Refer to UG470 page 109 for address of configuration registers and
// commands
const uint32_t kCmdWrite = 0x30008000;
const uint32_t kFdriWrite = 0x30004000;
const uint32_t kFarWrite = 0x30002000;
@ -33,7 +34,8 @@ class ConfigurationPackets {
const uint32_t kFdriReg = 0x2;
const uint32_t kCmdReg = 0x4;
const uint32_t kWcfgCmd = 0x1;
// Writing the RCRC(0x7) command in type 1 packet with 1 word to the CMD register (0x30008001)
// Writing the RCRC(0x7) command in type 1 packet with 1 word to the CMD
// register (0x30008001)
const std::array<uint32_t, 2> kRCrcCmd = {{0x30008001, 0x7}};
size_t words_per_frame_;
std::string architecture_;

View File

@ -42,7 +42,7 @@ Header::Header(const std::string& line,
std::string Header::GetDate() {
int year, month, day, hour, min, sec;
std::replace_if(date_.begin(), date_.end(),
[](char c) { return c == '/' or c == ':'; }, ' ');
[](char c) { return c == '/' or c == ':'; }, ' ');
std::istringstream(date_) >> year >> month >> day >> hour >> min >> sec;
std::tm time_raw = {sec, min, hour, day, month - 1, year - 1900};
time_t time = mktime(&time_raw);