Horizon
net.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "pool/unit.hpp"
4 #include "util/uuid.hpp"
5 #include "util/uuid_provider.hpp"
6 #include "util/uuid_ptr.hpp"
7 #include <fstream>
8 #include <map>
9 #include <vector>
10 
11 #include "net_class.hpp"
12 
13 namespace horizon {
14 using json = nlohmann::json;
15 
16 class Net : public UUIDProvider {
17 public:
18  Net(const UUID &uu, const json &, class Block &block);
19  Net(const UUID &uu, const json &);
20  Net(const UUID &uu);
21  virtual UUID get_uuid() const;
22  UUID uuid;
23  std::string name;
24  bool is_power = false;
25 
26  enum class PowerSymbolStyle { GND, EARTH, DOT, ANTENNA };
27  PowerSymbolStyle power_symbol_style = PowerSymbolStyle::GND;
28 
29  uuid_ptr<NetClass> net_class;
30  uuid_ptr<Net> diffpair;
31  bool diffpair_master = false;
32 
33  // not saved
34  bool is_power_forced = false;
35  bool is_bussed = false;
36  unsigned int n_pins_connected = 0;
37  bool has_bus_rippers = false;
38  json serialize() const;
39  bool is_named() const;
40 };
41 } // namespace horizon
a class to store JSON values
Definition: json.hpp:161
Interface for objects that have a UUID.
Definition: uuid_provider.hpp:9
A block is one level of hierarchy in the netlist.
Definition: block.hpp:26
Definition: uuid_ptr.hpp:9
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: block.cpp:9
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
Definition: net.hpp:16