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