Horizon
bus.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "net.hpp"
4 #include "pool/unit.hpp"
5 #include "util/uuid.hpp"
6 #include "util/uuid_ptr.hpp"
7 #include <map>
8 
9 namespace horizon {
10 using json = nlohmann::json;
11 
18 class Bus {
19 public:
20  class Member {
21  public:
22  Member(const UUID &uu, const json &, class Block &block);
23  Member(const UUID &uu);
24  UUID uuid;
25  std::string name;
26  uuid_ptr<Net> net = nullptr;
27  json serialize() const;
28  UUID get_uuid() const;
29  };
30 
31  Bus(const UUID &uu, const json &, class Block &block);
32  Bus(const UUID &uu);
33  UUID get_uuid() const;
34  UUID uuid;
35  std::string name;
36  std::map<UUID, Member> members;
37  bool is_referenced = false;
38  void update_refs(Block &block);
39  json serialize() const;
40 };
41 } // namespace horizon
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Definition: bus.hpp:20
A Bus is used for grouping nets.
Definition: bus.hpp:18
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