Horizon
Loading...
Searching...
No Matches
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
8namespace horizon {
9using json = nlohmann::json;
10
11class Net {
12public:
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
26 uuid_ptr<Net> diffpair;
27 bool diffpair_primary = 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 bool keep = false;
37 unsigned int n_pins_connected = 0;
38 bool has_bus_rippers = false;
39 std::vector<UUIDVec> hrefs;
40 bool is_nc = false;
41 json serialize() const;
42 bool is_named() const;
43};
44} // 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