Skip to content

Instantly share code, notes, and snippets.

View duck2's full-sized avatar

Duck Deux duck2

View GitHub Profile
@duck2
duck2 / rr.cpp
Last active March 24, 2019 21:23
draft for rr_graph.xml reader with SAX
#include <cstring>
#include <fstream>
#include <iostream>
#include <unordered_map>
#include <stack>
#include <vector>
#include <libxml/parser.h>
#pragma pack(1)
@duck2
duck2 / fpga_architecture.hpp
Last active June 14, 2019 03:16
xsd-generated structs for arch.xml
#include <memory>
#include <string>
#include <vector>
namespace fpga_architecture {
struct t_meta;
struct t_port;
struct t_model_type;
struct t_fill;

Difference between XSD-generated and hand-written arch structures

Metadata

Hand-written structure:

struct t_metadata_dict : std::unordered_map<
                             std::string,
                             std::vector<t_metadata_value>>
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="hello">
<xsd:sequence>
<xsd:element name="greeting" type="xsd:string"></xsd:element>
<xsd:element name="name" type="xsd:string" maxOccurs="unbounded"></xsd:element>
</xsd:sequence>
</xsd:complexType>
#include <cstring>
#include <memory>
#include <iostream>
#include <string>
#include <vector>
#include "pugixml.hpp"
struct t_hello;
#include <bitset>
#include <cstring>
#include <memory>
#include <string>
#include <vector>
#include "pugixml.hpp"
struct t_channel;
struct t_x_list;
#include <bitset>
#include <cstring>
#include <memory>
#include <string>
#include <vector>
#include <stddef.h>
#include <stdint.h>
#include "pugixml.hpp"
#include <bitset>
#include <cstring>
#include <memory>
#include <string>
#include <vector>
#include <error.h>
#include <stddef.h>
#include <stdint.h>
#include "pugixml.hpp"
#include <bitset>
#include <cstring>
#include <iostream>
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include <error.h>
#include <stddef.h>
#include <bitset>
#include <cstring>
#include <iostream>
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include <error.h>
#include <stddef.h>