From bddf693d7b2a3b9fec4aa62cff828562aefa4559 Mon Sep 17 00:00:00 2001 From: Lin Date: Sun, 29 Sep 2024 12:22:02 +0800 Subject: [PATCH] read bin ready --- .../src/annotation/read_xml_unique_blocks.cpp | 19 ++++++++++++------- .../src/annotation/read_xml_unique_blocks.h | 5 +++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/openfpga/src/annotation/read_xml_unique_blocks.cpp b/openfpga/src/annotation/read_xml_unique_blocks.cpp index 87cb6873f..61f848e07 100644 --- a/openfpga/src/annotation/read_xml_unique_blocks.cpp +++ b/openfpga/src/annotation/read_xml_unique_blocks.cpp @@ -1,3 +1,7 @@ +#include +#include +#include + #include /* Headers from pugi XML library */ #include "pugixml.hpp" @@ -174,9 +178,9 @@ std::vector> read_bin_unique_instance_coords( /*read the unique block coordinate from a bin file */ vtr::Point read_bin_unique_block_coord( - const uniqueblockcap::BlockInfo::Reader& unique_block, std::string type) { + const uniqueblockcap::UniqueBlockPacked::Reader& unique_block, + uniqueblockcap::BlockType& type) { auto block_info = unique_block.getBlockInfo(); - std::string type = block_info.getType().Cstr(); int block_x = block_info.getX(); int block_y = block_info.getY(); type = block_info.getType(); @@ -195,12 +199,13 @@ int read_bin_unique_blocks(DeviceRRGSB& device_rr_gsb, const char* file_name, auto root = reader.getRoot(); if (root.hasAtomInfo()) { auto block_list = root.getAtomInfo(); - for (auto unqiue_block : block_list) { - std::string type; - vtr::Point block_coordinate = - read_bin_unique_block_coord(unique_block, type); /*get block coordinate and type*/ + for (auto unique_block : block_list) { + uniqueblockcap::BlockType type; + vtr::Point block_coordinate = read_bin_unique_block_coord( + unique_block, type); /*get block coordinate and type*/ std::vector> instance_coords = - read_bin_unique_instance_coords(unique_block); /* get a list of instance coordinates*/ + read_bin_unique_instance_coords( + unique_block); /* get a list of instance coordinates*/ /* get block coordinate and instance coordinate, try to setup * device_rr_gsb */ if (type == uniqueblockcap::BlockType::SB) { diff --git a/openfpga/src/annotation/read_xml_unique_blocks.h b/openfpga/src/annotation/read_xml_unique_blocks.h index dd27a59ed..84f81502b 100644 --- a/openfpga/src/annotation/read_xml_unique_blocks.h +++ b/openfpga/src/annotation/read_xml_unique_blocks.h @@ -37,10 +37,11 @@ int read_xml_unique_blocks(DeviceRRGSB& device_rr_gsb, const char* file_name, bool verbose_output); std::vector> read_bin_unique_instance_coords( - const uniqueblockcap::BlockInfo::Reader& unique_block); + const uniqueblockcap::UniqueBlockPacked::Reader& unique_block); vtr::Point read_bin_unique_block_coord( - const uniqueblockcap::BlockInfo::Reader& unique_block, std::string& type); + const uniqueblockcap::UniqueBlockPacked::Reader& unique_block, + uniqueblockcap::BlockType& type); int read_bin_unique_blocks(DeviceRRGSB& device_rr_gsb, const char* file_name, bool verbose_output);