write bin function no compile error
This commit is contained in:
parent
0cca4952bc
commit
3fcdc10d3a
|
@ -18,13 +18,13 @@ enum BlockType {
|
|||
|
||||
struct BlockInfo {
|
||||
type @0: BlockType;
|
||||
x @1: Int32;
|
||||
y @2: Int32;
|
||||
x @1: UInt32;
|
||||
y @2: UInt32;
|
||||
}
|
||||
|
||||
struct InstanceInfo {
|
||||
x @0: Int32;
|
||||
y @1: Int32;
|
||||
x @0: UInt32;
|
||||
y @1: UInt32;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -190,26 +190,24 @@ int write_xml_unique_blocks(const DeviceRRGSB& device_rr_gsb, const char* fname,
|
|||
return CMD_EXEC_SUCCESS;
|
||||
}
|
||||
|
||||
// int write_bin_atom_block(std::fstream& fp,
|
||||
// const std::vector<vtr::Point<size_t>>& instance_map,
|
||||
// int write_bin_atom_block(const std::vector<vtr::Point<size_t>>& instance_map,
|
||||
// const vtr::Point<size_t>& unique_block_coord,
|
||||
// std::string type,
|
||||
// ucap::RrGraph::Builder &root) {
|
||||
|
||||
// root.init
|
||||
// write_xml_attribute(fp, "type", type.c_str());
|
||||
// write_xml_attribute(fp, "x", unique_block_coord.x());
|
||||
// write_xml_attribute(fp, "y", unique_block_coord.y());
|
||||
|
||||
// for (const auto& instance_info : instance_map) {
|
||||
// if (instance_info.x() == unique_block_coord.x() &&
|
||||
// instance_info.y() == unique_block_coord.y()) {
|
||||
// const uniqueblockcap::BlockType type,
|
||||
// uniqueblockcap::UniqueBlockPacked::Builder &root) {
|
||||
//
|
||||
// auto block_info = root.initBlockInfo();
|
||||
// block_info.setX(unique_block_coord.x());
|
||||
// block_info.setY(unique_block_coord.y());
|
||||
// block_info.setType(type);
|
||||
// auto instance_list = root.initInstanceList(instance_map.size());
|
||||
// for (size_t instance_id = 0; instance_id < instance_map; instance_id++) {
|
||||
// if (instance_map[instance_id].x() == unique_block_coord.x() &&
|
||||
// instance_map[instance_id].y() == unique_block_coord.y()) {
|
||||
// ;
|
||||
// } else {
|
||||
// openfpga::write_tab_to_file(fp, 2);
|
||||
// fp << "<instance";
|
||||
// write_xml_attribute(fp, "x", instance_info.x());
|
||||
// write_xml_attribute(fp, "y", instance_info.y());
|
||||
// auto instance = instance_list[instance_id];
|
||||
// instance.setX(instance_map[instance_id].x());
|
||||
// instance.setY(instance_map[instance_id].y());
|
||||
// }
|
||||
// }
|
||||
// return openfpga::CMD_EXEC_SUCCESS;
|
||||
|
@ -224,37 +222,46 @@ int write_bin_unique_blocks(const DeviceRRGSB& device_rr_gsb, const char* fname,
|
|||
int num_unique_blocks = device_rr_gsb.get_num_sb_unique_module() +
|
||||
device_rr_gsb.get_num_cb_unique_module(CHANX) +
|
||||
device_rr_gsb.get_num_cb_unique_module(CHANY);
|
||||
unique_blocks.initAtomInfo(num_unique_blocks);
|
||||
// for (size_t id = 0; id < device_rr_gsb.get_num_sb_unique_module(); ++id) {
|
||||
// const auto unique_block_coord = device_rr_gsb.get_sb_unique_block_coord(id);
|
||||
// const std::vector<vtr::Point<size_t>> instance_map =
|
||||
// device_rr_gsb.get_sb_unique_block_instance_coord(unique_block_coord);
|
||||
auto block_list = unique_blocks.initAtomInfo(num_unique_blocks);
|
||||
|
||||
// auto unique_block = unique_blocks[id];
|
||||
// auto block_info = unique_block.initBlockInfo();
|
||||
// block_info.setX(unique_block_coord.x());
|
||||
// block_info.setY(unique_block_coord.y());
|
||||
// block_info.setType(SB);
|
||||
// auto instance_list = unique_block.initInstanceList(instance_map.size());
|
||||
// for (size_t instance_id = 0; instance_id < instance_map; instance_id++) {
|
||||
// if (instance_map[instance_id].x() == unique_block_coord.x() &&
|
||||
// instance_map[instance_id].y() == unique_block_coord.y()) {
|
||||
// ;
|
||||
// } else {
|
||||
// auto instance = instance_list[instance_id];
|
||||
// instance.setX(instance_map[instance_id].x());
|
||||
// instance.setY(instance_map[instance_id].y());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
for (size_t id = 0; id < device_rr_gsb.get_num_sb_unique_module(); ++id) {
|
||||
const auto unique_block_coord = device_rr_gsb.get_sb_unique_block_coord(id);
|
||||
const std::vector<vtr::Point<size_t>> instance_map =
|
||||
device_rr_gsb.get_sb_unique_block_instance_coord(unique_block_coord);
|
||||
|
||||
auto unique_block = block_list[id];
|
||||
|
||||
auto block_info = unique_block.initBlockInfo();
|
||||
block_info.setX(unique_block_coord.x());
|
||||
block_info.setY(unique_block_coord.y());
|
||||
block_info.setType(uniqueblockcap::BlockType::SB);
|
||||
auto instance_list = unique_block.initInstanceList(instance_map.size());
|
||||
for (size_t instance_id = 0; instance_id < instance_map; instance_id++) {
|
||||
if (instance_map[instance_id].x() == unique_block_coord.x() &&
|
||||
instance_map[instance_id].y() == unique_block_coord.y()) {
|
||||
;
|
||||
} else {
|
||||
auto instance = instance_list[instance_id];
|
||||
instance.setX(instance_map[instance_id].x());
|
||||
instance.setY(instance_map[instance_id].y());
|
||||
}
|
||||
}
|
||||
|
||||
// int status_code = write_bin_atom_block(instance_map, unique_block_coord,
|
||||
// uniqueblockcap::BlockType::SB, unique_block);
|
||||
// if (status_code != 0) {
|
||||
// VTR_LOG_ERROR("write cbx unique blocks into xml file failed!");
|
||||
// return CMD_EXEC_FATAL_ERROR;
|
||||
// }
|
||||
}
|
||||
|
||||
// for (size_t id = device_rr_gsb.get_num_sb_unique_module();
|
||||
// id < device_rr_gsb.get_num_sb_unique_module() +
|
||||
// device_rr_gsb.get_num_cb_unique_module(CHANX);
|
||||
// ++id) {
|
||||
// const auto unique_block_coord = device_rr_gsb.get_cbx_unique_block_coord(id);
|
||||
// const std::vector<vtr::Point<size_t>> instance_map =
|
||||
// const auto unique_block_coord =
|
||||
// device_rr_gsb.get_cbx_unique_block_coord(id); const
|
||||
// std::vector<vtr::Point<size_t>> instance_map =
|
||||
// device_rr_gsb.get_cbx_unique_block_instance_coord(unique_block_coord);
|
||||
|
||||
// auto unique_block = unique_blocks[id];
|
||||
|
@ -275,13 +282,13 @@ int write_bin_unique_blocks(const DeviceRRGSB& device_rr_gsb, const char* fname,
|
|||
// }
|
||||
// }
|
||||
|
||||
|
||||
// for (size_t id = device_rr_gsb.get_num_sb_unique_module();
|
||||
// id < device_rr_gsb.get_num_sb_unique_module() +
|
||||
// device_rr_gsb.get_num_cb_unique_module(CHANY);
|
||||
// ++id) {
|
||||
// const auto unique_block_coord = device_rr_gsb.get_cby_unique_block_coord(id);
|
||||
// const std::vector<vtr::Point<size_t>> instance_map =
|
||||
// const auto unique_block_coord =
|
||||
// device_rr_gsb.get_cby_unique_block_coord(id); const
|
||||
// std::vector<vtr::Point<size_t>> instance_map =
|
||||
// device_rr_gsb.get_cby_unique_block_instance_coord(unique_block_coord);
|
||||
|
||||
// auto unique_block = unique_blocks[id];
|
||||
|
@ -301,7 +308,7 @@ int write_bin_unique_blocks(const DeviceRRGSB& device_rr_gsb, const char* fname,
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
// writeMessageToFile(fname, &builder);
|
||||
writeMessageToFile(fname, &builder);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,5 +35,10 @@ int write_xml_unique_blocks(const DeviceRRGSB& device_rr_gsb, const char* fname,
|
|||
bool verbose_output);
|
||||
int write_bin_unique_blocks(const DeviceRRGSB& device_rr_gsb, const char* fname,
|
||||
bool verbose_output);
|
||||
|
||||
// int write_bin_atom_block(const std::vector<vtr::Point<size_t>>& instance_map,
|
||||
// const vtr::Point<size_t>& unique_block_coord,
|
||||
// const ::uniqueblockcap::BlockType type,
|
||||
// uniqueblockcap::UniqueBlockPacked::Builder &root);
|
||||
} // namespace openfpga
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue