/* The XML parser processes an XML file into a tree data structure composed of
* pugi::xml_nodes. Each node represents an XML element. For example
* will generate two pugi::xml_nodes. One called "a" and its
* child "b". Each pugi::xml_node can contain various XML data such as attribute
* information and text content. The XML parser provides several functions to
* help the developer build, and traverse tree (this is also somtime referred to
* as the Document Object Model or DOM).
*
* For convenience it often makes sense to use some wraper functions (provided in
* the pugiutil namespace of libvtrutil) which simplify loading an XML file and
* error handling.
*
* The function pugiutil::load_xml() reads in an xml file.
*
* The function pugiutil::get_single_child() returns a child xml_node for a given parent
* xml_node if there is a child which matches the name provided by the developer.
*
* The function pugiutil::get_attribute() is used to extract attributes from an
* xml_node, returning a pugi::xml_attribute. xml_attribute objects support accessors
* such as as_float(), as_int() to retrieve semantic values. See pugixml documentation
* for more details.
*
* Architecture file checks already implemented (Daniel Chen):
* - Duplicate pb_types, pb_type ports, models, model ports,
* interconnects, interconnect annotations.
* - Port and pin range checking (port with 4 pins can only be
* accessed within [0:3].
* - LUT delay matrix size matches # of LUT inputs
* - Ensures XML tags are ordered.
* - Clocked primitives that have timing annotations must have a clock
* name matching the primitive.
* - Enforced VPR definition of LUT and FF must have one input port (n pins)
* and one output port(1 pin).
* - Checks file extension for blif and architecture xml file, avoid crashes if
* the two files are swapped on command line.
*
*/
#include
#include