add root node to fabric bitstream XML file format
This commit is contained in:
parent
a3eba8acbe
commit
8dd26094b8
|
@ -76,6 +76,7 @@ int write_fabric_config_bit_to_xml_file(std::fstream& fp,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write_tab_to_file(fp, 1);
|
||||||
fp << "<bit id=\"" << size_t(fabric_bit) << "\" ";
|
fp << "<bit id=\"" << size_t(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));
|
||||||
|
@ -85,11 +86,11 @@ int write_fabric_config_bit_to_xml_file(std::fstream& fp,
|
||||||
const ConfigBitId& config_bit = fabric_bitstream.config_bit(fabric_bit);
|
const ConfigBitId& config_bit = fabric_bitstream.config_bit(fabric_bit);
|
||||||
const ConfigBlockId& config_block = bitstream_manager.bit_parent_block(config_bit);
|
const ConfigBlockId& config_block = bitstream_manager.bit_parent_block(config_bit);
|
||||||
std::vector<ConfigBlockId> block_hierarchy = find_bitstream_manager_block_hierarchy(bitstream_manager, config_block);
|
std::vector<ConfigBlockId> block_hierarchy = find_bitstream_manager_block_hierarchy(bitstream_manager, config_block);
|
||||||
write_tab_to_file(fp, 1);
|
write_tab_to_file(fp, 2);
|
||||||
fp << "<hierarchy>\n";
|
fp << "<hierarchy>\n";
|
||||||
size_t hierarchy_counter = 0;
|
size_t hierarchy_counter = 0;
|
||||||
for (const ConfigBlockId& temp_block : block_hierarchy) {
|
for (const ConfigBlockId& temp_block : block_hierarchy) {
|
||||||
write_tab_to_file(fp, 2);
|
write_tab_to_file(fp, 3);
|
||||||
fp << "<instance level=\"" << hierarchy_counter << "\"";
|
fp << "<instance level=\"" << hierarchy_counter << "\"";
|
||||||
if (0 < bitstream_manager.block_bits(temp_block).size()) {
|
if (0 < bitstream_manager.block_bits(temp_block).size()) {
|
||||||
fp << " width=\"" << bitstream_manager.block_bits(temp_block).size() << "\"";
|
fp << " width=\"" << bitstream_manager.block_bits(temp_block).size() << "\"";
|
||||||
|
@ -98,7 +99,7 @@ int write_fabric_config_bit_to_xml_file(std::fstream& fp,
|
||||||
fp << "/>\n";
|
fp << "/>\n";
|
||||||
hierarchy_counter++;
|
hierarchy_counter++;
|
||||||
}
|
}
|
||||||
write_tab_to_file(fp, 1);
|
write_tab_to_file(fp, 2);
|
||||||
fp << "</hierarchy>\n";
|
fp << "</hierarchy>\n";
|
||||||
|
|
||||||
switch (config_type) {
|
switch (config_type) {
|
||||||
|
@ -107,14 +108,14 @@ int write_fabric_config_bit_to_xml_file(std::fstream& fp,
|
||||||
break;
|
break;
|
||||||
case CONFIG_MEM_MEMORY_BANK: {
|
case CONFIG_MEM_MEMORY_BANK: {
|
||||||
/* Bit line address */
|
/* Bit line address */
|
||||||
write_tab_to_file(fp, 1);
|
write_tab_to_file(fp, 2);
|
||||||
fp << "<bl address=\"";
|
fp << "<bl address=\"";
|
||||||
for (const char& addr_bit : fabric_bitstream.bit_bl_address(fabric_bit)) {
|
for (const char& addr_bit : fabric_bitstream.bit_bl_address(fabric_bit)) {
|
||||||
fp << addr_bit;
|
fp << addr_bit;
|
||||||
}
|
}
|
||||||
fp << "\"/>\n";
|
fp << "\"/>\n";
|
||||||
|
|
||||||
write_tab_to_file(fp, 1);
|
write_tab_to_file(fp, 2);
|
||||||
fp << "<wl address=\"";
|
fp << "<wl address=\"";
|
||||||
for (const char& addr_bit : fabric_bitstream.bit_wl_address(fabric_bit)) {
|
for (const char& addr_bit : fabric_bitstream.bit_wl_address(fabric_bit)) {
|
||||||
fp << addr_bit;
|
fp << addr_bit;
|
||||||
|
@ -123,7 +124,7 @@ int write_fabric_config_bit_to_xml_file(std::fstream& fp,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CONFIG_MEM_FRAME_BASED: {
|
case CONFIG_MEM_FRAME_BASED: {
|
||||||
write_tab_to_file(fp, 1);
|
write_tab_to_file(fp, 2);
|
||||||
fp << "<frame address=\"";
|
fp << "<frame address=\"";
|
||||||
for (const char& addr_bit : fabric_bitstream.bit_address(fabric_bit)) {
|
for (const char& addr_bit : fabric_bitstream.bit_address(fabric_bit)) {
|
||||||
fp << addr_bit;
|
fp << addr_bit;
|
||||||
|
@ -137,6 +138,7 @@ int write_fabric_config_bit_to_xml_file(std::fstream& fp,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write_tab_to_file(fp, 1);
|
||||||
fp << "</bit>\n";
|
fp << "</bit>\n";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -175,6 +177,8 @@ int write_fabric_bitstream_to_xml_file(const BitstreamManager& bitstream_manager
|
||||||
/* Write XML head */
|
/* Write XML head */
|
||||||
write_fabric_bitstream_xml_file_head(fp);
|
write_fabric_bitstream_xml_file_head(fp);
|
||||||
|
|
||||||
|
fp << "<fabric_bitstream>\n";
|
||||||
|
|
||||||
/* Output fabric bitstream to the file */
|
/* Output fabric bitstream to the file */
|
||||||
int status = 0;
|
int status = 0;
|
||||||
for (const FabricBitId& fabric_bit : fabric_bitstream.bits()) {
|
for (const FabricBitId& fabric_bit : fabric_bitstream.bits()) {
|
||||||
|
@ -186,8 +190,9 @@ int write_fabric_bitstream_to_xml_file(const BitstreamManager& bitstream_manager
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print an end to the file here */
|
/* Print an end to the file here */
|
||||||
fp << std::endl;
|
fp << "</fabric_bitstream>\n";
|
||||||
|
|
||||||
/* Close file handler */
|
/* Close file handler */
|
||||||
fp.close();
|
fp.close();
|
||||||
|
|
Loading…
Reference in New Issue