[core] code format

This commit is contained in:
tangxifan 2023-10-06 18:20:55 -07:00
parent b07111497c
commit 93cbbf2045
2 changed files with 15 additions and 12 deletions

View File

@ -90,11 +90,13 @@ size_t find_bitstream_manager_config_bit_index_in_grandparent_block(
size_t curr_index = 0; size_t curr_index = 0;
ConfigBlockId parent_blk = bitstream_manager.bit_parent_block(bit_id); ConfigBlockId parent_blk = bitstream_manager.bit_parent_block(bit_id);
ConfigBlockId grandparent_blk = bitstream_manager.block_parent(parent_blk); ConfigBlockId grandparent_blk = bitstream_manager.block_parent(parent_blk);
for (const ConfigBlockId& cand_blk : bitstream_manager.block_children(grandparent_blk)) { for (const ConfigBlockId& cand_blk :
bitstream_manager.block_children(grandparent_blk)) {
if (cand_blk != parent_blk) { if (cand_blk != parent_blk) {
curr_index += bitstream_manager.block_bits(cand_blk).size(); curr_index += bitstream_manager.block_bits(cand_blk).size();
} else { } else {
curr_index += find_bitstream_manager_config_bit_index_in_parent_block(bitstream_manager, bit_id); curr_index += find_bitstream_manager_config_bit_index_in_parent_block(
bitstream_manager, bit_id);
break; break;
} }
} }
@ -102,7 +104,6 @@ size_t find_bitstream_manager_config_bit_index_in_grandparent_block(
return curr_index; return curr_index;
} }
/******************************************************************** /********************************************************************
* Find the total number of configuration bits under a block * Find the total number of configuration bits under a block
* As configuration bits are stored only under the leaf blocks, * As configuration bits are stored only under the leaf blocks,

View File

@ -80,7 +80,9 @@ static int write_fabric_config_bit_to_xml_file(
write_tab_to_file(fp, xml_hierarchy_depth); write_tab_to_file(fp, xml_hierarchy_depth);
fp << "<bit id=\"" << size_t(fabric_bit) << "\""; fp << "<bit id=\"" << size_t(fabric_bit) << "\"";
if (options.output_value() && !options.value_to_skip(bitstream_manager.bit_value(fabric_bitstream.config_bit(fabric_bit)))) { if (options.output_value() &&
!options.value_to_skip(
bitstream_manager.bit_value(fabric_bitstream.config_bit(fabric_bit)))) {
fp << " value=\""; fp << " value=\"";
fp << bitstream_manager.bit_value(fabric_bitstream.config_bit(fabric_bit)); fp << bitstream_manager.bit_value(fabric_bitstream.config_bit(fabric_bit));
fp << "\""; fp << "\"";
@ -105,14 +107,15 @@ static int write_fabric_config_bit_to_xml_file(
} }
hie_path += generate_configurable_memory_data_out_name(); hie_path += generate_configurable_memory_data_out_name();
hie_path += std::string("["); hie_path += std::string("[");
size_t bit_idx_in_parent_block = find_bitstream_manager_config_bit_index_in_parent_block( size_t bit_idx_in_parent_block =
bitstream_manager, config_bit); find_bitstream_manager_config_bit_index_in_parent_block(bitstream_manager,
config_bit);
if (options.trim_path()) { if (options.trim_path()) {
bit_idx_in_parent_block = find_bitstream_manager_config_bit_index_in_grandparent_block( bit_idx_in_parent_block =
bitstream_manager, config_bit); find_bitstream_manager_config_bit_index_in_grandparent_block(
bitstream_manager, config_bit);
} }
hie_path += hie_path += std::to_string(bit_idx_in_parent_block);
std::to_string(bit_idx_in_parent_block);
hie_path += std::string("]"); hie_path += std::string("]");
fp << " path=\"" << hie_path << "\">\n"; fp << " path=\"" << hie_path << "\">\n";
@ -211,8 +214,7 @@ static int write_fabric_regional_config_bit_to_xml_file(
const FabricBitstream& fabric_bitstream, const FabricBitstream& fabric_bitstream,
const FabricBitRegionId& fabric_region, const FabricBitRegionId& fabric_region,
const e_config_protocol_type& config_type, bool fast_xml, const e_config_protocol_type& config_type, bool fast_xml,
const int& xml_hierarchy_depth, const int& xml_hierarchy_depth, const BitstreamWriterOption& options) {
const BitstreamWriterOption& options) {
if (false == valid_file_stream(fp)) { if (false == valid_file_stream(fp)) {
return 1; return 1;
} }