From 7345f2630a3c292e2fc8d0d2fab9446c2057fdca Mon Sep 17 00:00:00 2001 From: Rick Altherr Date: Tue, 12 Dec 2017 18:49:10 -0800 Subject: [PATCH] lib: xc7series: Handle the curious case of Type 0 packets Type 0 shouldn't exist but bitstreams generated with BITSTREAM.GENERAL.DEBUGBITSTREAM=YES seem to use them as padding. Signed-off-by: Rick Altherr Signed-off-by: Tim 'mithro' Ansell --- lib/xilinx/xc7series/configuration_packet.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/xilinx/xc7series/configuration_packet.cc b/lib/xilinx/xc7series/configuration_packet.cc index fb4f9ea5..21fe01f5 100644 --- a/lib/xilinx/xc7series/configuration_packet.cc +++ b/lib/xilinx/xc7series/configuration_packet.cc @@ -17,6 +17,14 @@ ConfigurationPacket::InitWithWords(absl::Span words, uint32_t header_type = bit_field_get(words[0], 31, 29); switch (header_type) { + case 0x0: + // Type 0 is emitted at the end of a configuration row when + // BITSTREAM.GENERAL.DEBUGBITSTREAM is set to YES. These seem + // to be padding that are interepreted as NOPs. Since Type 0 + // packets don't exist according to UG470 and they seem to be + // zero-filled, just consume the bytes without generating a + // packet. + return {words.subspan(1), {}}; case 0x1: { Opcode opcode = static_cast( bit_field_get(words[0], 28, 27));