Skip to content

Commit

Permalink
bitread: Don't overwrite last frame
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Michalak <[email protected]>
  • Loading branch information
tmichalak committed May 19, 2020
1 parent acb6210 commit 103f1cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/include/prjxray/xilinx/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Configuration<ArchType>::InitWithPackets(const typename ArchType::Part& part,
typename ArchType::FrameAddress current_frame_address = 0;

Configuration<ArchType>::FrameMap frames;
bool configuration_data_end = false;
for (auto packet : packets) {
if (packet.opcode() !=
ConfigurationPacket<
Expand Down Expand Up @@ -305,6 +306,8 @@ Configuration<ArchType>::InitWithPackets(const typename ArchType::Part& part,
frame_address_register;
start_new_write = false;
}
if (configuration_data_end)
break;

// Number of words in configuration frames
// depend on tje architecture. Writes to this
Expand All @@ -319,8 +322,10 @@ Configuration<ArchType>::InitWithPackets(const typename ArchType::Part& part,
auto next_address =
part.GetNextFrameAddress(
current_frame_address);
if (!next_address)
if (!next_address) {
configuration_data_end = true;
break;
}

// Bitstreams appear to have 2 frames of
// padding between rows.
Expand Down

0 comments on commit 103f1cc

Please sign in to comment.