From 92509c5043ef973e458e2e958596fac434de6bc5 Mon Sep 17 00:00:00 2001 From: Rick Altherr Date: Fri, 15 Dec 2017 17:27:16 -0800 Subject: [PATCH] lib: xc7series: Fix frame address YAML decoding Need to manually translate row_half from human-readable form in YAML (top/bottom) to true/false. Requesting a Node as a uint8_t returns the first char in the YAML field rather than parsing the field as an integer. Just used unsigned ints and let the constructor force them to smaller types. Signed-off-by: Rick Altherr Signed-off-by: Tim 'mithro' Ansell --- .../xc7series/configuration_frame_address.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/xilinx/xc7series/configuration_frame_address.cc b/lib/xilinx/xc7series/configuration_frame_address.cc index 806b0fc1..5bcf48af 100644 --- a/lib/xilinx/xc7series/configuration_frame_address.cc +++ b/lib/xilinx/xc7series/configuration_frame_address.cc @@ -66,12 +66,21 @@ bool convert::decode( !node["column"] || !node["minor"]) return false; + bool row_half; + if (node["row_half"].as() == "top") { + row_half = false; + } else if (node["row_half"].as() == "bottom") { + row_half = true; + } else { + return false; + } + lhs = prjxray::xilinx::xc7series::ConfigurationFrameAddress( node["block_type"].as(), - node["row_half"].as(), - node["row"].as(), - node["column"].as(), - node["minor"].as()); + row_half, + node["row"].as(), + node["column"].as(), + node["minor"].as()); return true; }