Horizon
net.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "util/uuid.hpp"
4 #include "util/uuid_ptr.hpp"
5 #include "util/uuid_vec.hpp"
6 #include "pool/unit.hpp"
7 
8 namespace horizon {
9 using json = nlohmann::json;
10 
11 class Net {
12 public:
13  Net(const UUID &uu, const json &, class Block &block);
14  Net(const UUID &uu, const json &);
15  Net(const UUID &uu);
16  UUID get_uuid() const;
17  UUID uuid;
18  std::string name;
19  bool is_power = false;
20 
21  enum class PowerSymbolStyle { GND, EARTH, DOT, ANTENNA };
22  PowerSymbolStyle power_symbol_style = PowerSymbolStyle::GND;
23  bool power_symbol_name_visible = true;
24 
25  uuid_ptr<class NetClass> net_class;
26  uuid_ptr<Net> diffpair;
27  bool diffpair_master = false;
28 
29  bool is_port = false;
30  Pin::Direction port_direction = Pin::Direction::BIDIRECTIONAL;
31 
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  std::vector<UUIDVec> hrefs;
39  bool is_nc = false;
40  json serialize() const;
41  bool is_named() const;
42 };
43 } // namespace horizon
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Definition: net.hpp:11
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Definition: uuid_ptr.hpp:8
a class to store JSON values
Definition: json.hpp:177
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62