Horizon
rule_match.hpp
1 #pragma once
2 #include "nlohmann/json_fwd.hpp"
3 #include "util/uuid.hpp"
4 
5 namespace horizon {
6 using json = nlohmann::json;
7 
8 class RuleMatch {
9 public:
10  RuleMatch();
11  RuleMatch(const json &j, const class RuleImportMap &import_map);
12  RuleMatch(const json &j);
13  json serialize() const;
14  std::string get_brief(const class Block *block = nullptr) const;
15  void cleanup(const class Block *block);
16  bool can_export() const;
17 
18  enum class Mode { ALL, NET, NET_CLASS, NET_NAME_REGEX, NET_CLASS_REGEX };
19  Mode mode = Mode::ALL;
20 
21  UUID net;
22  UUID net_class;
23  std::string net_name_regex;
24  std::string net_class_regex;
25 
26  bool match(const class Net *net) const;
27 };
28 } // namespace horizon
A block is one level of hierarchy in the netlist.
Definition: block.hpp:29
Definition: net.hpp:11
Definition: rule.hpp:34
Definition: rule_match.hpp:8
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