Skip to content

Commit

Permalink
xilinx: replaced reverseWord by configBitstreamParser::reverse_32
Browse files Browse the repository at this point in the history
  • Loading branch information
trabucayre committed Nov 9, 2024
1 parent e75e15b commit 0fd653e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/xilinx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,15 +850,6 @@ void Xilinx::program_mem(ConfigBitstreamParser *bitfile)
}
}

static uint32_t reverseWord(uint32_t in) {
uint32_t out = 0;
for (int i = 0; i < 32; i++) {
out <<= 1;
out |= (in >> i) & 0x01;
}
return out;
}

static uint32_t char_array_to_word(uint8_t *in)
{
return (((uint32_t)in[3] << 24) |
Expand Down Expand Up @@ -1037,7 +1028,7 @@ uint32_t Xilinx::dumpRegister(std::string reg_name)
for (int i = 0; i < 5; i++) {
if (i == 4)
next_state = Jtag::SELECT_IR_SCAN;
const uint32_t tmp = reverseWord(cfg_packets[i]);
const uint32_t tmp = BitParser::reverse_32(cfg_packets[i]);
const uint8_t cfg[] = {
static_cast<uint8_t>((tmp >> 0) & 0xff),
static_cast<uint8_t>((tmp >> 8) & 0xff),
Expand All @@ -1053,7 +1044,7 @@ uint32_t Xilinx::dumpRegister(std::string reg_name)
_jtag->go_test_logic_reset();

uint32_t reg_word = char_array_to_word(reg);
reg_word = reverseWord(reg_word);
reg_word = BitParser::reverse_32(reg_word);
return reg_word;
}

Expand Down

0 comments on commit 0fd653e

Please sign in to comment.