From f00011c8fdf4c2af6df26f8792b40255e166de12 Mon Sep 17 00:00:00 2001 From: Tomasz Michalak Date: Tue, 1 Dec 2020 15:16:20 +0100 Subject: [PATCH] bitread: Make private members const and add some comments Signed-off-by: Tomasz Michalak --- lib/include/prjxray/xilinx/bitstream_reader.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/include/prjxray/xilinx/bitstream_reader.h b/lib/include/prjxray/xilinx/bitstream_reader.h index 094371ad..35224bb9 100644 --- a/lib/include/prjxray/xilinx/bitstream_reader.h +++ b/lib/include/prjxray/xilinx/bitstream_reader.h @@ -84,9 +84,9 @@ class BitstreamReader { iterator end(); private: - static std::array kSyncWord; - const std::vector kWcfgCmd = {0x30008001, 0x1}; - const std::vector kNullCmd = {0x30008001, 0x0}; + static const std::array kSyncWord; + static const std::array kWcfgCmd; + static const std::array kNullCmd; std::vector words_; }; @@ -170,9 +170,19 @@ BitstreamReader::InitWithBytes(T bitstream) { // Sync word as specified in UG470 page 81 template -std::array BitstreamReader::kSyncWord{0xAA, 0x99, 0x55, +const std::array BitstreamReader::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 +template +const std::array BitstreamReader::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 +template +const std::array BitstreamReader::kNullCmd = {0x30008001, 0x0}; + template typename BitstreamReader::iterator BitstreamReader::begin() {