From de4586217f9278a7463043b832f593bb7799a2d1 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Tue, 14 Jul 2020 12:04:22 -0600 Subject: [PATCH] now device binding is not mandatory for circuit models --- .../libarchopenfpga/src/read_xml_circuit_library.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libopenfpga/libarchopenfpga/src/read_xml_circuit_library.cpp b/libopenfpga/libarchopenfpga/src/read_xml_circuit_library.cpp index bb7905d48..9fb61a654 100644 --- a/libopenfpga/libarchopenfpga/src/read_xml_circuit_library.cpp +++ b/libopenfpga/libarchopenfpga/src/read_xml_circuit_library.cpp @@ -405,10 +405,14 @@ void read_xml_model_device_technology(pugi::xml_node& xml_model, const pugiutil::loc_data& loc_data, CircuitLibrary& circuit_lib, const CircuitModelId& model) { - auto xml_device_tech = get_single_child(xml_model, "device_technology", loc_data); + auto xml_device_tech = get_single_child(xml_model, "device_technology", loc_data, pugiutil::ReqOpt::OPTIONAL); + + if (!xml_device_tech) { + return; + } /* Parse device model name */ - const char* device_model_name_attr = get_attribute(xml_device_tech, "device_model_name", loc_data).value(); + const char* device_model_name_attr = get_attribute(xml_device_tech, "device_model_name", loc_data, pugiutil::ReqOpt::OPTIONAL).value(); if (nullptr != device_model_name_attr) { circuit_lib.set_device_model_name(model, std::string(device_model_name_attr)); }