Horizon
rule_match.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "util/uuid.hpp"
4 #include <set>
5 
6 namespace horizon {
7 using json = nlohmann::json;
8 
9 class RuleMatch {
10 public:
11  RuleMatch();
12  RuleMatch(const json &j, const class RuleImportMap &import_map);
13  RuleMatch(const json &j);
14  json serialize() const;
15  std::string get_brief(const class Block *block = nullptr) const;
16  void cleanup(const class Block *block);
17  bool can_export() const;
18 
19  enum class Mode { ALL, NET, NETS, NET_CLASS, NET_NAME_REGEX, NET_CLASS_REGEX };
20  Mode mode = Mode::ALL;
21 
22  UUID net;
23  std::set<UUID> nets;
24  UUID net_class;
25  std::string net_name_regex;
26  std::string net_class_regex;
27 
28  bool match(const class Net *net) const;
29 };
30 } // namespace horizon
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Definition: net.hpp:11
Definition: rule.hpp:37
Definition: rule_match.hpp:9
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
a class to store JSON values
Definition: json.hpp:177
basic_json<> json
default JSON class
Definition: json_fwd.hpp:62